From 69d742945995e7dcd19b4ff12aa8af5c9a7b803f Mon Sep 17 00:00:00 2001 From: viniciusdc Date: Wed, 20 May 2026 15:33:52 -0300 Subject: [PATCH] ci(build-images): skip GPU and arm64 builds on PRs PR-time CI was rebuilding all five image targets (jupyterlab-base, jupyterlab, jupyterlab-gpu-base, jupyterlab-gpu, jupyterhub) multi-arch on every change to images/**, even though most PRs touch a single pixi.toml and the same Dockerfile paths get exercised by the non-GPU amd64 build. GPU image builds (cuda base pull + gpu builder) and arm64 runners are the bulk of the runtime, so the cost was paid every PR to validate paths that the amd64 build already proves resolve. Gate jupyterlab-gpu-base and jupyterlab-gpu jobs on a job-level `if: github.event_name != 'pull_request'`. Pass `build_arm64: ${{ github.event_name != 'pull_request' }}` to the three non-GPU callers so PRs build amd64 only. Main and tag pushes keep the full multi-arch matrix; the merge job handles a single amd64 digest cleanly (single-arch manifest list). Refs #86 for the broader CI-scope audit. --- .github/workflows/build-images.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 9cd5700..2ebc672 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -28,12 +28,23 @@ concurrency: cancel-in-progress: true jobs: + # PR-time CI filtering: + # - GPU images (jupyterlab-gpu-base, jupyterlab-gpu) are skipped + # entirely on PRs — the same Dockerfile/pixi paths are exercised + # by the non-GPU variants, so PR cost should not pay for cuda + # base-image pulls and gpu builder runners. + # - linux/arm64 is skipped on PRs — amd64 build proves the pixi + # resolution; arm64 catches per-arch wheel gaps but rarely + # fails in isolation. Main builds full multi-arch. + # See issue #86 (section 3) for the audit that drove this. + jupyterlab-base: name: "jupyterlab-base" uses: ./.github/workflows/build-image.yaml with: image: nebari-data-science-pack-jupyterlab-base target: jupyterlab-base + build_arm64: ${{ github.event_name != 'pull_request' }} secrets: QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} @@ -43,11 +54,13 @@ jobs: with: image: nebari-data-science-pack-jupyterlab target: jupyterlab + build_arm64: ${{ github.event_name != 'pull_request' }} secrets: QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} jupyterlab-gpu-base: name: "jupyterlab-gpu-base" + if: github.event_name != 'pull_request' uses: ./.github/workflows/build-image.yaml with: image: nebari-data-science-pack-jupyterlab-gpu-base @@ -60,6 +73,7 @@ jobs: jupyterlab-gpu: name: "jupyterlab-gpu" + if: github.event_name != 'pull_request' uses: ./.github/workflows/build-image.yaml with: image: nebari-data-science-pack-jupyterlab-gpu @@ -76,5 +90,6 @@ jobs: with: image: nebari-data-science-pack-jupyterhub target: jupyterhub + build_arm64: ${{ github.event_name != 'pull_request' }} secrets: QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}