Docker build & publish #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker build & publish | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: "0 1 * * *" # Daily “At 01:00” UTC | |
workflow_dispatch: | |
env: | |
push: ${{ github.repository == 'rapidsai/dask-build-environment' && contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) }} | |
STABLE_RAPIDS_VER: "24.10" | |
STABLE_UCX_PY_VER: "0.40" | |
NIGHTLY_RAPIDS_VER: "24.12" | |
NIGHTLY_UCX_PY_VER: "0.41" | |
jobs: | |
docker: | |
name: ${{ matrix.image.tag }} (${{ matrix.rapids }} RAPIDS, python ${{ matrix.python }}, CTK ${{ matrix.cuda }}, ${{ matrix.linux }}, ${{ matrix.platform }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: ["linux/amd64"] | |
cuda: ["11.8.0"] | |
python: ["3.10", "3.11", "3.12"] | |
linux: ["ubuntu20.04"] | |
rapids: ["stable", "nightly"] | |
image: | |
- tag: "rapidsai/dask" | |
context: "./dask" | |
- tag: "rapidsai/distributed" | |
context: "./distributed" | |
- tag: "rapidsai/dask_image" | |
context: "./dask_image" | |
# dask-image gpuCI isn't dependent on RAPIDS | |
exclude: | |
- image: | |
tag: "rapidsai/dask_image" | |
rapids: "stable" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Compute RAPIDS / UCX-Py versions | |
run: | | |
case ${{ matrix.rapids }} in | |
"stable") | |
rapids_ver=${{ env.STABLE_RAPIDS_VER }} | |
ucx_py_ver=${{ env.STABLE_UCX_PY_VER }} | |
;; | |
"nightly") | |
rapids_ver=${{ env.NIGHTLY_RAPIDS_VER }} | |
ucx_py_ver=${{ env.NIGHTLY_UCX_PY_VER }} | |
;; | |
*) | |
echo "Invalid RAPIDS version '${{ matrix.rapids }}'" | |
exit 1 | |
;; | |
esac | |
echo "RAPIDS_VER=${rapids_ver}" >> $GITHUB_ENV | |
echo "UCX_PY_VER=${ucx_py_ver}" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
if: ${{ env.push == 'true' }} | |
with: | |
username: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }} | |
password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }} | |
- name: Generate tag | |
id: tag | |
env: | |
cuda: ${{ matrix.cuda }} | |
python: ${{ matrix.python }} | |
linux: ${{ matrix.linux }} | |
rapids: ${{ env.RAPIDS_VER }} | |
image: ${{ matrix.image.tag }} | |
run: | | |
case ${image} in | |
"rapidsai/dask_image") # doesn't depend on RAPIDS / ucx-py for gpuCI | |
tag="${image}:cuda${cuda}-devel-${linux}-py${python}" | |
;; | |
*) | |
tag="${image}:${rapids}-cuda${cuda}-devel-${linux}-py${python}" | |
;; | |
esac | |
echo "tag=${tag}" >> $GITHUB_OUTPUT | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ${{ matrix.image.context }} | |
push: ${{ env.push == 'true' }} | |
platforms: ${{ matrix.platform }} | |
tags: ${{ steps.tag.outputs.tag }} | |
build-args: | | |
RAPIDS_VER=${{ env.RAPIDS_VER }} | |
UCX_PY_VER=${{ env.UCX_PY_VER }} | |
CUDA_VER=${{ matrix.cuda }} | |
LINUX_VER=${{ matrix.linux }} | |
PYTHON_VER=${{ matrix.python }} | |
- name: Report | |
run: echo "Built image '${{ steps.tag.outputs.tag }}'" |