Parallelise docker-machine removal script
Overview
We have remove_machines.sh that is executed in different lifecycles of the gitlab-runner
process. This removes a machine from local reference and the cloud provider, each deletion on GCP ends up taking over 1 minute, if we are running hundreds of machines concurrently which we are deletion can take hours.
We can update the script to delete machines in parallel something like ls /root/.docker/machine/machines | xargs -P100 -n1 sudo -H docker-machine rm -f
, -P
probably need to be configurable depending on the rate limits.
Checklist:
-
update the cookbook 👉 gitlab-cookbooks/cookbook-wrapper-gitlab-runner!44 (merged) -
update cookbook for non-production environments 👉 https://gitlab.com/gitlab-com/gl-infra/chef-repo/-/merge_requests/807 -
update cookbook for production environments 👉 https://gitlab.com/gitlab-com/gl-infra/chef-repo/-/merge_requests/808
Edited by Tomasz Maczukin