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

Merged
GR
8d ago
+7-10

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 #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 (#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.