Skip to content

ci(docker): stop exporting PR BuildKit layers to GHA cache to prevent sccache eviction - #1078

Merged
davide221 merged 1 commit into
mainfrom
ci/docker-drop-pr-gha-layer-cache
Nov 25, 2026
Merged

davide221 merged 1 commit into
mainfrom
ci/docker-drop-pr-gha-layer-cache

Conversation

@Graffioh

@Graffioh Graffioh commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Based on main (a70ab3ca2). Independent of #1068, #1070, #1074, #1076, and #1077 (touches only .github/workflows/docker.yml).

What

  • Cause (observed in Actions cache usage): After ci(docker): move BuildKit layer cache from GHA to GHCR registry #1060 moved main/release BuildKit layer caches to GHCR, docker.yml kept cache-to=type=gha,scope=docker-pr-{variant},mode=max for pull requests. A single PR build (perf(ci): bootstrap Ninja and ROCm lld on lucebox3, prune affine FA units, and cache build deps #1070, run 45215356002, job 137835232783) exported 4,259 MB (4.26 GB) of buildkit-blob entries (refs/pull/1070/merge) into the 10 GB repo-wide GitHub Actions cache, pushing total repo cache usage to 7.84 GB / 10 GB (alongside ~3.0 GB of sccache and 567 MB of docker-ccache). Two concurrent Docker PRs immediately exceed 10 GB and trigger LRU eviction of main's sccache entries (sending hosted PR builds back from ~5–8 min warm to 31–45 min cold / Windows timeout).
  • Fix (.github/workflows/docker.yml):
    • Remove type=gha,scope=docker-pr-{variant} cache-from and cache-to lines on pull requests.
    • Keep read-only cache-from=type=registry,ref=ghcr.io/luce-org/lucebox-hub:buildcache-{variant} for shared base layers and read-only docker-ccache restore from main.
    • main, release, and workflow_dispatch GHCR cache behavior is unchanged.

Baseline & measurement (provisional)

  • Baseline (actions/cache/usage on 2026-11-24T07:27Z):
    • Total repo cache: 7,839 MB / 10,240 MB (10,600 active entries)
    • buildkit-blob (refs/pull/1070/merge): 4,259 MB (23 entries — 54% of total repo cache from 1 PR)
    • docker.yml PR wait (50 runs, 22 successful): median 49m 26s, slowest 5% 68m 26s
  • After merge: confirm PR docker.yml runs write 0 B of buildkit-blob to GHA cache and ci.yml sccache stays warm without eviction across >= 5 comparable runs.

Coverage & checks

  • Every build target (cuda12, rocm) and verification step in docker.yml is unchanged.
  • Validated locally: yaml.safe_load on .github/workflows/docker.yml and .github/ci/check_commit_messages.py.

View guided diff

… sccache eviction

A single PR Docker build (PR #1070, run 45215356002) exported 4,259 MB
of buildkit-blob entries into the 10 GB repo-wide GitHub Actions cache
via cache-to=type=gha,scope=docker-pr-{variant},mode=max, pushing total
repo cache usage to 7.84 GB / 10 GB and risking LRU eviction of ci.yml's
sccache and uv caches.

Drop type=gha cache-from/cache-to on pull_request runs; PR builds still
import main's GHCR buildcache read-only for shared base layers and
restore main's docker-ccache read-only without consuming GHA cache quota.

@davide221 davide221 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.

Code review

No issues found. Checked for bugs and logic errors in the changed code.

Reviewed 1885727e · 0 candidate issues checked, kept at ≥70% confidence · add the code-review label to review again

@davide221
davide221 merged commit 30a5123 into main Nov 25, 2026
19 checks passed
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.

2 participants