Skip to content

Commit

Permalink
change cuda base image to ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
OrellBuehler committed Jul 31, 2024
1 parent daed30c commit 2c0b9ad
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 18 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-and-upload-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and upload image

on:
workflow_call:
inputs:
actor:
required: true
type: string

imageTag:
required: true
type: string

dockerfile:
required: true
type: string

secrets:
ghToken:
required: true

env:
REGISTRY: ghcr.io/ateleris/vllm

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ inputs.actor }}
password: ${{ secrets.ghToken }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: ${{ inputs.dockerfile }}
push: true
tags: ${{ env.REGISTRY }}:${{ inputs.imageTag }}
17 changes: 17 additions & 0 deletions .github/workflows/build-nvidia-base-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build nvidia-base image

on:
push:
branches: [main]
workflow_dispatch:

jobs:
build:
name: Build image
uses: ./.github/workflows/build-and-upload-image.yml
with:
actor: ${{ github.actor }}
dockerfile: Dockerfile
imageTag: latest
secrets:
ghToken: ${{ secrets.GITHUB_TOKEN }}
36 changes: 18 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ARG CUDA_VERSION=12.4.1
#################### BASE BUILD IMAGE ####################
# prepare basic build environment
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 AS base
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS base

ARG CUDA_VERSION=12.4.1
ARG PYTHON_VERSION=3.10
Expand Down Expand Up @@ -98,28 +98,28 @@ ARG USE_SCCACHE
# if USE_SCCACHE is set, use sccache to speed up compilation
RUN --mount=type=cache,target=/root/.cache/pip \
if [ "$USE_SCCACHE" = "1" ]; then \
echo "Installing sccache..." \
&& curl -L -o sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz \
&& tar -xzf sccache.tar.gz \
&& sudo mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/sccache \
&& rm -rf sccache.tar.gz sccache-v0.8.1-x86_64-unknown-linux-musl \
&& if [ "$CUDA_VERSION" = "11.8.0" ]; then \
export SCCACHE_BUCKET=vllm-build-sccache-2; \
else \
export SCCACHE_BUCKET=vllm-build-sccache; \
fi \
&& export SCCACHE_REGION=us-west-2 \
&& export CMAKE_BUILD_TYPE=Release \
&& sccache --show-stats \
&& python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 \
&& sccache --show-stats; \
echo "Installing sccache..." \
&& curl -L -o sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz \
&& tar -xzf sccache.tar.gz \
&& sudo mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/sccache \
&& rm -rf sccache.tar.gz sccache-v0.8.1-x86_64-unknown-linux-musl \
&& if [ "$CUDA_VERSION" = "11.8.0" ]; then \
export SCCACHE_BUCKET=vllm-build-sccache-2; \
else \
export SCCACHE_BUCKET=vllm-build-sccache; \
fi \
&& export SCCACHE_REGION=us-west-2 \
&& export CMAKE_BUILD_TYPE=Release \
&& sccache --show-stats \
&& python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 \
&& sccache --show-stats; \
fi

ENV CCACHE_DIR=/root/.cache/ccache
RUN --mount=type=cache,target=/root/.cache/ccache \
--mount=type=cache,target=/root/.cache/pip \
if [ "$USE_SCCACHE" != "1" ]; then \
python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
fi

# check the size of the wheel, we cannot upload wheels larger than 100MB
Expand Down Expand Up @@ -156,7 +156,7 @@ RUN pip --verbose wheel -r requirements-mamba.txt \

#################### vLLM installation IMAGE ####################
# image with vLLM installed
FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu20.04 AS vllm-base
FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu22.04 AS vllm-base
ARG CUDA_VERSION=12.4.1
ARG PYTHON_VERSION=3.10
WORKDIR /vllm-workspace
Expand Down

0 comments on commit 2c0b9ad

Please sign in to comment.