Skip to content

Commit

Permalink
- [Docker]: Update CUDA version to 11.8 #583
Browse files Browse the repository at this point in the history
- [Docker] Rename `dstackai/miniforge` to `dstackai/base`
  • Loading branch information
peterschmidt85 committed Jul 24, 2023
1 parent f78c9e5 commit a1dd61d
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
2 changes: 1 addition & 1 deletion cli/dstack/_internal/backend/aws/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
2 changes: 1 addition & 1 deletion cli/dstack/_internal/backend/azure/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cli/dstack/_internal/backend/gcp/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions cli/dstack/_internal/configurators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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 [
Expand Down
2 changes: 1 addition & 1 deletion cli/dstack/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = None
__is_release__ = False
miniforge_image = "0.3"
base_image = "0.3"
2 changes: 1 addition & 1 deletion docs/blog/posts/v0.10.5-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions runner/ami/packer/provisioners/docker-image-with-cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions runner/ami/packer/provisioners/docker-image-without-cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a1dd61d

Please sign in to comment.