Skip to content

ci: embed inline build cache in test images - #3535

Open
TheTisiboth wants to merge 1 commit into
masterfrom
ci/docker-inline-cache
Open

TheTisiboth wants to merge 1 commit into
masterfrom
ci/docker-inline-cache

Conversation

@TheTisiboth

@TheTisiboth TheTisiboth commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #2721

Topic and Scope

CI rebuilds the pulled test images from scratch: BuildKit ignores cache_from images without inline cache metadata. This adds BUILDKIT_INLINE_CACHE: 1 to the dut, mysql and postgres builds, so the nightly images become reusable cache.

Local test (nightly push → CI pull + build):

Scenario Build time Cached steps
Before 102 s 0 / 22
After 3 s 22 / 22

Concerns/issues

Gain shows only after the nightly image workflow runs on master (can be triggered manually).

Formal requirements

  • I did check that the app can still be opened and does not throw any browser logs
  • I created tests for newly added PHP code (check this if no PHP changes were made)
  • I updated the OpenAPI specs and added an entry to the API changelog (check if API was not modified)
  • I notified the matrix channel if I introduced an API change

AI disclosure

I used AI for code generation

BuildKit ignores cache_from images without inline cache metadata, so CI rebuilt the pulled test images from scratch on every run.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Léo Jan <leo.jan@doctolib.com>
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   12 files    600 suites   2m 0s ⏱️
  605 tests   597 ✅  8 💤 0 ❌
2 420 runs  2 387 ✅ 33 💤 0 ❌

Results for commit 0aa5d64.

@TheTisiboth
TheTisiboth marked this pull request as ready for review October 29, 2026 18:35
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d16c2b86-cc03-4774-a6be-00f0c04fd9e8
Commits

Reviewing files that changed from the base of the PR and between 56213cf and 0aa5d64.

Files selected for processing: 1
  • .github/actions/run-tests/docker-compose.yml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

The MySQL, PostgreSQL, and DUT build configurations now pass BUILDKIT_INLINE_CACHE with a value of 1. The DUT configuration replaces a commented-out args entry with an active build argument.

Priority: Low

Merge Risk: Minimal · up to 0aa5d

No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title "ci: embed inline build cache in test images" matches the main change. The diff adds BUILDKIT_INLINE_CACHE=1 to the dut, mysql and postgres builds so pulled test images act as BuildKit cache…
Description check Passed The description covers the Topic and Scope section with the problem, the fix, and a before/after build-time table. It fills in the Concerns/issues section and notes that the gain appears only after th…
Linked Issues check Passed Issue #2721 requests Docker build-time optimization through caches. The pull request adds BUILDKIT_INLINE_CACHE: 1 to the mysql, postgres, and dut build configurations. Each configuration alre…
Out of Scope Changes check Passed The diff changes only .github/actions/run-tests/docker-compose.yml. All six added lines configure inline cache metadata for the three Docker builds named in the pull request objective. No unrelated …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title "ci: embed inline build cache in test images" matches the main change. The diff adds BUILDKIT_INLINE_CACHE=1 to the dut, mysql and postgres builds so pulled test images act as BuildKit cache sources. The title is short, specific, and follows the conventional commit style.

Full details: Description check

Explanation

The description covers the Topic and Scope section with the problem, the fix, and a before/after build-time table. It fills in the Concerns/issues section and notes that the gain appears only after the nightly image workflow runs on master. All four formal requirement boxes are checked, and an AI disclosure is included. The template's SPDX header is not repeated, which is expected for a PR body.

Full details: Linked Issues check

Explanation

Issue #2721 requests Docker build-time optimization through caches. The pull request adds BUILDKIT_INLINE_CACHE: 1 to the mysql, postgres, and dut build configurations. Each configuration already uses cache_from, so the change directly enables reusable inline cache metadata for the requested builds.

Full details: Out of Scope Changes check

Explanation

The diff changes only .github/actions/run-tests/docker-compose.yml. All six added lines configure inline cache metadata for the three Docker builds named in the pull request objective. No unrelated production or workflow changes are present.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • 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

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

@TheTisiboth
TheTisiboth enabled auto-merge (squash) October 29, 2026 18:40
@christianlupus

Copy link
Copy Markdown
Collaborator

Right now, it does not look like the changes did speed up the build process or am I wrong?

grafik

Building takes 2-3 min (typical values), while the real tesing is done in less than a minute. Comparing with other PRs, this seems identical more or less. Or do we have bad luck and stale cache images?

@TheTisiboth

TheTisiboth commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

You are right: this is because we would need to first merge this pr, and then run the nightly workflow manually, and then we should see the improvement on the following prs 🙏
Or maybe you can run the nightly workflow on this pr? so we could rerun the whole ci to see the improvement here , if doable (but I doubt it)
this is what I explains in the concern section of the PR description: we don't see yet the gain
the table showing the gain is from local test with cache hit, which can't be tested here in the CI env

@TheTisiboth

Copy link
Copy Markdown
Collaborator Author

Before cache fix:
Slow run
for ex: sqlite job, section Pull and build the test images used to last 2m28
Fast run
For sqlite job: the same step lasted 44 s

This branch was successfully deployed

1 active deployment
docker-pushing — 0aa5d648 Deployed Oct 29, 2026 by christianlupus via Build and push the latest test images (8.4) #2106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize Docker build times

3 participants