Repository navigation
Description
Summary
Split from #571 Section 2, step 1. On 2026-10-21, #571 read the host disk at 76 % used and asked for a scheduled clean-up of the Docker build cache and old images. Since then #564 shipped a per-deploy sweep and a cache prune. The disk is still 76 % used (2026-11-11, #749).
This issue measures what holds the disk first. Then it removes only what no rollback and no fast build needs. It never prunes the build cache below its 15 GB reserve. The reserve keeps the CACHED installs (7 of 30, #559) and the #566 A/B. Most of the #559 gain came from --ignore-scripts, not from the reserve.
Why
Reads from the production deploy logs, 2026-11-11 (gh run view <id> --log, step 💾 Pre-deploy disk guard):
| Read | Value | Source |
|---|---|---|
df -h / before the prune |
158G size, 120G used, 32G free, 80 % | run 43008200172, 2026-11-11 |
| Free after the prune | 39 to 42 GiB (printed as "GB"), median 40.5, n = 8 | (build): deploys 42344958557 to 43008200172, 2026-11-07 to 2026-11-11 |
| Free before the prune | 26 to 37 GiB (printed as "GB"), n = 8 | same runs |
| Build cache after the prune | 27.84 to 30.46 GB (26.41 GB reclaimable on the latest) | docker system df in the same runs |
| Images after the prune | 20 total, 20 in use, 9.274 GB on 7 of 8 deploys; 23 total, 20 in use on run 42603950298 | same |
| Local volumes | 8, 1.722 GB | run 43008200172 |
| Host free disk | 39,480,020,992 B (76 % used) | #749, node_filesystem_avail_bytes, 2026-11-11 |
- The guard prunes with
docker buildx prune -af --reserved-space 15GB --min-free-space 45GB(.github/workflows/prod.docs.plus.yml:612). It stops when free space reaches its target, so the cache stays near 28 GB. So bytes that a removal frees can turn into kept cache, and free space after the prune then stays flat. free_gbis GiB.free_gib()dividesdfKiB by 1024² (prod.docs.plus.yml:561), but the log line says "GB".- The guard removes each old
docsplus-*tag. It keepsDEPLOY_TAG,PREVIOUS_TAGand every image a container uses (prod.docs.plus.yml:566-599). So app images older than last-good are already 0 on most deploys. docker system dflists about 38.8 GB in images, volumes and build cache together.dfshowed 120G used before the prune. What holds the rest is not measured yet.docker system dfcounts the reserved cache as reclaimable. A target of "reclaimable under 5 GB" would wipe it. So this issue never uses reclaimable bytes as its metric.- The deploy aborts below 20 GB free after the prune (
prod.docs.plus.yml:627-631). One build wrote 14 GB on 2026-10-20 (Prune Docker build cache toward a free-disk target and keep rollback images #564).
What to change
-
Maintainer, on the host, read-only. Find what holds the used space. Post the output, with any path that names a secret or another project replaced by a label:
df -B1 / docker system df -v | head -80 docker info --format '{{.Driver}} {{json .DriverStatus}}' sudo du -xh --max-depth=1 / 2>/dev/null | sort -h | tail -15 sudo du -xh --max-depth=2 /var/lib/docker /var/lib/containerd /opt 2>/dev/null | sort -h | tail -25 comm -23 <(docker image ls -q --no-trunc | sort -u) <(docker ps -aq | xargs -r docker inspect -f '{{.Image}}' | sort -u) | wc -l
The last line counts images that no container uses. Candidates to check: the containerd image store, runner work folders, stage leftovers (Move the production runner to its systemd unit and its own root, and remove the stage runner #743 step 2 owns their removal) and old third-party images.
-
Agent in the repo. From the step 1 output, draft a list. Each line names one path or image set, its bytes, and whether a rollback or a cached build needs it. Explain why the prune stops at 39–42 GiB free with 28 GB of cache, against its 45 GB target. Post it as a comment. Then stop at a review checkpoint.
- If the cause is the build cache, [Tracking] Faster, change-aware CI/CD pipeline #554 Q4 (a post-deploy
cache-prunejob) becomes step 6 of this issue. Q4 is not filed on its own.
- If the cause is the build cache, [Tracking] Faster, change-aware CI/CD pipeline #554 Q4 (a post-deploy
-
Maintainer ruling. Rule which lines to remove, and whether removal runs in each deploy or on a schedule. These never go: the build cache below 15 GB, images at
DEPLOY_TAGorPREVIOUS_TAG, images a container uses, and any volume (redis-dataandtraefik-certsare volumes). -
Agent in the repo. If the ruling adds a deploy step, add it after the cache prune in
💾 Pre-deploy disk guard. Print free space before and after it in the step summary. Keep the--reserved-space 15GBflag unchanged. Then stop at a review checkpoint. -
Maintainer. Run a one-time removal by hand for anything the ruling does not automate. Run step 1 again after it, and post the result.
- Run it only after [Tracking] Faster, change-aware CI/CD pipeline #554 SP1 prints
0. - First post the exact list and its bytes.
- Remove by named path or image id only. Never run
docker system pruneor a volume command.
- Run it only after [Tracking] Faster, change-aware CI/CD pipeline #554 SP1 prints
Benchmark
| Field | Value |
|---|---|
| Metric | (a) Used bytes on / outside the build cache, after the prune: df used minus the docker system df build cache size, in GiB. (b) Images that no container uses, other than PREVIOUS_TAG, after each deploy. (c) Build cache after the prune, in GB |
| Before | (a) not measured yet in this form. The maintainer posts it as "Measured, " with run ids, before #747. Context: free after the prune (free_gb, GiB) median 40.5, range 39-42. That is n = 8 (build): deploys, runs 42344958557 to 43008200172, 2026-11-07 to 2026-11-11 (review read). (b) not measured yet: maintainer, step 1. (c) 27.84-30.46 GB, same runs (review read); the maintainer posts it in the same Measured comment |
| After | not measured yet |
| Condition | Production host (before the #747 in-place upgrade, ruled 2026-11-16), 158G root disk, Docker with BuildKit, 5 consecutive (build): deploys after the change. Rows after the #747 upgrade form a new sample |
| How to run | gh run view <run> --log | grep -E "Disk (before|after) prune|Build Cache|^.*Images ", and the step 1 commands on the host |
| Pass rule | (a) median used bytes outside the build cache falls by at least the bytes the ruling removes, minus 2 GiB, on n = 5. (b) 0 on 5 of 5 deploys. (c) at or above 15 GB on 5 of 5. Stop rule: revert the step if a webapp install stops printing CACHED and runs over 20 s on 2 deploys in a row (#559 metric), or if the rollback-image warning prints |
| Guard | The ::warning::Rollback image … is missing line never prints. The #559 install metric stays at or under its after value |
| Owner | Steps 1, 3, 5: maintainer. Steps 2, 4: agent in the repo |
| Claim | Ops ledger: "The production host now holds GiB outside the build cache after each deploy, down from GiB, and it still keeps the 15 GB build cache." |
Out of scope
- Host size and the observability placement. Move production to a new Debian 13 droplet #747 rules them after Keep 45 days of Prometheus history, and let Prometheus watch its own storage #749 gives 30 days of data. Measure prod memory, swap and CPU for 7 days before any compute change #324 rules the Supabase compute.
- Prometheus retention. Keep 45 days of Prometheus history, and let Prometheus watch its own storage #749 adds a size cap (3 GB recommended in its Decision 1).
Related
#571 (split from), #564 (the current sweep and prune), #559 and #566 (need the build cache), #743 step 2 (stage leftovers), #747 (in-place upgrade, 11 → 12 → 13), #749 (Prometheus disk), #554. #554 Q4 edits the same prune; #756 lands before Q4, and Q4 folds into step 6 if the cause is build cache. #554 SP1 (the live-run check) gates step 5.
Activity
HMarzban commentedon Nov 14, 2026
Moved to v2.3.7 at the v2.3.6 release audit. The step 1 host read is not posted, so the before and the after are both not measured yet.
HMarzban commentedon Nov 16, 2026
Review, 2026-11-16 (maintainer approved).
prod.docs.plus.yml: prune:574to:612,free_gib():523to:561, tag sweep:528-561to:566-599, hard guard:589-594to:627-631.