ci(server): give the docker build a registry layer cache - #250
Conversation
`cache-from`/`cache-to` were unset, so every CI build refetched the 231 MB lance extension and re-ran both apt layers from scratch. None of the layer ordering in the Dockerfile bought anything on CI. Registry cache rather than `type=gha`: the image is ~1.9 GB, and `mode=max` on it would churn through the 10 GB Actions cache quota. The cache tag follows `SERVER_DOCKER_IMAGE`, so dev and release caches never mix — and neither do their platform sets. `image-manifest=true,oci-mediatypes=true` is what Docker Hub will accept for the cache manifest. PR previews read the cache but do not write it: they push from divergent trees and would only evict trunk's entries. The `latest` push rebuilds the same context, so it reads the cache and does not re-export it.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe server Docker workflow now centralizes image naming and configures registry-backed Docker layer caching. Non-PR builds write cache data, while the latest image push only reads the cache. ChangesServer Docker build workflow
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change enables registry-backed Docker layer caching for CI builds without changing the resulting image environment or release behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description clearly explains the motivation, cache design, PR behavior, and expected effect. It does not follow the repository template because it omits Related Tickets & Documents, PR type, Steps to QA, test status, documentation status, and the checklist. Resolution Add the missing template sections. Specify related tickets, select the applicable PR type, provide QA steps, state whether tests and documentation were updated with reasons where applicable, and complete the CHANGELOG checklist item. Keep the existing technical explanation in the description if needed; do not leave required sections absent or incomplete. Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
cache-from/cache-towere unset on bothdocker/build-push-actionsteps, soBuildKit started from nothing on every CI run. Concretely, each build refetched the
231 MB lance extension and re-ran both
apt-getlayers — the layer ordering work inextralit-server/docker/server/Dockerfilebought nothing on CI, only locally.Only the wheel differs between two builds of the same tree, and it enters last.
Everything above it is cacheable.
Why registry cache, not
type=ghaThe image is ~1.9 GB.
type=gha,mode=maxon it would churn through the 10 GBGitHub Actions cache quota and start evicting other workflows' entries. Registry
cache has no such ceiling and the credentials are already in the job.
Shape
SERVER_DOCKER_IMAGE, soextralit/(release, multi-arch)and
extralitdev/(dev, amd64) caches never mix.image-manifest=true,oci-mediatypes=true— Docker Hub rejects the default cachemanifest-list media type.
exporting would only evict trunk's entries without ever being a hit.
latestpush rebuilds the same context, so it getscache-fromonly.Effect
First run after merge is a cache miss and populates
:buildcache. Every run afterthat skips the lance fetch and both apt layers.
Summary by CodeRabbit