-
-
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 idle_count_min and
idle_scale_factor` to Docker Machine autoscaling options
#711
feat!: add idle_count_min and
idle_scale_factor` to Docker Machine autoscaling options
#711
Conversation
Hey @tmeijn! 👋 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 have the rights of the code added and agree that it will published under the MIT license. This message was generated automatically. You are welcome to improve it. |
Hey @npalm, @kayman-mk, this PR is totally not ready, but wanted to get yall's opinion on whether you think this is even an acceptable or desired direction to go in. Played around with it a bit and Produces and |
Can you set the PR in "draft" as long it is not ready? |
…into feat/switch-to-free-form-scaling-config
## Description Removes the earlier deprecated `runners_pull_policy` variable. Since were making a Major release I thought this one was nice to catch. ## Migrations required YES. Replace the `runners_pull_policy` by `runners_pull_policies`.
…aws-gitlab-runner into feat/switch-to-free-form-scaling-config
Makes sense to me to support the new settings. But I suggest to use |
1bbbea3
to
a2f0c60
Compare
Yeah this is because the naming convention in the |
## Description Removes the earlier deprecated `runners_pull_policy` variable. Since were making a Major release I thought this one was nice to catch. ## Migrations required YES. Replace the `runners_pull_policy` by `runners_pull_policies`.
a2f0c60
to
3cde0f1
Compare
I am good to go with the naming and add an action to the unit test as the names from the variables are copied 1:1 to the configuration file. |
@kayman-mk I was actually thinking to write a conversion from snake_case to CamelCase, sorry didn't make that intent clear in my previous comment. Do you think that would be better? |
I really appreciate such a converter, but I guess it complicates the code as there is no function available in Terraform. The related issue hashicorp/terraform#25230 is still open for a while. I think it is better to leave the code as it is now and add some unit tests. Gosh, I have to get #632 ready now. |
Hey @kayman-mk I just tried it, see c3cf08c. I personally don't find it too complex looking and if it helps you with the testing I'm happy to implement it like this, but I'll let you decide what you would prefer based on this example. |
## Description This PR removes all variables which are marked as deprecated. - `arn_format` - `subnet_id_runners` - `subnet_ids_gitlab_runner` - `asg_terminate_lifecycle_hook_create` - `asg_terminate_lifecycle_hook_heartbeat_timeout` - `asg_terminate_lifecycle_lambda_memory_size` - `asg_terminate_lifecycle_lambda_runtime` - `asg_terminate_lifecycle_lambda_timeout` ## Migrations required Yes. Remove the variables from your configuration. This is done automatically by the migration script. ## Verification None. --------- Co-authored-by: Tyrone Meijn <[email protected]>
…aws-gitlab-runner into feat/switch-to-free-form-scaling-config
@kayman-mk I think this PR is ready for review. I do not know what's up with the |
@tmeijn KICS is reporting problems. Please fix them. Lint PR title: Works for me, I guess because I am a member of Could you please enhance this script and add a conversion for your renaming? |
@kayman-mk Regarding the KICS errors, I see you already fixed them in #755, so I think once that is merged the errors reported here will automatically resolve. Regarding the PR lint: it did seem to work in my first contribution I made at least: https://github.com/cattle-ops/terraform-aws-gitlab-runner/pull/705/checks#step:2:1 |
## Description Removes the earlier deprecated `runners_pull_policy` variable. Since were making a Major release I thought this one was nice to catch. ## Migrations required YES. Replace the `runners_pull_policy` by `runners_pull_policies`.
## Description This PR removes all variables which are marked as deprecated. - `arn_format` - `subnet_id_runners` - `subnet_ids_gitlab_runner` - `asg_terminate_lifecycle_hook_create` - `asg_terminate_lifecycle_hook_heartbeat_timeout` - `asg_terminate_lifecycle_lambda_memory_size` - `asg_terminate_lifecycle_lambda_runtime` - `asg_terminate_lifecycle_lambda_timeout` ## Migrations required Yes. Remove the variables from your configuration. This is done automatically by the migration script. ## Verification None. --------- Co-authored-by: Tyrone Meijn <[email protected]>
3fdd3c5
to
c78907a
Compare
The PR linter is failing since the fork have no access to the write token used in the workflow. |
c78907a
to
93657e6
Compare
and
idle_scale_factor` to Docker Machine autoscaling options
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.
Thanks for your work!
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
…autoscaling options (#711) ## Description Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for. Adds `idle_scale_factor` and `idle_count_min` Docker Machine options. See [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"). ## Migrations required YES - users will have to change the input name from `runners_machine_autoscaling` to `runners_machine_autoscaling_options`. No other changes should be needed, we just support _more_ options. A migration script is available. ## Verification No input given: (end of rendered `config.toml`) ![image](https://user-images.githubusercontent.com/17970041/225890782-02fe4adc-4c6a-4237-9752-a64349464113.png) Input: ```hcl runners_machine_autoscaling_options = [ { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_count_min = 10 idle_time = 3600 timezone = "UTC" idle_scale_factor = 1.5 }, { periods = ["* * 9-17 * * mon-fri *", "* * 9-17 * * mon-fri *"] idle_count = 50 idle_time = 3600 timezone = "Europe/Amsterdam" } ] ``` Rendered `config.toml`: ![image](https://user-images.githubusercontent.com/17970041/225891085-add03ee8-3943-4c56-96a4-d1a8c252deb0.png) Apply results: ![image](https://user-images.githubusercontent.com/17970041/225893020-a9850486-4aa6-4eb0-b996-558ec7bccfea.png) Closes #556 --------- Co-authored-by: Matthias Kay <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [7.0.0](6.5.2...7.0.0) (2023-09-09) ### ⚠ BREAKING CHANGES * group variables for better overview ([#810](#810)) * allow to set all docker options for the Executor ([#511](#511)) * add idle_count_min` and `idle_scale_factor` to Docker Machine autoscaling options ([#711](#711)) * remove deprecated variables ([#738](#738)) * remove deprecated pull policy variable ([#710](#710)) ### Features * add idle_count_min` and `idle_scale_factor` to Docker Machine autoscaling options ([#711](#711)) ([1538d48](1538d48)) * allow to set all docker options for the Executor ([#511](#511)) ([461561e](461561e)) ### Bug Fixes * add missing defaults ([#905](#905)) ([eb44182](eb44182)) * correct the bugs of major version 7 (pre-release) ([#860](#860)) ([f236b58](f236b58)) * remove deprecated pull policy variable ([#710](#710)) ([8736ec7](8736ec7)) ### Miscellaneous Chores * remove deprecated variables ([#738](#738)) ([676ed6a](676ed6a)) ### Code Refactoring * group variables for better overview ([#810](#810)) ([c8a3b89](c8a3b89)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: Niek Palm <[email protected]> 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>
Description
Switches from hardcoded options to free-from scaling configuration. This reduces the module complexity by allowing to get rid of a number of variables while giving more control to the user to define their options without us having to build support into it for.
Adds
idle_scale_factor
andidle_count_min
Docker Machine options. See documentation.Migrations required
YES - users will have to change the input name from
runners_machine_autoscaling
torunners_machine_autoscaling_options
. No other changes should be needed, we just support more options. A migration script is available.Verification
No input given:
(end of rendered
config.toml
)Input:
Rendered
config.toml
:Apply results:
Closes #556