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(spawn): validate instance type constraints before launch — EFA, placement groups, hibernation #110
spawn launch validates some instance type constraints at launch time but produces cryptic errors. The UX should be proactive: validate constraints upfront and suggest alternatives.
Current behavior
$ spawn launch my-cluster --instance-type t3.small --mpi
...setting up IAM role...
...creating security group...
Error: placement group validation: instance type t3.small does not support cluster placement groups
The error fires after several AWS API calls have already been made (IAM role, security group created). The user has no way to know in advance that t3.small can't be used with --mpi.
Proposed behavior
1. Pre-flight constraint check
Before making any AWS API calls, validate that the requested instance type supports the requested features:
$ spawn launch my-cluster --instance-type t3.small --mpi
Error: t3.small does not support cluster placement groups (required for --mpi).
Suggested alternatives: c5.large, c5n.large, c5.xlarge
Run: truffle search "c5*" --placement-group to see all options.
2. Constraints to check pre-flight
Flag
Constraint
EC2 API field
--mpi
placement group: cluster
PlacementGroupInfo.SupportedStrategies
--efa
EFA supported
NetworkInfo.EfaSupported
--hibernate
hibernation supported
HibernationSupported
--spot
spot supported
InstanceStorageSupported (+ spot availability)
3. Implementation
Call DescribeInstanceTypes for the requested instance type (one API call)
Check relevant fields against the requested flags
If constraints aren't met, fail fast with suggestions
Cache results to avoid repeated API calls when launching arrays
4. Suggestions
When a constraint isn't met, offer 2-3 alternatives from the same size class:
t3.small → suggest c5.large (cheapest with placement group support)
Use truffle's instance metadata for the suggestions
Activity
fix: spawn quick-wins #103 #104 #108 #110 (truffle-backed validation) (…
scttfrdmn commentedon Jun 12, 2026
Fixed in #111 (merged). spawn now sources instance-type capabilities from truffle (GetCapabilities).
fix(launch): --estimate-only runs constraint validation (true dry-run) (