Skip to content

images: add zstd to the base guest packages - #17

Merged
linyiru merged 1 commit into
mainfrom
feat/zstd-base-packages
Oct 18, 2026
Merged

linyiru merged 1 commit into
mainfrom
feat/zstd-base-packages

Conversation

@linyiru

@linyiru linyiru commented Oct 18, 2026

Copy link
Copy Markdown
Member

Closes #16.

Change

  • images/build-ubuntu-rootfs.sh: zstd joins the first apt layer, so --toolset minimal and base get it (only full had it, via runner-images' install-zstd.sh).
  • images/build-rootfs.sh: zstd added to the debootstrap set of the Debian tiers, for the same reason.
  • images/README.md: why, and the one-time cold miss per cache key.

Verification (2026-10-18)

  • build-ubuntu-rootfs.sh --toolset minimal --cache-redirect --size-mb 14315 built on starship, exit 0. In the image: /usr/bin/zstd 1.5.5, zstd --quiet --version → 1.5.5 (so @actions/cache picks zstd), node v22.11.0, runner service enabled, cache-redirect patch present.
  • Extraction on 2 pinned CPUs, tmpfs, image binaries, 394 MB of /usr/lib + /usr/share, 3 runs: tar -xz 0.95 s vs tar --use-compress-program unzstd 0.43 s (~2.2x); archive 129 MB vs 119 MB. Not yet measured inside a guest.

Rollout note

The compression method is part of the cache entry version, so each key misses once after a golden gains zstd. Nothing to migrate.

Without zstd in the guest, actions/cache restores and saves with gzip.
On a 2-vCPU guest single-threaded gunzip, not the network, sets the
restore time (~38 s to untar a ~1.8 GB pnpm store fetched in ~5 s).
Only --toolset full got zstd, via runner-images' install-zstd.sh.

Add it to the first apt layer of build-ubuntu-rootfs.sh so minimal and
base get it too, and to the debootstrap set of build-rootfs.sh for the
Debian tiers.

Closes #16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

Both package additions use existing shared installation paths, and no blocking issues were identified.

No open issues 🎉

What changed in this PR

Adds zstd to shared guest-image packages so all Ubuntu toolsets and Debian tiers support faster actions/cache compression, addressing #16.

Changes:

  • Installs zstd in both base image builders.
  • Documents the compression change and one-time cold cache miss per key.
File Description
images/​README.md Explains zstd availability and cache rollout behavior.
images/​build-ubuntu-rootfs.sh Adds zstd to the shared Ubuntu package layer.
images/​build-rootfs.sh Adds zstd to Debian bootstrap packages.

Review effort: Balanced

@linyiru

linyiru commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

Measured inside the guests after the falcons' minimal golden gained zstd (2026-10-18, kaikhq/manekineko, firerunner-node, 2 vCPU), same key pnpm-store-v11-linux-x64-7f7980f8…, so the same content:

gzip, old golden (n=4) zstd, new golden (n=1)
entry size 1,887,996,887–1,888,147,527 B 1,476,701,076 B (−22%)
tar -x 37.0–41.1 s 21.5 s
whole restore step 40.7–46.5 s 25.3 s
save (zstdmt pack + upload) — 24 s + 3 s

The guest picked zstd on its own (--use-compress-program zstdmt on save, unzstd on restore). As expected, the first job per key missed once.

@linyiru
linyiru merged commit 9e8723a into main Oct 18, 2026
5 checks passed
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.

Add zstd to the base guest packages: actions/cache falls back to single-threaded gzip

3 participants