You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable Docker layer caching in the deploy build - #2893
The deploy build passes --cache-from=${DOCKER_IMAGE}:latest, but under BuildKit that only works if the image was pushed with inline cache metadata, which it never was. As a result, every deploy rebuilds every layer from scratch. In the 2026-11-18 deploy log, none of the 41 steps were CACHED, and every layer except the base image's was pushed again.
Changes
.github/workflows/actions-gcp.yaml: add --build-arg BUILDKIT_INLINE_CACHE=1 so :latest carries cache metadata that the next build can use.
docker/Dockerfile: in builder-js, copy package.json and yarn.lock before running yarn install, then copy the rest of the source. Code changes then no longer force a full yarn install.
.dockerignore: exclude node_modules/ so a local node_modules isn't copied over the one installed in the image (and isn't sent in the build context).
Expected effect
For code-only changes, the release stage reuses its heavy layers: the apt/Chromium/fonts layer (~59s, ~1 GB), gem and uv installs, and probably the /venv copy. Only the code and JS build layers are rebuilt and pushed, and GKE nodes pull only those small layers.
Inline cache only covers the final stage, so builder-py and builder-js still run on every CI build. The yarn install reorder helps local builds now, and will help CI if we later move to a full BuildKit cache backend (type=registry or type=gha, mode=max).
Notes
The first deploy after merging still builds from scratch, because the current :latest has no cache metadata. CACHED steps should appear from the second deploy on.
Summary by CodeRabbit
Chores
Updated the container build process to handle dependencies and source files more efficiently.
Improved Docker build caching and reduced unnecessary files included in build contexts.
No actionable comments were generated in the recent review.
Walkthrough
The Docker build context now excludes node_modules/. The JavaScript builder copies dependency manifests before installing dependencies and copies the remaining source afterward. The workflow passes BUILDKIT_INLINE_CACHE=1 to the Docker build.
Changes: Docker build setup
Layer / File(s)
Summary
Docker build context and dependency setup .dockerignore, docker/Dockerfile, .github/workflows/actions-gcp.yaml
The build context excludes node_modules/. The JavaScript builder installs dependencies after copying package.json and yarn.lock, then copies the remaining source. The workflow adds the BUILDKIT_INLINE_CACHE=1 build argument.
This change enables Docker layer caching in the deploy build and should speed up later deploys. It does not alter runtime behavior. The first deploy after merging is expected to build from scratch, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "Enable Docker layer caching in the deploy build" matches the main change. The PR adds BUILDKIT_INLINE_CACHE=1 so the deploy image carries cache metadata. It also reorders the Dockerfile cop…
Description check
The description follows the repository template in substance. It explains the problem and the fix, and it lists the three changed files under Changes. It also covers expected effects and notes for rev…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Enable Docker layer caching in the deploy build" matches the main change. The PR adds BUILDKIT_INLINE_CACHE=1 so the deploy image carries cache metadata. It also reorders the Dockerfile copy steps and excludes node_modules from the build context, which support the same goal.
Full details: Description check
Explanation
The description follows the repository template in substance. It explains the problem and the fix, and it lists the three changed files under Changes. It also covers expected effects and notes for review. The template's Issue number line, Figma link, component link, Screenshots section, and Self-review Checklist are absent. The Risks section is not labeled, but the Notes and Expected effect sections cover similar ground. The required sections are mostly present, so the check passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 91b64d93-dcc3-4132-b6d2-a8818bf898f9
Commits
Reviewing files that changed from the base of the PR and between 17e6e36 and 3cd6982.
Files selected for processing: 3
.dockerignore
.github/workflows/actions-gcp.yaml
docker/Dockerfile
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
The deploy build passes
--cache-from=${DOCKER_IMAGE}:latest, but under BuildKit that only works if the image was pushed with inline cache metadata, which it never was. As a result, every deploy rebuilds every layer from scratch. In the 2026-11-18 deploy log, none of the 41 steps wereCACHED, and every layer except the base image's was pushed again.Changes
.github/workflows/actions-gcp.yaml: add--build-arg BUILDKIT_INLINE_CACHE=1so:latestcarries cache metadata that the next build can use.docker/Dockerfile: inbuilder-js, copypackage.jsonandyarn.lockbefore runningyarn install, then copy the rest of the source. Code changes then no longer force a fullyarn install..dockerignore: excludenode_modules/so a localnode_modulesisn't copied over the one installed in the image (and isn't sent in the build context).Expected effect
For code-only changes, the
releasestage reuses its heavy layers: the apt/Chromium/fonts layer (~59s, ~1 GB), gem and uv installs, and probably the/venvcopy. Only the code and JS build layers are rebuilt and pushed, and GKE nodes pull only those small layers.Inline cache only covers the final stage, so
builder-pyandbuilder-jsstill run on every CI build. Theyarn installreorder helps local builds now, and will help CI if we later move to a full BuildKit cache backend (type=registryortype=gha,mode=max).Notes
:latesthas no cache metadata.CACHEDsteps should appear from the second deploy on.Summary by CodeRabbit