-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Allow non-persistent spot requests #3311
Allow non-persistent spot requests #3311
Conversation
+1 👏 |
Cool! If I'm understanding this correctly, then requests created with a For your CI use-case, are you just using Terraform to create a fresh request and then discarding the terraform state and letting the resources clean up themselves? Does |
@apparentlymart yes, for example, if I terminate the machine created from a spot request of type So, what I want to do is:
Every time I run terraform for this manner, I remove the tf state file so it would not mess with the last resource. This way, I can easily scale the workers not spending too much money.
Exactly.
I don't know, I'm just testing all this stuff right now, so I closed the spot request myself. |
Could you test the behavior of Of course this doesn't really matter for your workflow since you're never going to try to destroy a spot request, but it'd be good for it to behave in a consistent manner so that users with other usage patterns don't find themselves stuck with an un-destroyable resource if their instance happens to terminate before they destroy it with Terraform. |
@apparentlymart OK, I did two tests:
Both cases worked as expected. |
Awesome! Thanks for indulging me. 😄 |
@apparentlymart haha, no problem 🍻 |
@radeksimko any updates on this? |
LGTM 🚢 |
…ests Allow non-persistent spot requests
Merging this resulted in a failed build but it appears to be caused by Azure/azure-sdk-for-go#225 rather than anything in this changeset. |
@apparentlymart thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Where I work we are using terraform to scale our CI workers, with spot instances. The workers will shutdown after some time of inactivity, and the instance shutdown behavior is set to terminate.
But, since terraform forces us to create the spot request as persistent, when we shut the instance down and terminate it, another instance will be launched, so, we can't automatically scale down.
Note that we don't use terraform to manage those instances, just to launch them.
This change should enable us to do that.
I also updated docs.
Thanks!