Skip to content
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

BlockDurationMinutes is not a valid parameter #3

Closed
jimsmith opened this issue Aug 27, 2021 · 2 comments
Closed

BlockDurationMinutes is not a valid parameter #3

jimsmith opened this issue Aug 27, 2021 · 2 comments

Comments

@jimsmith
Copy link

jimsmith commented Aug 27, 2021

Gitlab runner errors because of this amazonec2-block-duration-minutes

Which prevents it from launching a spot instance.

Error in logs:

Aug 27 17:33:17 ip-10-200-29-136 gitlab-runner: #033[31;1mERROR: Error creating machine: Error in driver during machine creation: Error request spot instance: InvalidParameterValue: BlockDurationMinutes is not a valid parameter.#033[0;m  #033[31;1mdriver#033[0;m=amazonec2 #033[31;1mname#033[0;m=runner-cymmmn5c-auto-scale-1630085593-79a7822a #033[31;1moperation#033[0;m=create

The offending line is "amazonec2-block-duration-minutes=${spot_block_duration}",
https://github.com/aleks-fofanov/terraform-gitlab-runner-aws-spot/blob/master/templates/gitlab.runner.config.template.toml#L50

After removing this manually from the manager EC2 instance /etc/gitlab-runner/config.toml spot instances launch and no error.

From AWS Documentation: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html

BlockDurationMinutes
Deprecated.

Type: Integer

Required: No

Attempting to comment out spot_block_duration the below message is given back:

 The given value is not suitable for child module variable "runner" defined at .terraform/modules/runner/variables.tf:102,1-18: attributes "spot_block_duration" are required.

Supporting documentation depreciation notice:
docker/machine#4893

Will this be fixed anytime soon as doing manual editing in the manager instance isn't practical and for repeatability this isn't possible.

@aleks-fofanov
Copy link
Owner

Thanks for bringing this up @jimsmith .

This is addressed in #4 . Just pin your module to 2.2.0 and set spot_block_duration = 0 in the runner config object and amazonec2-block-duration-minutes param won't be included in the docker machine config.

To allow other customers which still can use block duration parameter I decided to make this parameter optional instead of removing it. Let me please know if that helps so I can close the issue.
Thank you.

@jimsmith
Copy link
Author

jimsmith commented Aug 31, 2021

@aleks-fofanov thanks for that, that indeed helps and works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants