feat(build): raise BuildKit cache-mount budget for remote builders #112

Merged
pat-s merged 1 commit from fix/buildkit-cache-mount-budget into main 2026-07-08 08:22:04 +00:00
Owner

BuildKit's default GC caps the ephemeral cache tier — RUN --mount=type=cache mounts, local build context, git checkouts — at a hardcoded 512 MB (shown as 488.3 MiB in buildx inspect).
Across our 7-distro build matrix that fills instantly and forces re-downloads of system + R packages on every rebuild.

Changes

  • docker/buildkitd.toml (new) — GC config passed via --config when creating the docker-container builders artemis (amd64) and gaia (arm64):
    • cache-mount tier: 512 MB → 8 GB, retained 7 days
    • total cache bounded at 40 GB with 20 GB min-free
  • justfile — document the --config docker/buildkitd.toml flag on the builder-create commands so a recreate does not silently revert to the 512 MB default.

Notes

  • Limits are absolute (not %) because the two hosts differ ~6× in free space (Hetzner ~42 GiB free vs Mac mini ~279 GiB). The 20 GB min-free is the safety valve on the disk-tight Hetzner host; the old default wanted 64 GiB free, which does not exist there.
  • Both live builders were already recreated with this config and verified running.
BuildKit's default GC caps the ephemeral cache tier — `RUN --mount=type=cache` mounts, local build context, git checkouts — at a hardcoded **512 MB** (shown as `488.3 MiB` in `buildx inspect`). Across our 7-distro build matrix that fills instantly and forces re-downloads of system + R packages on every rebuild. ## Changes - **`docker/buildkitd.toml`** (new) — GC config passed via `--config` when creating the `docker-container` builders `artemis` (amd64) and `gaia` (arm64): - cache-mount tier: **512 MB → 8 GB**, retained 7 days - total cache bounded at **40 GB** with **20 GB min-free** - **`justfile`** — document the `--config docker/buildkitd.toml` flag on the builder-create commands so a recreate does not silently revert to the 512 MB default. ## Notes - Limits are absolute (not `%`) because the two hosts differ ~6× in free space (Hetzner ~42 GiB free vs Mac mini ~279 GiB). The 20 GB min-free is the safety valve on the disk-tight Hetzner host; the old default wanted 64 GiB free, which does not exist there. - Both live builders were already recreated with this config and verified running.
BuildKit's default GC caps the ephemeral cache tier (RUN
--mount=type=cache mounts, local context, git checkouts) at a hardcoded
512 MB.
Across the 7-distro build matrix that fills instantly and forces
re-downloads of system and R packages on every rebuild.

Add docker/buildkitd.toml and pass it via --config when creating the
docker-container builders (artemis/amd64, gaia/arm64):

- cache-mount tier raised 512 MB -> 8 GB, retained 7 days
- total cache bounded at 40 GB with 20 GB min-free (safe on the
  disk-tight Hetzner host, modest on the Mac mini)

Limits are absolute rather than percentages because the two hosts differ
~6x in free space. Document the --config flag in the justfile so a future
recreate does not silently revert to the 512 MB default.
pat-s merged commit 09536cddd6 into main 2026-07-08 08:22:04 +00:00
pat-s deleted branch fix/buildkit-cache-mount-budget 2026-07-08 08:22:05 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
devxy/build-cran-binaries!112
No description provided.