-
Notifications
You must be signed in to change notification settings - Fork 536
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
Better pruning of docker volumes during make up/down #22780
Conversation
Needs an issue 😉 - though I'm not sure I really understand the use-case, and why we need this clean-up script in our makefile - it seems more a general docker clean-up, and something that doesn't affect anything (other than a bit of lost disk space). Maybe @diox has other thoughts. |
It's not a bit... it can be dozens or over a hundred gigabytes of data. Essentially docker is not smart enough to clean up some of our orphan volumes and some of those contain huge data (our whole repository or memory cache from service X) I regularly run into out of disk space errrors so finally decided to fix it. The clean up script has been there for months, it just didn't work. Now it works. |
I have 600GB free and haven't done anything special to clean extra docker cruft - was this because you were working on docker optimizations (now complete?) or it's some symptom of a setup specific problem you have?
what script? The code it replaces is just |
Definitely needs an issue if only for tracking purposes. I've ran into this too, but I'm not sure such an agressive way of handling this is warranted in our own |
@diox to your point.. True it removes all dangling volumes, but only filters for "dangling" volumes which means ones not associated with any container and not tagged by a user.. These volumes cannot serve any purpose as no container or compose project would be able to use them since they are already dangling/orphaned. Additionally, we already had this as the intended outcome, it just hasn't worked.. maybe ever. But it was always there. So I'm confused why we are discussing the intent of the patch, when it's already there. |
@eviljeff linked issue. |
The script special cases the mysql volume so isn't it possible another docker based project could also have special volumes that shouldn't be removed?
A command was there - |
Funny enough, this is actually a bug in docker compose moby/moby#48754 that seems to have just been fixed, like several days ago. |
ff0b5eb
to
f489b96
Compare
@eviljeff addressing some of your points:
|
…renew-anon-volumes, strict filter on volume cleaning
f489b96
to
c7fbec5
Compare
I wasn't arguing that we shouldn't fix an issue I'm not experiencing, I was arguing we shouldn't make the user experience worse by automatically clearing stuff from Docker we didn't ourselves create, for an issue that had unclear impact (i.e. if it only affected you, or a small minority of users). If the script is limited to our created content, so it doesn't regress or otherwise introduce any harmful side effects, then no problem. |
Right, I'm only trying to point out that
We are doing this, right now, on master. This patch doesn't introduce that problem, and now actually solves that problem. |
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.
…renew-anon-volumes, strict filter on volume cleaning (#22780)
Relates to: mozilla/addons#15119
Relates to: mozilla/addons#15046
Description
Remove many totally unnecessary docker volumes and simplifies the management of others.
Context
There is a recently squashed upstream bug in docker where (supposed to be) anonymous volumes are not labelled correctly, causing our various docker commands to leave behind anonymous looking volumes. Over time these volumes pile up and result in out of storage errors and general slowness of docker.
This PR originally tried to address that issue but instead simply addresses the volume mount concurrency problem and reduces the surface area of the space problem by reducing the number of volumes our project depends on.
Testing
Make UP
Create an anonyomous dangling volumne
Now run
make up
to ensure your containers and non dangling volumes are running.Expect that the volume you created is not destroyed, neither are any of the running container volumes
This should remove anonymous volumes that were created when running make up, but should not remove the volume you created initially.
Bonus: Rerunning
make docker_clean_volumes
after running make down should either do nothing (if all volumes were cleaned up already) or remove any project associated anonymous volumes. Again, you original volume from the top should still be there.Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.