Skip to content

Improve release build times - #832

Merged
KavanPrice merged 3 commits into
kp/dockerfile-set-efrom
kp/faster-release-builds
Oct 22, 2026
Merged

KavanPrice merged 3 commits into
kp/dockerfile-set-efrom
kp/faster-release-builds

Conversation

@KavanPrice

@KavanPrice KavanPrice commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Release builds never used the Docker layer cache. It was kept in the GitHub Actions cache, which a release can't read back because each release runs on its own tag, so every image was built from scratch. In v6.13.1 only 1 of 46 image builds had a cache hit.

  • Build caches now live in GHCR next to each image, as <image>:buildcache (or buildcache-<arch>).
  • krb-keys-operator copies only lib/py-python-kadmv, so changes elsewhere in lib/ no longer rerun its 3-5 minute pip compile, the slowest step of every release.
  • ARG revision/tag is declared just above the step that writes the version, so npm install can come from cache. This also fixes the empty GIT_VERSION in acs-cmdesc, acs-auth and acs-data-access.
  • Cached layers no longer pick up new Alpine packages or unpinned pip versions on every release. They refresh when their inputs or base image change.

@KavanPrice
KavanPrice added this pull request to stack #833 October 21, 2026 17:54
@AlexGodbehere

Copy link
Copy Markdown
Contributor

🔥

@KavanPrice
KavanPrice force-pushed the kp/faster-release-builds branch from 1d001f0 to 4acd86b Compare October 22, 2026 09:37
@KavanPrice

Copy link
Copy Markdown
Collaborator Author

Build time test

I published two pre-releases from this branch, both on the same commit (4acd86bf). v6.14.0-dev.1 started with no registry cache and filled it. v6.14.0-dev.2 then ran against that cache.

Wall time Runner time Slowest job Build steps from cache
v6.13.1 388s 3,844s krb-keys-operator 317s –
v6.14.0-rc.1 379s 3,970s krb-keys-operator 278s 4/406
v6.14.0-dev.1 (cold cache) 419s 3,467s krb-keys-operator 312s 0/406
v6.14.0-dev.2 (warm cache) 254s 2,472s acs-admin 89s 300/406
  • A release with a warm cache takes about a third less time, and runner time drops by about 37%.
  • krb-keys-operator went from about 300s to 36s. Its pip compile of krb5/gssapi now comes from the cache.
  • All 46 builds wrote their cache to GHCR. The only errors in dev.1 were the expected "not found" when importing a cache that didn't exist yet.
  • Even the cold run used less runner time than before, because pushing the cache to GHCR is cheaper than uploading it to the Actions cache.
  • dev.2 is the best case, because nothing changed between the two runs. In a real release, each service whose code changed also rebuilds from COPY . . onwards.

@KavanPrice
KavanPrice merged commit 223e477 into dev Oct 22, 2026
144 checks passed
@KavanPrice
KavanPrice deleted the kp/faster-release-builds branch October 22, 2026 13:00
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