Hosts touched: ci-runner .127, bumblebee .99, jazz .29 (script installed at /usr/local/bin/docker-ci-prune.sh, existing hourly docker-ci-prune.timer picks it up)
What to Review
ci-runner .127 filled its 63 G root and reddened an ersatztv EF-migration job with database or disk is full, blocking that PR's merge gate. The #654 hourly prune was already running and did not prevent it. Fix adds two things to that script: a per-builder buildkit cache size cap via buildctl prune --keep-storage, and reaping of orphaned running CI containers (GITEA-ACTIONS-*, etv-smoke-*) older than 24 h.
Points worth adversarial attention:
The 24 h orphan-reaping threshold is a judgement call. It force-removes running containers by name prefix. I verified no non-CI container on bumblebee (74 running) matches the prefixes, but the rule is name-based and would reap any future long-running container that adopts those prefixes. Is a name-prefix + age rule the right guard, or should it key off the runner's own task bookkeeping?
--keep-storage 2048 per builder is a chosen constant, not derived from host disk. With 4 concurrent builders that bounds ci-runner at ~8 G, but the number is arbitrary and identical on a 63 G box and a 1.9 T box.
Flag interaction I found empirically: combining --keep-duration with --keep-storage makes buildkit exempt recently-used records from the size cap — the prune logs success while freeing nothing. I removed --keep-duration. Worth confirming that reading, since the script's log line would otherwise lie again.
Cache loss trade-off: capping dropped ~66 G on bumblebee including 39 G of host build cache. I judged this cheap because the ersatztv build uses cache-from type=registry. Verify that holds for all builds on these hosts, not just ersatztv.
Control choice: #670 asked for a prune schedule or an alert or a preflight. I fixed the existing schedule and added a WARN log at ≥85% root usage, but wired no Grafana alert — so the loud-failure requirement rests on journal output nobody reads. Is that sufficient?
Review Type
Post-implementation.
## Target
- **Project**: server-management
- **Repo**: timothy/server-management
- **Issues**: #670 (follows #654, which fixed the volume-leak half and was insufficient)
- **Commits**: `5f8e22d` (script), homelab-docs `81d899b` (docs)
- **Files**: `scripts/ci-runner/docker-ci-prune.sh`, `docs/Docker/Stacks/act-runner.md`
- **Hosts touched**: ci-runner .127, bumblebee .99, jazz .29 (script installed at `/usr/local/bin/docker-ci-prune.sh`, existing hourly `docker-ci-prune.timer` picks it up)
## What to Review
ci-runner .127 filled its 63 G root and reddened an ersatztv EF-migration job with `database or disk is full`, blocking that PR's merge gate. The #654 hourly prune was already running and did not prevent it. Fix adds two things to that script: a per-builder buildkit cache size cap via `buildctl prune --keep-storage`, and reaping of orphaned *running* CI containers (`GITEA-ACTIONS-*`, `etv-smoke-*`) older than 24 h.
Points worth adversarial attention:
1. **The 24 h orphan-reaping threshold is a judgement call.** It force-removes running containers by name prefix. I verified no non-CI container on bumblebee (74 running) matches the prefixes, but the rule is name-based and would reap any future long-running container that adopts those prefixes. Is a name-prefix + age rule the right guard, or should it key off the runner's own task bookkeeping?
2. **`--keep-storage 2048` per builder is a chosen constant**, not derived from host disk. With 4 concurrent builders that bounds ci-runner at ~8 G, but the number is arbitrary and identical on a 63 G box and a 1.9 T box.
3. **Flag interaction I found empirically**: combining `--keep-duration` with `--keep-storage` makes buildkit exempt recently-used records from the size cap — the prune logs success while freeing nothing. I removed `--keep-duration`. Worth confirming that reading, since the script's log line would otherwise lie again.
4. **Cache loss trade-off**: capping dropped ~66 G on bumblebee including 39 G of host build cache. I judged this cheap because the ersatztv build uses `cache-from type=registry`. Verify that holds for all builds on these hosts, not just ersatztv.
5. **Control choice**: #670 asked for a prune schedule *or* an alert *or* a preflight. I fixed the existing schedule and added a WARN log at ≥85% root usage, but wired no Grafana alert — so the loud-failure requirement rests on journal output nobody reads. Is that sufficient?
## Review Type
Post-implementation.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Target
5f8e22d(script), homelab-docs81d899b(docs)scripts/ci-runner/docker-ci-prune.sh,docs/Docker/Stacks/act-runner.md/usr/local/bin/docker-ci-prune.sh, existing hourlydocker-ci-prune.timerpicks it up)What to Review
ci-runner .127 filled its 63 G root and reddened an ersatztv EF-migration job with
database or disk is full, blocking that PR's merge gate. The #654 hourly prune was already running and did not prevent it. Fix adds two things to that script: a per-builder buildkit cache size cap viabuildctl prune --keep-storage, and reaping of orphaned running CI containers (GITEA-ACTIONS-*,etv-smoke-*) older than 24 h.Points worth adversarial attention:
--keep-storage 2048per builder is a chosen constant, not derived from host disk. With 4 concurrent builders that bounds ci-runner at ~8 G, but the number is arbitrary and identical on a 63 G box and a 1.9 T box.--keep-durationwith--keep-storagemakes buildkit exempt recently-used records from the size cap — the prune logs success while freeing nothing. I removed--keep-duration. Worth confirming that reading, since the script's log line would otherwise lie again.cache-from type=registry. Verify that holds for all builds on these hosts, not just ersatztv.Review Type
Post-implementation.