Skip to content
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

Docker-host prune should be a bit smarter #34

Open
shreddedbacon opened this issue Oct 6, 2021 · 7 comments
Open

Docker-host prune should be a bit smarter #34

shreddedbacon opened this issue Oct 6, 2021 · 7 comments

Comments

@shreddedbacon
Copy link
Member

Sometimes the docker-host fills up faster than the 168h here prune schedule can cope with.

This prune should be slightly more aggressive when the docker-host volume starts to reach limits that the 168h prune can't deal with, like 90% inodes or so we prune to 24h or all.

@twardnw
Copy link
Contributor

twardnw commented Nov 29, 2021

This would be fantastic. On one of my customer clusters they consume all the inodes rather quickly, often so fast that builds are blocked before cleanup can run.

@smlx
Copy link
Member

smlx commented Dec 1, 2021

That script could be a bit smarter, maybe something like this?

threshold=50
for limit in 168h 72h 48h 24h; do
	space=$(df / | awk 'END{print +$5}')
	inodes=$(df -i / | awk 'END{print +$5}')
	[ "$space" -lt $threshold ] && [ "$inodes" -lt $threshold ] && break
	docker image prune -af --filter "until=$limit"
done

@tobybellwood
Copy link
Member

youre-a-wizard-hagrid

@dasrecht
Copy link
Contributor

dasrecht commented Dec 8, 2021

Hmm the 24h is super dangerous if for example it runs on a Monday during the day it can fail deployments. therefore I'm not much in favour of a script that handles things dynamically

@twardnw
Copy link
Contributor

twardnw commented Dec 13, 2021

I'd also like if we could change the frequency of the cleanup cron task

@tobybellwood
Copy link
Member

Can we prune dangling images more aggressively (ie on a more frequent schedule) - do we have an idea on what the image breakdown is between dangling/non-dangling?

@dasrecht
Copy link
Contributor

Changing the frequency would go into the helm charts most likely

@tobybellwood tobybellwood transferred this issue from uselagoon/lagoon Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants