Skip to content

Commit

Permalink
🚨🚨🚨Move to using tags rather than latest for docker images and consol…
Browse files Browse the repository at this point in the history
…idate image repos 🚨 🚨🚨 (#2554)

* Move to using tags

* Add readme

* Include hf repo description in auto-build

* Test

* Even with an a...

* Rm readme things

* Symlink README for docker repo

* Include readme

* Fin

* Try now?

* Finally got symlink working

* Let's try this

* Forgot runs-on

* Still perm issues, revert
  • Loading branch information
muellerzr authored Mar 18, 2024
1 parent e8aaee5 commit 2ad42e7
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-docker-images-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
file: docker/accelerate-cpu/Dockerfile
push: true
tags: huggingface/accelerate-cpu:${{needs.get-version.outputs.version}}
tags: huggingface/accelerate:cpu-release-${{ needs.get-version.outputs.version }}

version-cuda:
name: "Latest Accelerate GPU [version]"
Expand All @@ -57,4 +57,4 @@ jobs:
with:
file: docker/accelerate-gpu/Dockerfile
push: true
tags: huggingface/accelerate-gpu:${{needs.get-version.outputs.version}}
tags: huggingface/accelerate:gpu-release-${{needs.get-version.outputs.version}}
17 changes: 14 additions & 3 deletions .github/workflows/build_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Get current date
id: date
run: |
echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_ENV
- name: Build and Push CPU
uses: docker/build-push-action@v4
with:
file: docker/accelerate-cpu/Dockerfile
push: true
tags: huggingface/accelerate-cpu
tags: |
huggingface/accelerate:cpu-nightly
huggingface/accelerate:cpu-nightly-${{ env.date }}
latest-cuda:
name: "Latest Accelerate GPU [dev]"
Expand All @@ -40,10 +46,15 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Get current date
id: date
run: |
echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_ENV
- name: Build and Push GPU
uses: docker/build-push-action@v4
with:
file: docker/accelerate-gpu/Dockerfile
push: true
tags: huggingface/accelerate-gpu
tags: |
huggingface/accelerate:gpu-nightly
huggingface/accelerate:gpu-nightly-${{ env.date }}
4 changes: 2 additions & 2 deletions .github/workflows/run_merge_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
CUDA_VISIBLE_DEVICES: "0"
container:
image: huggingface/accelerate-gpu:latest
image: huggingface/accelerate:gpu-nightly
options: --gpus all --shm-size "16gb"
defaults:
run:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
env:
CUDA_VISIBLE_DEVICES: 0,1
container:
image: huggingface/accelerate-gpu:latest
image: huggingface/accelerate:gpu-nightly
options: --gpus all --shm-size "16gb"
defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/self_hosted_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defaults:
jobs:
run-trainer-tests:
container:
image: huggingface/accelerate-gpu:latest
image: huggingface/accelerate:gpu-nightly
options: --gpus all --shm-size "16gb"
runs-on: [self-hosted, multi-gpu, nvidia-gpu, t4, ci]
strategy:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
run-skorch-tests:
container:
image: huggingface/accelerate-gpu:latest
image: huggingface/accelerate:gpu-nightly
options: --gpus all --shm-size "16gb"
runs-on: [self-hosted, multi-gpu, nvidia-gpu, t4, ci]
strategy:
Expand Down
72 changes: 72 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!---
Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Official Hugging Face Accelerate Docker Images

Accelerate publishes a variety of docker versions as part of our CI that users can also use. These are stable images that Accelerate can run off of which comes with a variety of different setup configurations, all of which are officially hosted on [Docker Hub](https://hub.docker.com/r/huggingface/accelerate).

A breakdown of each are given below

## Naming Conventions

Accelerate docker images follow a tagging convention of:

```bash
huggingface/accelerate:{accelerator}-{nightly,release}
```

`accelerator` in this instance is one of many applical pre-configured backend supports:
* `gpu`: Comes compiled off of the `nvidia/cuda` image and includes everything such as `deepspeed`, `bitsandbytes`, etc.
* `cpu`: Comes compiled off of `python:3.8-slim` and is designed for non-CUDA based workloads.
* More to come soon

## Nightlies vs Releases

Each release a new build is pushed with a version number included in the name. For a GPU-supported image of version 0.28.0 for instance, it would look like the following:

```bash
huggingface/accelerate:gpu-release-0.28.0
```

Nightlies contain two different image tags. There is a general `nightly` tag which is built each night, and a `nightly-YYYY-MM-DD` which corresponds to a build from a particular date.

For instance, here is an example nightly CPU image from 3/14/2024

```bash
huggingface/accelerate:cpu-nightly-2024-03-14
```

## Running the images

Each image comes compiled with `conda` and an `accelerate` environment contains all of the installed dependencies.

To pull down the latest nightly run:

```bash
docker pull huggingface/accelerate:gpu-nightly
```

To then run it in interactive mode with GPU-memory available, run:

```bash
docker container run --gpus all -it huggingface/accelerate:gpu-nightly
```

## DEPRECATED IMAGES

CPU and GPU docker images were hosted at `huggingface/accelerate-gpu` and `huggingface/accelerate-cpu`. These builds are now outdated and will not receive updates.

The builds at the corresponding `huggingface/accelerate:{gpu,cpu}` contain the same `Dockerfile`, so it's as simple as changing the docker image to the desired ones from above. We will not be deleting these images for posterity, but they will not be receiving updates going forward.

0 comments on commit 2ad42e7

Please sign in to comment.