✨ Add act_runner cleanup and apply full runner config ✨

Prune leftovers from CI jobs in the nested dockerd on a schedule, and
make runner-N daemons use the full default_config.yaml instead of a
cache-only config.

- rootfs/usr/local/bin/cleanup-runners: new script that prunes stopped containers, networks, build cache, act-* volumes, dangling images, all unused images above a disk threshold, and stale ~/.cache/act clones
- rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh: add RUNNER_CLEANUP_* settings, run cleanup-runners via __cron, export RUNNERS_CONFIG_BASE
- rootfs/usr/local/bin/start-runners: generate per-runner config.yaml from RUNNERS_CONFIG_BASE with its own runner.file; keep cache-only config as fallback
- README.md: document RUNNER_CLEANUP_* variables, per-runner config, correct RUNNER_IP_ADDRESS default
- TODO.AI.md: record both fixes and log newly found open issues

Claude-Session: https://claude.ai/code/session_01Kae22tmhzhmfHyqc34PZbx
This commit is contained in:
casjay committed 2026-10-03 11:08:05 -04:00
1 parent 7741c06dc3
commit 6e24727c29
5 files changed
+193 -8

No files matched your search

+8 -3
View File
@@ -140,9 +140,14 @@ networks:
|----------|---------|-------------|
| `RUNNERS_START` | `5` | Number of act\_runner instances to register |
| `RUNNER_CACHE_PORT` | `44015` | Port for the act\_runner cache server |
| `RUNNER_IP_ADDRESS` | container IP | IP address act\_runner registers with Gitea |
| `RUNNER_DEFAULT_HOME` | `/config/act_runner/gitea` | Directory where runner registration state is stored |
| `RUNNER_CONFIG_NAME` | `act_runner.yaml` | Runner config filename inside `RUNNER_DEFAULT_HOME` |
| `RUNNER_IP_ADDRESS` | `127.0.0.1` | IP address act\_runner registers with Gitea |
| `RUNNER_DEFAULT_HOME` | `/config/act_runner/gitea` | Directory holding the base runner config |
| `RUNNER_CONFIG_NAME` | `act_runner.yaml` | Base runner config filename inside `RUNNER_DEFAULT_HOME`; every runner gets a copy at `/config/act_runner/reg/runner-N/config.yaml` |
| `RUNNER_CLEANUP_ENABLED` | `yes` | Periodically prune job containers, volumes, networks, build cache and images from the inner Docker daemon |
| `RUNNER_CLEANUP_INTERVAL` | `60` | Minutes between cleanup runs |
| `RUNNER_CLEANUP_UNTIL` | `72h` | Only prune stopped containers, networks and build cache older than this |
| `RUNNER_CLEANUP_DISK_PERCENT` | `80` | Remove all unused images once `/data/docker` reaches this disk usage percent |
| `RUNNER_CLEANUP_ACT_CACHE_DAYS` | `7` | Remove cloned actions in `~/.cache/act` unchanged for this many days (`0` disables) |
| `ACT_RUNNER_FALLBACK_VERSION` | `v1.0.8` | Pinned act\_runner version used if gitea.com is unreachable during build |
**Runner labels** are set automatically based on the host architecture. All jobs run inside Docker containers — no bare-metal execution.