Skip to content

Enable Docker layer caching in the deploy build - #2893

Merged
sdarwin merged 1 commit into
boostorg:developfrom
sdarwin:feature/build3
Nov 24, 2026
Merged

sdarwin merged 1 commit into
boostorg:developfrom
sdarwin:feature/build3

Conversation

@sdarwin

@sdarwin sdarwin commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

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.

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

Change: Other

Suggested reviewers: kennethreitz

Merge Risk: Minimal · up to 3cd69

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 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: 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • 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.

@sdarwin
sdarwin merged commit 73ac12f into boostorg:develop Nov 24, 2026
3 checks passed
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