You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A feature request: The possibility to specify secondary instance type in case of "There is no Spot capacity available that matches your request", code: 'InsufficientInstanceCapacity' error.
I think we could have a fallback launch template with another instance type or overwrite InstanceType in the current launch template in case if AWS answers with 'InsufficientInstanceCapacity' error.
Reacted by Mitko Tschimev, Oliver Schlegel, Andreas Diesner, Manuel Heim and Rob Reid
I really like the idea. I don't think the implementation will work because we use EC2 Launch Templates. As far as I know the Launch Templates options and the instance type options do not mix in the runInstances call.
According to the documentation -
"LaunchTemplate — (map) -
The launch template to use to launch the instances. Any parameters that you specify in RunInstances override the same parameters in the launch template."
So there is a chance that it could work in this way. But the second launch template could also work fine.
Also, there is a more robust solution with spot fleet requests. But that requires a lot of changes.
Activity
MitkoTschimev commentedon Feb 21, 2021
Yes, we had the same issue and our idea was to do the same. Is someone already working on it?
Kostiantyn-Vorobiov commentedon Feb 22, 2021
Here is a WIP for this idea - Kostiantyn-Vorobiov#1 (haven't tested in the real environment)
Any thoughts? I'm not a TS guy @gertjanmaas, @npalm
gertjanmaas commentedon Feb 23, 2021
Hi @Kostiantyn-Vorobiov.
I really like the idea. I don't think the implementation will work because we use EC2 Launch Templates. As far as I know the Launch Templates options and the instance type options do not mix in the
runInstancescall.So instead of changing the instance type, we could create a second Launch Template in Terraform and change the
launchTemplateNameandlaunchTemplateVersionto the secondary template on aInsufficientInstanceCapacityerror. See terraform code here: https://github.com/philips-labs/terraform-aws-github-runner/blob/8ed8a8491298d5023f37b207e432e92129183adc/modules/runners/main.tf#L36@npalm how does this sound to you?
Kostiantyn-Vorobiov commentedon Feb 23, 2021
According to the documentation -
"LaunchTemplate — (map) -
The launch template to use to launch the instances. Any parameters that you specify in RunInstances override the same parameters in the launch template."
So there is a chance that it could work in this way. But the second launch template could also work fine.
Also, there is a more robust solution with spot fleet requests. But that requires a lot of changes.
npalm commentedon Feb 24, 2021
In that case overwriting should be the way forward
link to docs: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html
npalm commentedon Feb 24, 2021
@Kostiantyn-Vorobiov feel free to open a draft (WIP) PR
mcaulifn commentedon Jun 15, 2021
This should be resolved by #898
npalm commentedon Dec 2, 2021
Fallback is available