-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tasks: Regularly clean up leftover containers and outdated images
Our bots accumulate outdated task containers which eat a lot of space over time. This will become worse now with automated tasks updates from commit 4824188. Our machinery also sometimes leaks exited/failed containers, clean them up as well.
- Loading branch information
1 parent
4824188
commit 00afb88
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Clean up cockpituous cruft | ||
|
||
[Service] | ||
Type=oneshot | ||
# remove leftover containers | ||
ExecStart=/bin/sh -ec 'podman ps -q --filter status=exited | xargs -r podman rm' | ||
# remote old task images; this is opportunistic -- it won't remove used images, but will fail on them | ||
ExecStart=-/usr/bin/podman rmi --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Unit] | ||
Description=Regularly clean up cockpituous cruft | ||
|
||
[Timer] | ||
OnBootSec=1h | ||
OnUnitActiveSec=24h | ||
AccuracySec=15min |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ cat <<EOF > /etc/systemd/system/[email protected] | |
Description=Cockpit Tasks %i | ||
Requires=podman.socket | ||
After=podman.socket | ||
Wants=cockpituous-janitor.timer | ||
[Service] | ||
Restart=always | ||
|