Benchmark Discourse image builds with BoringCache - #1
Closed
gauravtiwari wants to merge 14 commits into
Closed
Conversation
allow for push and cache to be done by including bake config do local caching, for github actions cache. introduce datestamp for cache key use datestamps for cache invalidation
Author
|
Superseded by #2, which keeps the upstream workflow shape and contains only the BoringCache product integration and required Dockerfile cache wiring. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This fork runs the Discourse image factory itself as a controlled BoringCache product benchmark, following the same repository-native pattern as the Mastodon and base-images demos.
Comparison lanes on native AMD64 and ARM64 runners:
The seed uses an older exact Discourse commit and the rebuild uses its immediate child, with dependency manifests unchanged. Every lane builds the same eight upstream Bake targets and Dockerfiles. The no-layer lane passes Bake's native
--no-cacheflag for every target while retaining BoringCache's ccache and mountcache adapters; all cache cohorts are isolated by run, lane, and architecture.The optimized Dockerfiles mount the complete writable Bundler installation trees, materialize them into the image, run normal
bundle install, and finish withbundle check. pnpm's store is explicitly fixed to/var/www/discourse/.pnpm-store: inside BuildKit, pnpm otherwise relocates away from its default home store when the home mount and project are on different filesystems. The logs record resolved paths and before/after sizes.This branch also:
boringcache/onev1.19.1 and BoringCache CLI v1.19.1Definitive four-lane result
Run: https://github.com/boringcache/discourse_docker/actions/runs/31712096598
Warm rolling image-build results:
Against GitHub Actions, BoringCache layer caching alone was 34.2% faster on AMD64 and 32.8% faster on ARM64. The complete BoringCache lane was 48.2% faster on AMD64 and 42.5% faster on ARM64. Adding ccache and mountcache to BoringCache layers saved a further 3m45s on AMD64 and 2m18s on ARM64.
The no-layer control is intentionally different: it forces all Dockerfile steps to execute. Tool and mount caches still reduced its seed-to-rebuild time by 9m15s on AMD64 and 6m36s on ARM64, but it remained slower than either layer-cache lane. For Discourse's eight-image factory, Docker layer reuse is essential; ccache and dependency mounts complement it rather than replace it.
Cache evidence from the warm run:
bundle installreconciliation./var/www/discourse/.pnpm-storeand reused all 1,670 packages with zero downloads.The full workflow took 2h49m because the no-layer control was the critical path twice: roughly 50–55 minutes of forced uncached image building plus roughly 30 minutes of specs in both seed and rebuild. The benchmark values above measure image building only.
The earlier three-lane validation also completed successfully: https://github.com/boringcache/discourse_docker/actions/runs/31700383222