Skip to content

mp53348_cache_bundler_and_npm - #22

Open
derfred wants to merge 2 commits into
masterfrom
mp53348_cache_bundler_and_npm
Open

mp53348_cache_bundler_and_npm#22
derfred wants to merge 2 commits into
masterfrom
mp53348_cache_bundler_and_npm

Conversation

@derfred

@derfred derfred commented Aug 14, 2026

Copy link
Copy Markdown
Member

https://miceportal.atlassian.net/browse/MP-53348

This introduces (max) caching to our image building. This is the type of caching that would occur if we always ran the building on the same machine. On the github runners we always start with an empty build cache, so it has to be populated for the caching do any work.

Three consequences:

  1. the build time for images on github goes from 10 minutes for katalysator down to 5 minutes.
  2. we push more images to makandra. in particular the build containers that are currently discarded are pushed to the registry
  3. the apt dist-upgrade is also cached. that means we have less control over it. we could mitigate this by adding an build variable that we can manually adjust if we want an update of the packages.

NOTE: before merging the tag for the action in the workflow files has to be updated and then the version of the repo here bumped

derfred and others added 2 commits August 14, 2026 15:51
Builds previously ran implicitly inside `docker compose up`, using the
local image store. On a fresh runner that store is empty, so every build
re-ran bundle install and yarn install from scratch.

Split the build into an explicit step that can use a registry-backed
BuildKit cache, controlled by the new cache-ref input. When cache-ref is
empty the action builds exactly as before, so this is opt-in per
application.

mode=max is required here: the bundler and yarn layers live in the
discarded `build` stage of the multi-stage Dockerfile, so the default
mode=min would export nothing useful.

The docker-container driver is needed for cache export, which builds
outside the local image store, so the build --load's the result back in
for the subsequent `docker compose up`.

compose_run reads the cache but does not export it, so test runs cannot
overwrite the cache produced by the push workflow.

Also declares makandra_registry_user/pass in compose_run's secrets block.
They were referenced by its docker login step but never declared, so that
login was running with empty credentials.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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