Skip to content

chore(project): cache docker image layers across CI jobs with buildx gha cache - #16334

Closed
jaredlockhart wants to merge 2 commits into
mainfrom
16332
Closed

chore(project): cache docker image layers across CI jobs with buildx gha cache#16334
jaredlockhart wants to merge 2 commits into
mainfrom
16332

Conversation

@jaredlockhart

Copy link
Copy Markdown
Collaborator

Because

  • setup-cached-build ran buildx with driver: docker and no cache-from/cache-to, so every CI job rebuilt megazords, schemas, cirrus and the experimenter images from scratch, duplicating the poetry/npm install and application-services fetch layers across the whole PR run.

This commit

  • switches the builder to the docker-container driver and adds type=gha cache to every build the action drives, scoped per image.
  • stands up a throwaway localhost:5000 registry and pushes megazords there so the container-driver builds can resolve the experimenter:megazords build context (previously satisfied from a locally loaded image under the daemon driver).
  • parametrizes the megazords tag as MEGAZORD_IMAGE so local builds keep loading into the daemon while CI targets the registry.

This PR touches root/.github paths, so check-changed-paths runs the full CI suite here: the cache warms on this run and the payoff shows on subsequent runs of the same branch/base.

Fixes #16332

…gha cache

Because

* setup-cached-build ran buildx with driver: docker and no cache-from/cache-to,
  so every CI job rebuilt megazords, schemas, cirrus and the experimenter images
  from scratch, duplicating the poetry/npm install and application-services fetch
  layers across the whole PR run.

This commit

* switches the builder to the docker-container driver and adds type=gha
  cache-from/cache-to with a per-image scope to every build the action drives.
* stands up a throwaway localhost:5000 registry and pushes megazords there, so
  the container-driver builds resolve the experimenter:megazords build context
  (which the daemon driver used to satisfy from a locally loaded image).
* parametrizes the megazords tag as MEGAZORD_IMAGE so local builds keep loading
  into the daemon while CI targets the registry.

Fixes #16332
@jaredlockhart

Copy link
Copy Markdown
Collaborator Author

We tried this before but I wanted to try again and it still seems as if we lose more time on rehydrating the cache than it saves on build steps, which is annoying, so closing this.

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.

ci: cache Docker image layers across jobs with buildx GHA cache

1 participant