Skip to content

Commit

Permalink
split platform as separate matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech authored May 8, 2024
1 parent 485f1fe commit 7ebaec7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build-push-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,18 @@ jobs:
- jupyterhub
- dask-worker
- workflow-controller
platform:
processor:
- gpu
- cpu
platform:
- linux/amd64
- linux/arm64
exclude:
# excludes JupyterHub/GPU, Workflow Controller/GPU
- dockerfile: jupyterhub
platform: gpu
processor: gpu
- dockerfile: workflow-controller
platform: gpu
processor: gpu

steps:
- name: "Checkout Repository 🛎️"
Expand All @@ -82,9 +85,9 @@ jobs:
password: ${{ secrets.QUAY_TOKEN }}

- name: "Set BASE_IMAGE and Image Suffix 📷"
if: ${{ matrix.platform == 'gpu' }}
if: ${{ matrix.processor == 'gpu' }}
run: |
echo "GPU Platform Matrix"
echo "GPU Processor Matrix"
echo "BASE_IMAGE=$GPU_BASE_IMAGE" >> $GITHUB_ENV
echo "IMAGE_SUFFIX=-$GPU_IMAGE_SUFFIX" >> $GITHUB_ENV
Expand Down Expand Up @@ -119,4 +122,4 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: BASE_IMAGE=${{ env.BASE_IMAGE }}
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.platform }}
12 changes: 7 additions & 5 deletions .github/workflows/test-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ jobs:
- jupyterlab
- jupyterhub
- dask-worker
platform:
processor:
- gpu
- cpu
platform:
-
exclude:
# excludes JupyterHub/GPU
- dockerfile: jupyterhub
platform: gpu
processor: gpu
steps:
- name: Checkout Repository 🛎
uses: actions/checkout@v3
Expand All @@ -55,14 +57,14 @@ jobs:
error_level: 0

- name: "Set BASE_IMAGE and Image Suffix 📷"
if: ${{ matrix.platform == 'gpu' }}
if: ${{ matrix.processor == 'gpu' }}
run: |
echo "GPU Platform Matrix"
echo "GPU Processor Matrix"
echo "BASE_IMAGE=$GPU_BASE_IMAGE" >> $GITHUB_ENV
echo "IMAGE_SUFFIX=-$GPU_IMAGE_SUFFIX" >> $GITHUB_ENV
- name: Build Image 🛠
run: |
docker build -t ${DOCKER_ORG}/${{ matrix.dockerfile }}${{ env.IMAGE_SUFFIX }}:${{ env.GITHUB_SHA }} \
--build-arg BASE_IMAGE=$BASE_IMAGE \
-f Dockerfile.${{ matrix.dockerfile }} .
-f Dockerfile.${{ matrix.dockerfile }} --platform ${{ matrix.platform }} .

0 comments on commit 7ebaec7

Please sign in to comment.