From f78c9e57890925e29f777852689dd09bd041d6bb Mon Sep 17 00:00:00 2001 From: peterschmidt85 Date: Mon, 24 Jul 2023 10:27:23 +0200 Subject: [PATCH 1/3] - [Docker]: Update CUDA version to 11.8 #583 --- .github/workflows/docker.yml | 2 +- cli/dstack/_internal/configurators/__init__.py | 2 +- docker/cuda/Dockerfile | 4 ++-- .../ami/packer/provisioners/docker-image-with-cuda.sh | 10 +++++----- runner/consts/consts.go | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 32104851f..74b53a6a9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -40,7 +40,7 @@ jobs: docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-amd64 -f cpu/Dockerfile . docker manifest create dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }} --amend dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-arm64 --amend dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-amd64 docker manifest push dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }} - docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-cuda-11.4 -f cuda/Dockerfile . + docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-cuda-11.8 -f cuda/Dockerfile . build-aws-images: defaults: diff --git a/cli/dstack/_internal/configurators/__init__.py b/cli/dstack/_internal/configurators/__init__.py index 9ae64488c..9d8129bf2 100644 --- a/cli/dstack/_internal/configurators/__init__.py +++ b/cli/dstack/_internal/configurators/__init__.py @@ -200,7 +200,7 @@ def image_name(self) -> str: if self.conf.image is not None: return self.conf.image if self.profile.resources and self.profile.resources.gpu: - return f"dstackai/miniforge:py{self.python()}-{version.miniforge_image}-cuda-11.4" + return f"dstackai/miniforge:py{self.python()}-{version.miniforge_image}-cuda-11.8" return f"dstackai/miniforge:py{self.python()}-{version.miniforge_image}" def cache_specs(self) -> List[job.CacheSpec]: diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index 5a7294b2c..9e004eb78 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -1,4 +1,4 @@ -FROM dstackai/cuda:11.4-base-ubuntu20.04 +FROM dstackai/cuda:11.8.0-base-ubuntu20.04 ARG PYTHON ENV PYTHON=$PYTHON @@ -24,7 +24,7 @@ RUN wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/lat echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ /opt/conda/condabin/conda update conda --all -y && \ /opt/conda/condabin/conda create --name workflow python=${PYTHON} -y && \ - /opt/conda/condabin/conda config --prepend channels "nvidia/label/cuda-11.4.3" && \ + /opt/conda/condabin/conda config --prepend channels "nvidia/label/cuda-11.8.0" && \ /opt/conda/condabin/conda config --set always_yes true && \ /opt/conda/condabin/conda clean --all && \ echo "conda activate workflow" >> ~/.bashrc \ No newline at end of file diff --git a/runner/ami/packer/provisioners/docker-image-with-cuda.sh b/runner/ami/packer/provisioners/docker-image-with-cuda.sh index 33cfee5ac..244a1eec2 100644 --- a/runner/ami/packer/provisioners/docker-image-with-cuda.sh +++ b/runner/ami/packer/provisioners/docker-image-with-cuda.sh @@ -3,11 +3,11 @@ set -e IMAGES=" - dstackai/miniforge:py3.11-${IMAGE_VERSION}-cuda-11.4 - dstackai/miniforge:py3.10-${IMAGE_VERSION}-cuda-11.4 - dstackai/miniforge:py3.9-${IMAGE_VERSION}-cuda-11.4 - dstackai/miniforge:py3.8-${IMAGE_VERSION}-cuda-11.4 - dstackai/miniforge:py3.7-${IMAGE_VERSION}-cuda-11.4 + dstackai/miniforge:py3.11-${IMAGE_VERSION}-cuda-11.8 + dstackai/miniforge:py3.10-${IMAGE_VERSION}-cuda-11.8 + dstackai/miniforge:py3.9-${IMAGE_VERSION}-cuda-11.8 + dstackai/miniforge:py3.8-${IMAGE_VERSION}-cuda-11.8 + dstackai/miniforge:py3.7-${IMAGE_VERSION}-cuda-11.8 " echo "START pull image" for img in $IMAGES; do diff --git a/runner/consts/consts.go b/runner/consts/consts.go index 85b8fb0aa..1d3393b9f 100644 --- a/runner/consts/consts.go +++ b/runner/consts/consts.go @@ -19,7 +19,7 @@ var ServerUrl = "https://api.stgn.dstack.ai" // GPU constants const ( - NVIDIA_CUDA_IMAGE = "dstackai/cuda:11.1-base-ubuntu20.04" + NVIDIA_CUDA_IMAGE = "dstackai/cuda:11.8.0-base-ubuntu20.04" NVIDIA_SMI_CMD = "nvidia-smi --query-gpu=name,memory.total --format=csv,noheader" NVIDIA_RUNTIME = "nvidia" NVIDIA_DRIVER_INIT_ERROR = "stderr: nvidia-container-cli: initialization error: nvml error: driver not loaded: unknown" From a1dd61d814f41b963e8eef728b06cc403ed6780b Mon Sep 17 00:00:00 2001 From: peterschmidt85 Date: Mon, 24 Jul 2023 10:33:48 +0200 Subject: [PATCH 2/3] - [Docker]: Update CUDA version to 11.8 #583 - [Docker] Rename `dstackai/miniforge` to `dstackai/base` --- .github/workflows/build.yml | 4 ++-- .github/workflows/docker.yml | 10 +++++----- .github/workflows/release.yml | 4 ++-- cli/dstack/_internal/backend/aws/runners.py | 2 +- cli/dstack/_internal/backend/azure/compute.py | 2 +- cli/dstack/_internal/backend/gcp/compute.py | 2 +- cli/dstack/_internal/configurators/__init__.py | 6 +++--- cli/dstack/version.py | 2 +- docs/blog/posts/v0.10.5-release.md | 2 +- .../ami/packer/provisioners/docker-image-with-cuda.sh | 10 +++++----- .../packer/provisioners/docker-image-without-cuda.sh | 10 +++++----- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a55a65f1f..f8a364568 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,10 +103,10 @@ jobs: - name: Upload pip package run: | VERSION=$((${{ github.run_number }} + 150)) - MINIFORGE_IMAGE=$(cat cli/dstack/version.py | grep miniforge_image) + BASE_IMAGE=$(cat cli/dstack/version.py | grep base_image) echo "__version__ = \"$VERSION\"" > cli/dstack/version.py echo "__is_release__ = False" >> cli/dstack/version.py - echo $MINIFORGE_IMAGE >> cli/dstack/version.py + echo $BASE_IMAGE >> cli/dstack/version.py cp README.md cli python setup.py sdist bdist_wheel python -m twine upload --repository testpypi --username ${{ secrets.TESTPYPI_USERNAME }} --password ${{ secrets.TESTPYPI_PASSWORD }} dist/* diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 74b53a6a9..7fd519811 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -36,11 +36,11 @@ jobs: uses: docker/setup-qemu-action@v2 - name: Build and upload to DockerHub run: | - docker buildx build --platform linux/arm64/v8 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-arm64 -f cpu/Dockerfile . - docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-amd64 -f cpu/Dockerfile . - docker manifest create dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }} --amend dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-arm64 --amend dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-amd64 - docker manifest push dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }} - docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/miniforge:py${{ matrix.python }}-${{ inputs.image_version }}-cuda-11.8 -f cuda/Dockerfile . + docker buildx build --platform linux/arm64/v8 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }}-arm64 -f cpu/Dockerfile . + docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }}-amd64 -f cpu/Dockerfile . + docker manifest create dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }} --amend dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }}-arm64 --amend dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }}-amd64 + docker manifest push dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }} + docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }}-cuda-11.8 -f cuda/Dockerfile . build-aws-images: defaults: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e03d657ca..37ea74962 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,10 +79,10 @@ jobs: - name: Upload pip package run: | VERSION=${GITHUB_REF#refs/tags/} - MINIFORGE_IMAGE=$(cat cli/dstack/version.py | grep miniforge_image) + BASE_IMAGE=$(cat cli/dstack/version.py | grep base_image) echo "__version__ = \"$VERSION\"" > cli/dstack/version.py echo "__is_release__ = True" >> cli/dstack/version.py - echo $MINIFORGE_IMAGE >> cli/dstack/version.py + echo $BASE_IMAGE >> cli/dstack/version.py cp README.md cli python setup.py sdist bdist_wheel python -m twine upload --repository pypi --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }} dist/* diff --git a/cli/dstack/_internal/backend/aws/runners.py b/cli/dstack/_internal/backend/aws/runners.py index e852dc343..91a13facf 100644 --- a/cli/dstack/_internal/backend/aws/runners.py +++ b/cli/dstack/_internal/backend/aws/runners.py @@ -650,7 +650,7 @@ def _get_ami_image( image_name = "dstack-" if cuda: image_name += "cuda-" - image_name += version.miniforge_image + image_name += version.base_image response = ec2_client.describe_images( Filters=[ diff --git a/cli/dstack/_internal/backend/azure/compute.py b/cli/dstack/_internal/backend/azure/compute.py index b9d7a436d..aea70e20d 100644 --- a/cli/dstack/_internal/backend/azure/compute.py +++ b/cli/dstack/_internal/backend/azure/compute.py @@ -206,7 +206,7 @@ def _get_image_ref( image_name = "dstack-" if cuda: image_name += "cuda-" - image_name += version.miniforge_image + image_name += version.base_image image = compute_client.community_gallery_images.get( location=location, diff --git a/cli/dstack/_internal/backend/gcp/compute.py b/cli/dstack/_internal/backend/gcp/compute.py index 1a679c8c0..ac9d10965 100644 --- a/cli/dstack/_internal/backend/gcp/compute.py +++ b/cli/dstack/_internal/backend/gcp/compute.py @@ -421,7 +421,7 @@ def _get_image_name( image_prefix = "dstack-" if len(instance_type.resources.gpus) > 0: image_prefix += "cuda-" - image_prefix += version.miniforge_image.replace(".", "-") + image_prefix += version.base_image.replace(".", "-") list_request = compute_v1.ListImagesRequest() list_request.project = "dstack" diff --git a/cli/dstack/_internal/configurators/__init__.py b/cli/dstack/_internal/configurators/__init__.py index 9d8129bf2..308fb1cbb 100644 --- a/cli/dstack/_internal/configurators/__init__.py +++ b/cli/dstack/_internal/configurators/__init__.py @@ -187,7 +187,7 @@ def build_commands(self) -> List[str]: def entrypoint(self) -> Optional[List[str]]: if self.conf.entrypoint is not None: return shlex.split(self.conf.entrypoint) - if self.conf.image is None: # dstackai/miniforge + if self.conf.image is None: # dstackai/base return ["/bin/bash", "-i", "-c"] if self.commands(): # custom docker image with commands return ["/bin/sh", "-i", "-c"] @@ -200,8 +200,8 @@ def image_name(self) -> str: if self.conf.image is not None: return self.conf.image if self.profile.resources and self.profile.resources.gpu: - return f"dstackai/miniforge:py{self.python()}-{version.miniforge_image}-cuda-11.8" - return f"dstackai/miniforge:py{self.python()}-{version.miniforge_image}" + return f"dstackai/base:py{self.python()}-{version.base_image}-cuda-11.8" + return f"dstackai/base:py{self.python()}-{version.base_image}" def cache_specs(self) -> List[job.CacheSpec]: return [ diff --git a/cli/dstack/version.py b/cli/dstack/version.py index 8a621fa00..48839456d 100644 --- a/cli/dstack/version.py +++ b/cli/dstack/version.py @@ -1,3 +1,3 @@ __version__ = None __is_release__ = False -miniforge_image = "0.3" +base_image = "0.3" diff --git a/docs/blog/posts/v0.10.5-release.md b/docs/blog/posts/v0.10.5-release.md index ff6af96ee..d4a273aa6 100644 --- a/docs/blog/posts/v0.10.5-release.md +++ b/docs/blog/posts/v0.10.5-release.md @@ -32,7 +32,7 @@ Once the project is configured, feel free to run dev environments and tasks in L ## Custom Docker images -By default, `dstack` uses its own base [Docker images](https://hub.docker.com/r/dstackai/miniforge/tags) to run +By default, `dstack` uses its own base [Docker images](https://hub.docker.com/r/dstackai/base/tags) to run dev environments and tasks. These base images come pre-configured with Python, Conda, and essential CUDA drivers. However, there may be times when you need additional dependencies that you don't want to install every time you run your dev environment or task. diff --git a/runner/ami/packer/provisioners/docker-image-with-cuda.sh b/runner/ami/packer/provisioners/docker-image-with-cuda.sh index 244a1eec2..a9f1228e7 100644 --- a/runner/ami/packer/provisioners/docker-image-with-cuda.sh +++ b/runner/ami/packer/provisioners/docker-image-with-cuda.sh @@ -3,11 +3,11 @@ set -e IMAGES=" - dstackai/miniforge:py3.11-${IMAGE_VERSION}-cuda-11.8 - dstackai/miniforge:py3.10-${IMAGE_VERSION}-cuda-11.8 - dstackai/miniforge:py3.9-${IMAGE_VERSION}-cuda-11.8 - dstackai/miniforge:py3.8-${IMAGE_VERSION}-cuda-11.8 - dstackai/miniforge:py3.7-${IMAGE_VERSION}-cuda-11.8 + dstackai/base:py3.11-${IMAGE_VERSION}-cuda-11.8 + dstackai/base:py3.10-${IMAGE_VERSION}-cuda-11.8 + dstackai/base:py3.9-${IMAGE_VERSION}-cuda-11.8 + dstackai/base:py3.8-${IMAGE_VERSION}-cuda-11.8 + dstackai/base:py3.7-${IMAGE_VERSION}-cuda-11.8 " echo "START pull image" for img in $IMAGES; do diff --git a/runner/ami/packer/provisioners/docker-image-without-cuda.sh b/runner/ami/packer/provisioners/docker-image-without-cuda.sh index e84ace9c7..5fc560262 100644 --- a/runner/ami/packer/provisioners/docker-image-without-cuda.sh +++ b/runner/ami/packer/provisioners/docker-image-without-cuda.sh @@ -3,11 +3,11 @@ set -e IMAGES=" - dstackai/miniforge:py3.11-${IMAGE_VERSION} - dstackai/miniforge:py3.10-${IMAGE_VERSION} - dstackai/miniforge:py3.9-${IMAGE_VERSION} - dstackai/miniforge:py3.8-${IMAGE_VERSION} - dstackai/miniforge:py3.7-${IMAGE_VERSION} + dstackai/base:py3.11-${IMAGE_VERSION} + dstackai/base:py3.10-${IMAGE_VERSION} + dstackai/base:py3.9-${IMAGE_VERSION} + dstackai/base:py3.8-${IMAGE_VERSION} + dstackai/base:py3.7-${IMAGE_VERSION} " echo "START pull image" for img in $IMAGES; do From b74dc7691001d7cfeeafb8d979245f870e712238 Mon Sep 17 00:00:00 2001 From: peterschmidt85 Date: Mon, 24 Jul 2023 14:12:50 +0200 Subject: [PATCH 3/3] - [Docker]: Update CUDA version to 11.8 #583 - [Docker] Updated `base_image` to `0.4rc2` --- cli/dstack/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/dstack/version.py b/cli/dstack/version.py index 48839456d..21f1dca4d 100644 --- a/cli/dstack/version.py +++ b/cli/dstack/version.py @@ -1,3 +1,3 @@ __version__ = None __is_release__ = False -base_image = "0.3" +base_image = "0.4rc2"