Skip to content

fleet coord hosts: name each override's instance type in CreateFleet - #1328

Merged
ejc3 merged 1 commit into
mainfrom
fix/create-fleet-instance-type
Oct 26, 2026
Merged

ejc3 merged 1 commit into
mainfrom
fix/create-fleet-instance-type

Conversation

@ejc3

@ejc3 ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Every GPU host launch on staging was refused, so the fcvm half of the wall had no hosts after the host auto scaling groups were removed (#1282).

CreateFleet: UnauthorizedOperation: ... not authorized to perform: ec2:CreateFleet on resource:
arn:aws:ec2:us-east-1:<account>:instance/* with an explicit deny in an identity-based policy

The decoded authorization message names the coordinator role's FleetTypesOnly statement (deny ec2:CreateFleet on instance/* unless ec2:InstanceType is a fleet type) and its request context has no ec2:InstanceType key: for CreateFleet, IAM takes the type only from the request, not from the launch template.

Change

  • AwsHosts reads each host template's instance type from its latest version (DescribeLaunchTemplateVersions, allowed by the role's ec2:Describe*) and reuses it for 5 minutes.
  • create_fleet_params takes (template, type) pairs and sets LaunchTemplateConfigs.N.Overrides.M.InstanceType on every override.
  • The fake EC2 in tests/test_fleet_coord.rs refuses a CreateFleet whose override names no host type with 403 UnauthorizedOperation, as IAM does.

Tests

the_aws_host_driver_launches_through_an_instant_fleet fails on the previous hosts.rs (panicked at tests/test_fleet_coord.rs:3490, the spot launch is refused) and passes with this change; create_fleet_asks_for_the_market_over_every_template_and_subnet checks the override types. make lint passes.

On staging every GPU host launch was refused: CreateFleet: UnauthorizedOperation,
explicit deny by the coordinator role's FleetTypesOnly statement, which denies
ec2:CreateFleet on instance/* unless ec2:InstanceType is a fleet type. For
CreateFleet IAM takes ec2:InstanceType only from the request; the launch
template's type is not in the request context (the decoded authorization
message carried no ec2:InstanceType key), so the key was absent and the deny
applied. The fcvm half of the wall had no hosts after the auto scaling groups
were removed.

- AwsHosts reads each host template's instance type from its latest version
  (DescribeLaunchTemplateVersions, covered by the role's ec2:Describe*) and
  reuses it for 5 minutes.
- create_fleet_params takes (template, type) pairs and sets
  LaunchTemplateConfigs.N.Overrides.M.InstanceType on every override.
- The fake EC2 in tests/test_fleet_coord.rs refuses a CreateFleet whose
  override names no host type with 403 UnauthorizedOperation, as IAM does.

Test: the_aws_host_driver_launches_through_an_instant_fleet fails on the
previous hosts.rs (the launch is refused) and passes with this change.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T04:26:56.767697Z 1dbd329 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 45056eee-6741-48b4-b5b6-20d9d4545908
Commits

Reviewing files that changed from the base of the PR and between 2bd9b3d and 1dbd329.

Files selected for processing: 2
  • src/fleet/coord/hosts.rs
  • tests/test_fleet_coord.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

Local review of 1dbd329 (git diff origin/main..1dbd329c), command codex exec -s read-only over that diff. One finding:

  • P2, hosts.rs launch: a CreateFleet retry after a lost answer could carry a different InstanceType with the same ClientToken if the template's type changed and the cache expired in between, giving IdempotentParameterMismatch and a stuck region.

DISAGREE: not blocking; it needs a lost CreateFleet answer and a host template type change inside the same retry window, and without this PR every launch is refused. Tracked in #1329.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 1dbd329c1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ejc3 ejc3 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DISAGREE: not blocking; the retry mismatch needs a lost CreateFleet answer and a template type change in the same window, while without this PR every host launch is refused. Tracked in #1329.

@ejc3
ejc3 merged commit 24deb91 into main Oct 26, 2026
7 of 15 checks passed
@ejc3
ejc3 deleted the fix/create-fleet-instance-type branch October 26, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant