fix(runners): support instance requirements in EC2 Fleet overrides - #5314
Conversation
3fa6f25 to
80fccdb
Compare
|
@slavab89 Once this error is raised, it will pass along to this call Shouldn't the message be discard? |
80fccdb to
1c40276
Compare
|
@edersonbrilhante Good point. Addressed in 1c40276. Invalid runner-label configurations now raise a typed InvalidRunnerLabelsError. The control-plane catches only that error at the per-label-group boundary and skips the group without adding its message IDs to batchItemFailures, so SQS acknowledges and discards those messages. Other label-resolution errors still propagate and retry. I also added a mixed-batch regression test proving an invalid group is discarded while a valid group continues to launch. |
edersonbrilhante
left a comment
There was a problem hiding this comment.
@slavab89 Good work.
Description
Dynamic EC2 labels allow a workflow to request attribute-based instance selection using
InstanceRequirements. This is useful when a workload needs a specific CPU and memory shape while allowing EC2 Fleet to choose among several eligible instance families for Spot capacity.Today,
generateFleetOverridescombines every configured staticInstanceTypewith the dynamicInstanceRequirementsobject. AWS treats these fields as mutually exclusive within one Fleet override, soCreateFleetrejects the request. The dynamic labels parse successfully, but no runner can launch.This change gives the two selection modes separate request paths:
InstanceRequirements-only override per subnet, allowing EC2 Fleet to choose from the eligible families.InstanceTypeandInstanceRequirementsare rejected before an AWS request is sent.Existing fixed-instance behavior is unchanged.
Test Plan
InstanceType.CreateFleetrequest.git diff --check.Validated the request against AWS using a temporary launch template without runner userdata or an IAM profile. A requirements-only Spot Fleet request for 4 vCPU / 8 GiB across several allowed compute families completed successfully and selected
c7i-flex.xlargewith no Fleet errors. The instance and temporary launch template were deleted afterward.The project typecheck currently reports existing Vitest 4 configuration errors in untouched configuration files. Those unrelated formatting and type changes are intentionally excluded from this PR.
Related Issues
Fixes #5315. Related to #1400 and follows the dynamic EC2 label support introduced in #5003.