-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tasks: Regularly clean up leftover containers and outdated images #630
Conversation
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never seen ExecStart=-
, is that allowed to fail syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use podman image prune
? Should be safer and only remove unused images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, -
prefix means "allowed to fail", see manpage.
podman image prune
TIL! This is nicer indeed, done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(--force
is terribly named -- should be -y
or so..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo can fixed or we just merge
Type=oneshot | ||
# remove leftover containers | ||
ExecStart=/bin/sh -ec 'podman ps -q --filter status=exited | xargs -r podman rm' | ||
# remote old task images |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typoe remote -> remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed.
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.
Our webhook has ran in CentOS CI for a long time. tasks/README.md also says so, but the AWS documentation contradicted that. Update it accordingly.
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.
Our bot instances tend to look like this:
I rolled this out, the timer started, and cleaned up all that cruft.