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
{{ message }}
Repository navigation
feat(dynamic-labels): add a capacity-type label to choose spot or on-demand per job #5484
The capacity type (spot or on-demand) of a runner pool is fixed by instance_target_capacity_type. A workflow job cannot choose it. With dynamic labels enabled, a job can already pick the instance type, price, placement and more, but not spot versus on-demand.
Problem
Today the only option is a separate pool for each capacity type. This means duplicated Lambdas and configuration for the same instance types, only to change one setting. The topic came up before in #4138, where dynamic labels were mentioned as the direction.
The value overrides INSTANCE_TARGET_CAPACITY_TYPE for the runner created for that job.
Only spot and on-demand are accepted. Any other value raises InvalidRunnerLabelsError, the existing error for labels that are permanently invalid and must not be retried.
Behavior
Dedicated hosts: the RunInstances path does not support spot. On this path the label is ignored, and a spot value logs a warning. The instance stays on-demand.
On-demand failover: the failover already depends on the capacity type of the request, so no change is needed. A job with spot fails over to on-demand as configured. A job with on-demand never uses the failover.
Max price:ghr-ec2-max-price only applies to spot. For a job with on-demand the value is not passed to the fleet request.
Spot request tags: these tags come from the launch template, which defines them only when the pool default is spot without on-demand failover. Spot requests created for a job that overrides to spot in a pool with another default do not get these tags. The documentation will describe this.
Scope
Parse the new key in the dynamic labels code and pass it to the fleet request.
Unit tests for parsing, an invalid value, the dedicated-host case, the max price with on-demand, and the failover with both values.
Update the label list in docs/configuration.md and in the header comment of dynamic-labels.ts, including a policy example.
Activity
feat(dynamic-labels): add a capacity-type label to choose spot or on-…