Skip to content

fcvm-fleet: a pool of stopped EC2 tiles the coordinator starts at a wake - #674

Merged
ejc3 merged 4 commits into
mainfrom
fcvm-fleet-tile-pool
Oct 26, 2026
Merged

ejc3 merged 4 commits into
mainfrom
fcvm-fleet-tile-pool

Conversation

@ejc3

@ejc3 ejc3 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Draft until ejc3/fcvm#1273 is on main and the staging coordinator image has --ec2-pool. The arguments this adds would stop an older coordinator (an unknown flag). Then mark ready for the jumpbox.

Why

Every wake launches the 8 EC2 tiles from scratch: 43 to 52 s from launch to ready on staging (2026-10-25), and the viewer's first picture waits for them. Measured on g4dn.xlarge from the current tile AMI (request to /health reporting ready with a frame drawn):

cold launch started from stopped
on demand 81.5 s 17.5 s, 17.2 s
persistent spot, stop on interruption 84.0 s 15.5 s, 15.6 s

g4dn does not support hibernation, and Auto Scaling warm pools take no spot instances, so the coordinator keeps its own pool (ejc3/fcvm#1273).

What changes

  • modules/fcvm-fleet-region: launch template fcvm-fleet-tile-pool-<arch>, the spot tile with a persistent request that stops on interruption; its spot request is tagged Purpose=fcvm-fleet-tile. Added to tile_template_arns, which limits the coordinator's RunInstances.
  • Coordinator role: StartInstances/StopInstances and CreateTags/DeleteTags (tag keys FleetPool, FleetTile only) on instances tagged Purpose=fcvm-fleet-tile; CancelSpotInstanceRequests on requests so tagged. The coordinator cancels a persistent request before terminating its instance, or the request launches a replacement.
  • Coordinator arguments --ec2-pool 8 --ec2-pool-template fcvm-fleet-tile-pool-x86_64 behind local.fcvm_fleet_tile_pool.

Cost

8 stopped 32 GB gp3 root volumes: $20.48 a month. No Elastic IPs: a started tile gets a new public address, which the coordinator names in DNS as for a launch. Tiles stay spot while running.

Tested

python3 scripts/test-fcvm-fleet.py: 39 tests OK, 3 new (TilePool). terraform fmt. Not run: terraform validate (this box has Terraform 1.16.6; main.tf pins 1.10.3).

Trial after apply

One wake on staging with the pool warm (a sleep first fills it): the coordinator logs tile resumed from the pool and tile ready per tile (ejc3/fcvm#1261 adds the latter); expected ready about 15 to 20 s after the wake instead of 43 to 52 s.

Part of ejc3/fcvm#1257.

The coordinator in ejc3/fcvm#1273 keeps its EC2 tiles stopped between wakes (--ec2-pool)
and starts them at the next one instead of launching: on g4dn.xlarge from the tile AMI a
stopped tile reached its first frame in 15.5 s (persistent spot) against 81 to 84 s for a
launch (2026-10-25). g4dn has no hibernation and Auto Scaling warm pools take no spot.

- modules/fcvm-fleet-region: launch template fcvm-fleet-tile-pool-<arch>, the spot tile
  with a persistent request that stops on interruption, its spot request tagged
  Purpose=fcvm-fleet-tile; in tile_template_arns, so RunInstances may use it.
- The coordinator's role: StartInstances/StopInstances and CreateTags/DeleteTags (keys
  FleetPool and FleetTile only) on instances tagged Purpose=fcvm-fleet-tile, and
  CancelSpotInstanceRequests on requests so tagged (a persistent request launches a
  replacement when its instance is terminated, so the coordinator cancels it first).
- Coordinator arguments --ec2-pool 8 --ec2-pool-template fcvm-fleet-tile-pool-x86_64
  behind local.fcvm_fleet_tile_pool.

Standing cost: 8 stopped 32 GB gp3 root volumes, $20.48 a month; no Elastic IPs.

Tested: python3 scripts/test-fcvm-fleet.py (39 tests OK, 3 new), terraform fmt.
terraform validate was not run here: this box has 1.16.6 and main.tf pins 1.10.3.
@coderabbitai

coderabbitai Bot commented Oct 25, 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 47 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: 0bc65495-814d-40df-8b9d-7d9e563a39d6
Commits

Reviewing files that changed from the base of the PR and between fd977d3 and 4b6224c.

Files selected for processing: 3
  • fcvm-fleet.tf
  • modules/fcvm-fleet-region/main.tf
  • scripts/test-fcvm-fleet.py
  • 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.

@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-26T02:50:07.530130Z 4b6224c Manual request
🔒 Security Review ✅ Completed 2026-10-26T02:50:48.944248Z 4b6224c 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

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 10b0cd9179

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 10b0cd9179

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

Fixed the persistent Spot request authorization: tagged spot-request resources have their own region/Purpose grant, while instance, volume, ENI, AMI, subnet and template restrictions remain. Independent code/security review passed; 39 focused tests and 11 read-only IAM simulations passed, including 7 deny cases. Updated against current main.

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@codex security review

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@greptileai review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 10c9c89534

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 10c9c89534

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@codex security review

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ejc3

ejc3 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

@greptileai review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 4b6224c3e5

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4b6224c3e5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ejc3
ejc3 merged commit 7124f6e into main Oct 26, 2026
3 checks passed
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