-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
feat: add docker autoscaler executor #1118
feat: add docker autoscaler executor #1118
Conversation
Hey @mmoutama09! 👋 Thank you for your contribution to the project. Please refer to the contribution rules for a quick overview of the process. Make sure that this PR clearly explains:
With submitting this PR you confirm that you hold the rights of the code added and agree that it will published under this LICENSE. The following ChatOps commands are supported:
Simply add a comment with the command in the first line. If you need to pass more information, separate it with a blank line from the command. This message was generated automatically. You are welcome to improve it. |
Hi @kayman-mk. This change could be the next major release of the module. Gitlab is still on track to make their plugin GA this summer: https://gitlab.com/groups/gitlab-org/-/epics/6995 We are still NOT using this version in our production setup, but we will deploy it on part of our runners in June. What should be the next steps for this PR? Best regards, |
Sounds quite promising to get rid of the outdated docker machine. As soon as GitLab has published their module, we can integrate it here. As far as I can see the docker machine can still be used, so we can create a feature release. Before the next major release I will check if we can get rid of docker machine to simplify the code. Could you please post the settings to test this change? At the moment I am working on #1117. That change will be merged before to support zero downtime during deployment of a new version. |
Thanks @kayman-mk for your answer. I was not aware of this zero downtime PR, very interesting, we can test it as well in our environment. |
@Tiduster Could you please post a minimal configuration showing which AMIs to use to get this up and running? |
ea41c66
to
0226a05
Compare
0226a05
to
9a967f6
Compare
Just tried it, but with no success. Runner is up and working. But in case a job is processed, GitLab shows
The Runner shows in Cloudwatch
The first error seems to be related to And I noticed that Docker was not installed on the Runner and |
|
@kayman-mk The installation of Docker is now mandatory indeed; I've mentioned it in the usage.md file (along with adding the user in docker group). |
On our side we build a custom AMI from ubuntu and we add docker package manually. Docker autoscaler do not do this by default, so it require an AMI with docker engine to work. We re-used runner_worker_docker_machine_ami_filter and runner_worker_docker_machine_ami_owners for this to no duplicate variables. We can create new variables if you prefer. @mmoutama09 added some information about this in usage.md. Best regards, |
20fd1b6
to
bff273f
Compare
@kayman-mk I've updated my code to separate docker-autoscaler from docker+machine. To use the new docker-autoscaler we must provide an AMI with docker installed and the user used by autoscaler to connect to workers must be added to docker group. The variable |
Hmm, the need for a custom built image doesn't sound good to me at first hand. Any chance to use a pre-existing AMI instead? Or can we install Docker on the fly? In case we want to host this AMI: Can you provide a built script (Packer?)? |
@Tiduster Could you please share the PAcker scripts to build the AMI? Would be a good idea to have them available and/or publish an AMI here. |
…utama09/terraform-aws-gitlab-runner into add_gitlab_docker_autoscaler
Why do we have the |
@Tiduster, @mmoutama09 How do I set all the Docker options ( EDIT: Docker works via old Docker options. |
Hm, tried again with version 1.0.0 of the plugin. Still have the connection issue described above.
Checked the security groups and did a EDIT: Not sure how this is internally working. I tried sending a temporary key and login with that one. Still no success.
AMI is amazon/al2023-ami-ecs-hvm-2023.0.20240723-kernel-6.1-x86_64 |
It uses EC2 connect in the background, as visible in the recommended IAM Policy: https://gitlab.com/gitlab-org/fleeting/plugins/aws#recommended-iam-policy We didn't have this issue on our side, maybe something is missing in the module. We can fix it monday :-) . |
After more testing, the ECS official AMI is just not compatible. We didn't dive too much, because as it's not working out of the box, using this AMI is useless in our use case :-( . We DO NOT have this issue with a simple custom AMI pre-installed with docker, using Ubuntu or Amazon Linux 2023. Unfortunately, baking a custom AMI is once again mandatory. |
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.
@Tiduster @mmoutama09 Thanks for adding this function to the project. Great job!
To be merged now. Before the release I will do a last check. Everything is working out of the box. Provisioning new machines seems to be 25% faster. I love it! |
🤖 I have created a release *beep* *boop* --- ## [7.11.0](7.10.0...7.11.0) (2024-08-03) ### Features * add docker autoscaler executor ([#1118](#1118)) ([8aaad0c](8aaad0c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: cattle-ops-releaser-2[bot] <134548870+cattle-ops-releaser-2[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Thanks for all the fixes. Hopefully it has less bug than docker+machine ^^· |
Description
Provides a new executor using the new GitLab autoscaler executor. I've been using the fleeting plugin for AWS only.
Prerequisite: Docker must already be installed on the AMI used by worker machines (the Docker autoscaler does not install it, unlike the Docker machine). Additionally, the user used to connect to the workers must also be added to the Docker group.
Related to issue #624
Verification
Built an AMI with Docker based on Amazon Linux 2023. Set up the new executor according to the example. Works!