Skip to content

ci(server): give the docker build a registry layer cache - #250

Open
JonnyTran wants to merge 1 commit into
mainfrom
ci/docker-registry-cache
Open

ci(server): give the docker build a registry layer cache#250
JonnyTran wants to merge 1 commit into
mainfrom
ci/docker-registry-cache

Conversation

@JonnyTran

@JonnyTran JonnyTran commented Aug 29, 2026

Copy link
Copy Markdown
Member

Why

cache-from / cache-to were unset on both docker/build-push-action steps, so
BuildKit started from nothing on every CI run. Concretely, each build refetched the
231 MB lance extension and re-ran both apt-get layers — the layer ordering work in
extralit-server/docker/server/Dockerfile bought 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=gha

The image is ~1.9 GB. type=gha,mode=max on it would churn through the 10 GB
GitHub Actions cache quota and start evicting other workflows' entries. Registry
cache has no such ceiling and the credentials are already in the job.

Shape

  • The cache tag follows SERVER_DOCKER_IMAGE, so extralit/ (release, multi-arch)
    and extralitdev/ (dev, amd64) caches never mix.
  • image-manifest=true,oci-mediatypes=true — Docker Hub rejects the default cache
    manifest-list media type.
  • PR previews read the cache but never write it. They build from divergent trees;
    exporting would only evict trunk's entries without ever being a hit.
  • The latest push rebuilds the same context, so it gets cache-from only.

Effect

First run after merge is a cache miss and populates :buildcache. Every run after
that skips the lance fetch and both apt layers.

Summary by CodeRabbit

  • Chores
    • Improved server container build efficiency through Docker layer caching.
    • Standardized server image tagging across release and development builds.
    • Optimized cache usage for pull requests and other builds, helping reduce build times and resource consumption.

`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.
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
extralit-frontend Ignored Ignored Preview Aug 29, 2026 12:35am

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ca4c222-d56d-434b-99e9-bba875aa8b54

📥 Commits

Reviewing files that changed from the base of the PR and between 270efb1 and 89a7012.

📒 Files selected for processing (1)
  • .github/workflows/extralit-server.build-docker-images.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Server Docker build workflow

Layer / File(s) Summary
Image naming and Docker cache wiring
.github/workflows/extralit-server.build-docker-images.yml
The workflow uses SERVER_IMAGE for release and development images. It configures CACHE_FROM for all builds and CACHE_TO for non-PR builds. The server build writes the cache, and the latest push reads it.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 89a70

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning 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… 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 t…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the CI server Docker build change and the addition of a registry layer cache.
Docstring Coverage ✅ Passed 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…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

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 Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/docker-registry-cache

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant