Summary
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
Related
Migrated from spore-host/spore-host#323 — spawn issues belong on this repo.
Summary
spawn launchvalidates 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 groupsThe 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.smallcan'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:
2. Constraints to check pre-flight
--mpiPlacementGroupInfo.SupportedStrategies--efaNetworkInfo.EfaSupported--hibernateHibernationSupported--spotInstanceStorageSupported(+ spot availability)3. Implementation
DescribeInstanceTypesfor the requested instance type (one API call)4. Suggestions
When a constraint isn't met, offer 2-3 alternatives from the same size class:
t3.small→ suggestc5.large(cheapest with placement group support)Related
spawn launch --mpiMigrated from spore-host/spore-host#323 — spawn issues belong on this repo.