ci(runner): cap the act_runner cache + 30-min prune (fix recurring disk-full)

The hourly docker-prune could never reclaim the real disk filler: the act_runner
cache server's blob store (cache.dir:"" -> /root/.cache/actcache/cache) lives in
the long-running runner container's WRITABLE LAYER, which docker prune can't see.
It grew to ~66 GB and filled the 125 GB disk on its own.

- New docker-prune.sh holds the logic (inline ExecStart= broke under systemd's
  own $-expansion, which emptied $SZ/$(...) before sh ran them — silently no-oping
  the burst guard). The unit now just calls the script.
- Caps the actcache: clears the blobs once they exceed ~20 GB (act_runner
  repopulates; keys are content-hashed, so only stale entries drop).
- Burst guard lowered 85%->80% and now also clears the actcache.
- Timer hourly -> every 30 min; image/cache `until` 12h -> 6h.

Live: cleared 66 GB on home-runner-1 (93% -> 20%), deployed + verified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-19 07:53:08 +00:00
parent def681c54c
commit 693eedd314
3 changed files with 61 additions and 19 deletions
+5 -4
View File
@@ -1,12 +1,13 @@
# Runs docker-prune.service hourly (the burst guard needs to react within the hour, not every 6h).
# Runs docker-prune.service every 30 min. The runner is hammered with build bursts that can refill
# the disk fast (and the actcache cap needs to react well within an hour), so 30 min beats hourly.
# Persistent=true catches up after downtime. Install: see the header of docker-prune.service.
[Unit]
Description=Run docker-prune hourly (CI runner disk hygiene + burst guard)
Description=Run docker-prune every 30 min (CI runner disk hygiene + actcache cap + burst guard)
[Timer]
OnCalendar=hourly
RandomizedDelaySec=300
OnCalendar=*:0/30
RandomizedDelaySec=120
Persistent=true
[Install]