mirror of
https://git.zavage.net/Zavage-Software/zavage-gitea-runner.git
synced 2026-08-10 13:30:28 -06:00
feat: docker cleanup timer
This commit is contained in:
parent
202459ea83
commit
fd681eca9d
@ -44,6 +44,11 @@ journalctl --user -u docker.service
|
||||
journalctl gitea-act-runner.service
|
||||
```
|
||||
|
||||
# Notes
|
||||
* Now using arch gitea-runner package (official).
|
||||
* Make sure to use /etc/gitea-runner/config.yaml
|
||||
* Enable the cleanup timer to clean docker cache every now and then
|
||||
|
||||
# See also
|
||||
* Mathew Guest: mat@zavage.net
|
||||
* https://gitea.com/gitea/act_runner
|
||||
|
||||
13
user_system/gitea-runner-docker-cleanup.service
Normal file
13
user_system/gitea-runner-docker-cleanup.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Prune docker + runner cache (rootless CI cleanup)
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# Environment=DOCKER_HOST=unix:///run/user/1004/docker.sock
|
||||
Environment=DOCKER_HOST=unix://%t/docker.sock
|
||||
# keep one week of docker images/build cache, drop the rest
|
||||
ExecStart=/usr/bin/docker system prune -af --filter until=168h
|
||||
ExecStart=/usr/bin/docker builder prune -af --filter until=168h
|
||||
# drop runner cache entries untouched for 2+ weeks
|
||||
ExecStart=/usr/bin/find %h/.cache/actcache -type f -atime +14 -delete
|
||||
|
||||
10
user_system/gitea-runner-docker-cleanup.timer
Normal file
10
user_system/gitea-runner-docker-cleanup.timer
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Weekly CI cleanup
|
||||
|
||||
[Timer]
|
||||
OnCalendar=Sun 04:00
|
||||
Persistent=true
|
||||
RandomizedDelaySec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Loading…
Reference in New Issue
Block a user