forked from RoushTech/docker
ci: reap the BuildKit builders CI has been leaking #21
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/reap-orphaned-buildkit-builders"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Main and every open PR have been failing on the runner's disk rather than on anything in the diff.
The second is the first in disguise: once free space drops far enough, buildkit's GC evicts blobs while an export still references them, so the build dies mid
importing to dockerinstead of with a clean ENOSPC.What leaks
docker/setup-buildx-actioncreates a throwawaydocker-containerbuilder per job and removes it in its post step. On a loaded daemon that removal times out — from run 254:The buildkit container and its state volume are orphaned permanently, and each holds a full build cache — the builder advertises
maxUsedSpace: 90.34GiB. Nothing reaps them, so the floor rises with every timed-out cleanup.The fix
./reap-buildkit-orphans, run at the top of both jobs.It is deliberately narrow. The daemon behind
forgejo-docker-socketis a live Swarm manager —docker inforeports 87 containers, 178 images,Is Manager: true— so it touches only objects namedbuildx_buildkit_*. Nosystem prune, noimage prune, no blanketvolume prune.dangling=true, so one still attached to a live builder is never listed.docker system dfprints unconditionally, so the next failure says whether the leak came back or something else filled the disk.Also
CLAUDE.md gains the daemon's shared, non-disposable nature, plus two monitoring corrections found while diagnosing this:
/actions/taskshangs and times out (use/actions/runs, filtered oncommit_sha), and the API wants a run's internalidwhere the web UI showsindex_in_repo—POST /actions/runs/{id}/cancel404s if given the run number.6ff8ae3c4b6be95cd0a7