-
Notifications
You must be signed in to change notification settings - Fork 29
Fix runner termination in AWS with non cloud regions #344
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
Conversation
|
@DavidGOrtega this should take care of it, I have to set up an AWS acc to really give it whirl if you can try it out against how you were able to reproduce the original error as well? |
|
I will try it |
iterative/utils/helpers.go
Outdated
| ) | ||
|
|
||
| var ( | ||
| SynthRegions = map[string]map[string]string{ |
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.
Not sure about this... I prefer to have the GetRegions implementation per provider. Or should go in the machine... if we were using the machine...
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.
I moved it here because I think there was actually a bug in the subnet-id code after you guys fixed the last one.
See previous:
region := GetRegion(d.Get("region").(string))
availabilityZone := GetAvailabilityZone(region)The get avail func would always get a stripped region and never detect an availability-zone, now it needs to first reference the synth-regions map to eliminate those as a false positive.
Since it need to be referenced in multiple places I went ahead and broke it out / consolidated that helper func across all providers.
… tfstate json" This reverts commit 9e4f51c.
|
after beating my personal AWS account's 2FA (had to dig up an old phone 🔒 ) I tested with the original command from discord and the instance self terminated successfully: |
|
Thanks @dacbd. How did you manage to setup this version of the provider in the cloud instance?
Obviously the first one is easier but the registry is buggy and sometimes the provider breaks and can not be updated and cant be deleted. I have a bunch of them already |
|
@DavidGOrtega you know I didn't actually put much thought into it and now that you mention is I'm not 100% sure it worked properly(using the right one), (but it kinda, since it self-terminated). I modified the cml terraform.js to use a local one and added a git clone/checkout then make && make install into a startup script... Were you able to test it with the latest commit successfully? -- I've put more thought in testing custom cml versions #255 😉 |
|
@dacbd still testing it... Right now I have an issue but it should not be because of this PR think... |
|
I'll try a few more as well |
iterative/utils/helpers.go
Outdated
| "eu-north": "europe-north1-a", | ||
| "eu-west": "europe-west1-d", | ||
| }, | ||
| "az": { |
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.
@dacbd cloud in machine and runner is azure not az
@0x2b3bfa0 we should have maintained the consistency
I do not feel confident to release this without having tested every cloud.
Please @dacbd try to fix it just only for AWS vendor without reaching a wider scope
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.
I mean roll back utils.Get region
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.
@0x2b3bfa0 we should have maintained the consistency
We do, to some extent.
| } else if cloud == "azure" || cloud == "az" { |
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.
@0x2b3bfa0 we should have maintained the consistency
We do, to some extent.
} else if cloud == "azure" || cloud == "az" {
We should support then az in the machine and runner
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.
We do support az in both the machine and runner resources. At least, before merging this pull request.
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.
One should be an alias of the other to avoid issues like this one
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.
Do you mean replacing the value intead of accepting both?
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.
Yes, an alias
This reverts commit 3f1913f.
|
@DavidGOrtega Something like this okay or do you want it more fully reverted back? |
|
I've had good terminations with: |
iterative/utils/helpers.go
Outdated
| ) | ||
|
|
||
| var ( | ||
| AWSSynthRegions = map[string]map[string]string{ |
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.
Given that it's only for AWS, wouldn't it be enough to use a simple map[string]string? Else, should it be named SynthRegions instead?
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.
Indeed probably I would keep it in the AWS provider instead of utils
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.
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.
I can roll it back more, I left it in to inflict my feelings that these region mappings should all be defined in one place.
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.
Probably makes sense to have it in the provider following the same pattern as the others. Also as @0x2b3bfa0 pointed out there is not need to use a matrix
DavidGOrtega
left a comment
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 @dacbd !!! ❤️ |
Uh oh!
There was an error while loading. Please reload this page.