Skip to content

ci(gitlab): no registry layer cache for CUDA-based EIC images - #481

Open
wdconinc wants to merge 1 commit into
masterfrom
ccr-616d5ca1-vga0gi-cuda-no-layer-cache
Open

wdconinc wants to merge 1 commit into
masterfrom
ccr-616d5ca1-vga0gi-cuda-no-layer-cache

Conversation

@wdconinc

@wdconinc wdconinc commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Problem

On eicweb, the CUDA-based EIC images (eic_cuda, eic_tf, eic_dev_cuda) spend most of their wall time on the registry layer cache:

Job Spack work preparing build cache for export
eic_cuda 8667616, fully cached 0 s 5197 s, then failed
eic_dev_cuda 8667003, success 761 s 2580 s

The export is mode=max over roughly 10 GB builder stages. Most recent CUDA job failures on eicweb are layer-cache errors:

  • unknown blob sha256:… in history appears at the end of the export after 1.5–6 h. It is deterministic, so retry: 2 repeats the whole build.
  • no active session for …: context deadline exceeded appears while computing cache keys for layers imported via --cache-from.

Since #460, the Spack buildcache check makes the builder stages cheap to redo, so the layer cache buys little for these images.

Change

  • scripts/build-eic.sh: new --no-layer-cache flag and LAYER_CACHE=false env var. They omit every registry --cache-from and --cache-to. BuildKit's local cache in the persistent builder instance is still used, so the default and nightly builds in one job still share stages.
  • .gitlab-ci.yml: the eic job exports LAYER_CACHE=false when BUILDER_IMAGE matches cuda_*. The variable is exported in the script rather than added to the matrix, so job names stay the same.
  • docs/build-pipeline.md: documents the exception.

Unchanged:

  • Non-CUDA eicweb builds.
  • All GitHub Actions builds.
  • The base job, including cuda_devel and cuda_runtime.

Validation

I dry-ran scripts/build-eic.sh with a stubbed docker in GitLab mode:

  • eic_ci: same four --cache-from and one --cache-to flags as before.
  • eic_cuda and eic_tf: no cache flags.
  • Local mode: --no-layer-cache removes the ghcr.io --cache-from flags.

The change has not run on eicweb yet. Expect the CUDA jobs to lose the long export step.

Follow-up

The existing buildcache:eic_cuda-*, eic_tf-* and eic_dev_cuda-* tags in the eicweb registry are no longer read or written. They can be deleted by hand.


Generated by Claude Code

On eicweb, eic_cuda, eic_tf and eic_dev_cuda spent 40-90 min per build
type in "preparing build cache for export" (mode=max, ~10 GB builder
stages), and most of their recent failures were registry layer cache
errors: "unknown blob ... in history" at export, and "no active session"
when computing cache keys for layers imported via --cache-from.  With the
Spack buildcache check (#460) the builder stages are cheap to redo.

- scripts/build-eic.sh: add --no-layer-cache / LAYER_CACHE=false, which
  omits all --cache-from and --cache-to registry options.  BuildKit's local
  cache in the builder instance is still used, so default and nightly
  builds in one job still share stages.
- .gitlab-ci.yml: set LAYER_CACHE=false in the eic job when BUILDER_IMAGE
  is a cuda_* image.  GitHub Actions and non-CUDA images are unchanged.
- docs/build-pipeline.md: document the exception.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019qEz4vCZUkz3xKJYKfcaaf
Copilot AI balanced review requested due to automatic review settings November 1, 2026 16:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review surfaced no objective defects—the LAYER_CACHE toggle is correctly plumbed and scoped to the three CUDA images, and the docs and help text match the implementation.

No open issues 🎉

What changed in this PR

This PR disables the registry Docker layer cache for the CUDA-based EIC images (eic_cuda, eic_tf, eic_dev_cuda) on GitLab CI (eicweb). For these ~10 GB builder stages, exporting the mode=max layer cache dominated wall time (40–90 min per build type) and was the source of most recent CUDA job failures (unknown blob … in history, no active session). Since #460's Spack buildcache check makes the builder stages cheap to redo, the registry layer cache now buys little for these images. BuildKit's local cache in the persistent builder and the Spack buildcache are retained.

Changes:

  • Add a --no-layer-cache flag / LAYER_CACHE env var to scripts/build-eic.sh that skips every registry --cache-from/--cache-to.
  • In .gitlab-ci.yml, the eic job exports LAYER_CACHE=false when BUILDER_IMAGE matches cuda_*, keeping job names unchanged.
  • Document the exception in docs/build-pipeline.md.
File Description
scripts/​build-eic.sh Adds --no-layer-cache flag and LAYER_CACHE env default; wraps all registry --cache-from/--cache-to additions in a LAYER_CACHE != "false" guard, plus help text.
.gitlab-ci.yml In the eic job script, exports LAYER_CACHE=false for cuda_* builder images so CUDA-based images skip the registry layer cache.
docs/​build-pipeline.md Documents that CUDA-based EIC images are built without a registry layer cache on eicweb.

No objective defects were found: the LAYER_CACHE toggle is correctly plumbed and scoped, the cuda_* glob targets exactly the three intended images, GitLab's single-shell script semantics make the export reach build-eic.sh, and the docs and help text match the implementation.

Review effort: Balanced

This branch was successfully deployed

No deployments
github-pages — 382647ae Deployed Nov 2, 2026 by wdconinc via deploy-artifacts-page #4507
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants