ci(docker): switch to registry-backed BuildKit cache (GHCR)#140
Merged
ci(docker): switch to registry-backed BuildKit cache (GHCR)#140
Conversation
The previous `type=gha` cache was scoped per Git ref, so each release tag created a new cache scope and never reused a previous release's layers. Add to that GHA's 10 GB per-repo limit (which we already hit at ~10 GB before the v0.2.26 release), and the cache effectively never helped consecutive releases. Move to `type=registry` cache stored as separate `buildcache-<variant>` tags on the same GHCR package. Branch/tag-independent, no LRU eviction, unlimited size for our purposes. Standard pattern for multi-arch buildx + multi-registry publishes. Per-variant cache tag (`buildcache-slim`, `buildcache-full`) so the two variants don't evict each other's layers. `mode=max` exports all intermediate layers, not just the final ones — needed for the per-RUN-layer reuse strategy in the Dockerfile. Also cleaned up 23 orphaned GHA cache entries on the deleted g/docker-layer-cache-v2 branch (3.4 GB freed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #138 / #139. The previous
type=ghaBuildKit cache is scoped per Git ref, so each release tag (v0.2.24,v0.2.25, …) creates a fresh cache scope and gets no reuse from earlier releases. Combined with GHA's 10 GB per-repo cache limit (which we already hit at ~10 GB before the v0.2.26 release), the cache effectively never helped consecutive releases — observed empirically: the v0.2.26 release re-installed sentence-transformers from scratch despite earlier runs having exported cache.Summary
type=registrycache stored asbuildcache-<variant>tags on the same GHCR package — branch/tag-independent, no LRU eviction, no size cap. Standard pattern for buildx multi-arch + multi-registry publishes.buildcache-slim,buildcache-full) so the two image variants don't evict each other's cache layers.mode=maxcontinues to export intermediate layers (needed so the heavy stage 1RUN uv pip install sentence-transformerslayer is cached and reused).Operational impact
cocoindex-io/cocoindex-codeGHCR package —:buildcache-slim,:buildcache-full. They aren't intended fordocker pull; safe to mark as private or simply ignore in package listing.g/docker-layer-cache-v2branch (~3.4 GB freed). Remainingv0.2.26-scoped GHA caches will age out naturally (7-day TTL, or when GHA evicts them under pressure).Test plan
workflow_dispatchwithtest_docker=trueafter this lands will populate the:buildcache-*tags.Build & pushstep should be dramatically shorter than the v0.2.26 cold run (~10 min → ~2 min hopefully, since the heavy ST install layer reuses).🤖 Generated with Claude Code