Skip to content

Dynamic instance requirements produce invalid EC2 Fleet overrides #5315

Closed

Description

@slavab89

Problem

Dynamic EC2 labels can populate InstanceRequirements so a workflow can request a CPU and memory shape while EC2 Fleet chooses among multiple eligible instance families.

generateFleetOverrides currently iterates the statically configured instance types and adds an InstanceType to every override before spreading the dynamic override configuration. When dynamic labels provide InstanceRequirements, each resulting Fleet override contains both fields.

AWS requires InstanceType and InstanceRequirements to be mutually exclusive within an override, so CreateFleet rejects the request. The labels parse successfully, but no runner launches.

Expected behavior

  • Fixed instance selection should continue to produce one override per subnet and configured instance type.
  • Attribute-based selection should produce one InstanceRequirements-only override per subnet, allowing Fleet to choose an eligible type.
  • A request that explicitly contains both selection modes should fail before calling AWS.

Reproduction

Enable dynamic labels and submit a job with valid vCPU and memory requirement labels, for example:

runs-on:
  - self-hosted
  - <base-runner-labels>
  - ghr-ec2-vcpu-count-min:4
  - ghr-ec2-vcpu-count-max:4
  - ghr-ec2-memory-mib-min:8192
  - ghr-ec2-memory-mib-max:8192

The generated Fleet override combines a static InstanceType with the parsed InstanceRequirements, resulting in an invalid request.

Additional validation

A requirements-only Spot Fleet request using the same launch-template boundary was accepted by AWS and selected an eligible instance family, confirming that omitting the static InstanceType is the required request shape.

Activity

  1. added a commit that references this issue on Sep 8, 2026
    4f80654
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions