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
reduce docker images #4637
Comments
As 0x6178656c wrote in #4620 (comment):
|
We are regularly running into "no space left" problems because of too many Docker images, so I tagged it as urgent and removed the "probably to be removed". @mpranj any other suggestions other than the two Docker images above? |
One thing I noticed about our images is that they are very big. Maybe we can look into making them smaller, that should help with the disk space problems. |
I think this will not save any space. AFAIK: removing unused images will do nothing to our disk space usage, as the images are not built by the pipeline. The images are build only when needed.
Would be great if we can do something about this. Maybe we can add the docker build option |
Wouldn't that mean different images can't share a layer and all images would have to be built entirely from scratch, if there is the tiniest difference?
So do we actually build new images for every Jenkins run? Is there any kind of auto-cleanup? Also, since I don't have access to the CI servers: Are we sure that the docker images are the problem? Could there be something else that is eating disk space too, e.g. log files with long retention periods, or artifacts of old builds? |
Yes, but I'll test this now to see if there is any difference.
Yes, pretty sure it is at least the biggest problem. Most other things are cleaned up.
Not for every run, but when they are needed. So images are reused once they are build. They are rebuilt monthly s.t. the packages are updated periodically. |
Unfortunately you're right. |
Okay, how exactly is our Fedora 36 Image over 2GB in size, when the base Another thing we could do: Remove Java from all images except one, maybe even remove it completely from Jenkins and only test on Cirrus. The JVM should be the same everywhere. |
Yes, this is why I extended the scope of this issue, the idea was to suggest which used Docker images (probably the least important ones) to remove or how to make them smaller.
Actually especially Java is very prone to problems in CMake detection and similar. So it is good to have these tests across several distributions. Btw. the issue seems to be not as urgent as I thought. Used disc space is now: 346G used, 1.5T available, i.e. 20% used, so the problem is simply that running Further suggestions what to reduce nevertheless are welcome. At some point we will need to do the cleanup. |
After running |
I see we have 4 different Debian Bullseye images? Why? I get the Also if Additionally, we can probably run |
Seriously doubt this happened. Usually it cleans about 100-200GB. What machine are you talking about? On
What might be a problem: |
To also test cmake exclusion of modules. Probably we should make these images build upon each other to use less space?
Yes, sounds like the easiest solution for now. Is there some way to only cleanup the images that weren't used for a week?
In #4637 (comment) I was talking about a7 of the recent incident #160 (comment). |
Building the images on top of each other would definitely help. There's probably a few other things we can do. Like reducing the number of
Yes, the |
Fedora32 Docker image analysisSo I did a small investigation on the "scripts/docker/fedora/32/Dockerfile" image. Top 10 packages by size.
ImprovementsAdding weak_deps=False option
--setopt=install_weak_deps=False: This flag disables the installation of weak dependencies, which can help reduce the number of unnecessary packages installed. Equivalent to --no-install-recommends in apt-get. ResultAdding this dnf option reduced the image size by ~15%. Maybe it might be interesting to use some container registry like ghcr.io to reduce duplicate code and build some base images, that other dockerfiles could build upon. |
Thank you for the investigation. Yes, please add this option(s). |
The text was updated successfully, but these errors were encountered: