-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Are docker images pruned from runners after use? #210
Comments
@Glen-Moonpig I've run into this as well and fixed it by adding the
And then set |
it's good to know that pulling the image takes a long time, which caused a race condition while registering the runner resulting in being blocked on the gitlab api. This was solved by pulling the image in the background, hence the appended |
Thanks @fliphess , I had seen this repo but wasn't sure if it would be compatible with this module, I will try it out. Does the image run on the agent machine and clean up images from the runner machines? |
It doesn't on docker-machine, only on the local runner, I'm currently working on a new gitlab-runner setup for the company I work for to create a scaling setup, and I haven't solved this yet. Gitlab provides tooling to cleanup: You might be able to run this script as a post task or configure a cronjob through |
@Glen-Moonpig I only use the docker-machine setup, with a short cycle of ec2 instances. Thereform not having this issue. Would you like to update the docker example with the post install. Sound like a good approach. |
@fliphess Thanks for sharing! What value are you using for |
Hey @lsorber We are using 150GB disks. As we do some integration testing that requires pulling lots of different images at the same time, resulting in a large storage need, we added another cronjob that runs nighty as well to ensure some images are removed too as the cleaner docker wasn't always aware of images that are pulled directly using the docker daemon:
Which is a bazooka shooting mosquitto's to ensure all leftovers were removed nighlty. |
As the link to the Gitlab documentation is no longer working, try out this one: https://docs.gitlab.com/runner/executors/docker.html Solution is either use one of the scripts above or the Gitlab scripts I mentioned. |
And if required, the cache cleaner script is here (the url has changed): |
@fliphess But the script has to run on the docker+machine and not on the agent. Any idea how to get it working? |
@kayman-mk Sorry but I'm not using the module anymore as I switched job and am now using the kubernetes executor. Have a look at the But tbh, I think the easiest way to do this is bake your own AMI with all the required cleanup tools, crons etc added to it instead of adding complex scripts through userdata) |
Activated the following via crontab on my agents (via
|
@Glen-Moonpig Seems to be solved now and can be closed, right? |
Hi everyone. I wanted to know how can I run gitlab-runner-docker-cleanup in the current version of the module? |
See #210 (comment) Meanwhile the name of the variable changed to |
Hello Niek, I have a question you might be able to help me with..
I recently had to increase the root volume size of the runners because they were running out of disk space during job execution. I think this happened because some pipelines started using large docker images and suspect the images are pulled from the registry to the EC2 instance root volume to execute the job and then after the job completes the image remains in the machine's local registry.
Do you have any idea how the local image registry is managed on the runners? Is there any kind of automatic image pruning? Do you have any recommendations on how to clean up old images from the runner volumes?
The text was updated successfully, but these errors were encountered: