Skip to content

ci: fix Docker layer caching gaps#208

Merged
cooper667 merged 4 commits into
mainfrom
ci-improve-caching
Jul 14, 2026
Merged

ci: fix Docker layer caching gaps#208
cooper667 merged 4 commits into
mainfrom
ci-improve-caching

Conversation

@cooper667

@cooper667 cooper667 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Cache and parallelise CI building so it's a little quicker

- deploy/Dockerfile.prod: cache the React yarn install independently of
  submodule changes (copy only package.json/yarn.lock first). The
  pipenv sync layer can't be decoupled the same way - several
  submodules are installed as editable path packages straight from
  the Pipfile, so pipenv sync requires them checked out first.
- Add a Buildx + GHA cache-from/cache-to step to pre-build the test
  job's dev ckan image (ckan/Dockerfile), which previously had no
  cross-run layer caching at all and rebuilt apt/node/yarn from
  scratch on every run.
@cooper667
cooper667 force-pushed the ci-improve-caching branch from e42b6ef to 7063252 Compare July 14, 2026 05:32
Split the build job into build (no push, runs concurrently with test)
and push (needs [test, build], only pushes once tests pass). Push
reuses the build job's GHA cache, so it's a cache hit rather than a
rebuild - the only new cost is uploading + pushing the already-built
image. deploy now depends on push instead of build.
…her, giftless)

The previous fix only pre-built and cached the ckan service image.
docker-compose.yml actually builds six images, and giftless/datapusher
do real pip wheel builds from scratch on every run (confirmed in
run 29309402751: ~65s and ~44s respectively, dominating the
'Build images and start the dev stack' step). Pre-build all of them
with the same Buildx + GHA cache pattern, distinct scope per service.
Uses GitHub Actions' new parallel: step block (June 2026) to run the
independent per-service Buildx pre-build steps concurrently against
the same builder instead of one after another.
@cooper667
cooper667 enabled auto-merge (squash) July 14, 2026 07:19
@cooper667
cooper667 requested a review from ChasNelson1990 July 14, 2026 07:20

@ChasNelson1990 ChasNelson1990 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cooper667
cooper667 merged commit 5b6141a into main Jul 14, 2026
4 checks passed
@cooper667
cooper667 deleted the ci-improve-caching branch July 14, 2026 07:44
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.

2 participants