forgejo: let the deploy runner's init container write runner.ini; cap job memory; prune nightly

- init container runs as root: kubelet creates the hostPath /data as root:root
  and the runner image's default user cannot write runner.ini there.
- container.options --memory 3g on both Pi runners: two concurrent jobs must not
  take the 8 GiB Pi (already using swap) to OOM. Caps the job container only.
- forgejo-runner-prune CronJob: exited containers >48h, images >168h, builder
  cache >72h, so the single 917G / volume stops climbing.
This commit is contained in:
Sirius DevOps 2026-10-22 23:55:21 -04:00
commit 741b9f13a7
4 changed files with 79 additions and 2 deletions

View file

@ -27,7 +27,7 @@ data:
# No docker_host here: setting it makes the runner inject the host socket
# bind into the job container itself, which collides with the explicit
# -v /var/run/docker.sock in options ("Duplicate mount point").
options: -v /usr/local/bin/docker-static:/usr/bin/docker:ro -v /opt/siriusdevops/runner/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock
options: -v /usr/local/bin/docker-static:/usr/bin/docker:ro -v /opt/siriusdevops/runner/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock --memory 3g --memory-swap 3g
valid_volumes:
- "**"
# Dedicated runner for site deploys. It declares ONLY the `deploy-arm64`
@ -54,7 +54,11 @@ data:
privileged: true
# Same injection as arm64.toml: the job container is node:20-bullseye,
# which has no docker CLI and no buildx, and deploy-site.yml needs both.
options: -v /usr/local/bin/docker-static:/usr/bin/docker:ro -v /opt/siriusdevops/runner/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock
# buildx is the host's cli-plugins binary and binfmt/QEMU is registered on
# the Pi host, so amd64 cross-builds work here exactly as on the arm64
# runner. --memory caps the job container only (sibling `docker run`
# containers a workflow spawns are outside the runner's control).
options: -v /usr/local/bin/docker-static:/usr/bin/docker:ro -v /opt/siriusdevops/runner/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock --memory 3g --memory-swap 3g
valid_volumes:
- "**"