Commit 272bf99
authored
feat(create): add gpu-create command with retry and fallback logic (#281)
* feat(create): add gpu-create command with retry and fallback logic
Add `brev create` command (aliases: provision, gpu-create) to create GPU
instances with automatic retry across multiple instance types.
Features:
- Smart defaults: auto-selects cheapest GPU meeting minimum specs
- Fallback chain: tries each type until all instances succeed
- Startup scripts: inline or @filepath syntax
- Parallel creation: --parallel flag for faster cluster creation
- Pipeable: reads types from stdin, outputs instance names
Examples:
brev create my-instance
brev search --gpu-name A100 | brev create my-box
brev create my-cluster --count 3 --type g5.xlarge
brev create my-instance --startup-script @setup.sh
* style: fix gofumpt formatting in workspace.go
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(cmd): remove duplicate create command from help output
* feat(create): add search filter flags to create command
Allow users to filter GPU instances directly in create (e.g. brev create
my-instance -g a100) instead of piping from brev search. Adds 12 filter
flags matching search: --gpu-name, --provider, --min-vram, --min-total-vram,
--min-capability, --min-disk, --max-boot-time, --stoppable, --rebootable,
--flex-ports, --sort, --desc. Defaults are preserved when no filters set.
* feat(create): add --dry-run flag to preview matching instance types
* refactor(create): simplify gpucreate with shared utilities and reduced duplication
- Deduplicate isStdoutPiped() by exporting from gpusearch
- Convert createWorkspaceWithType to createContext method (8 params → 2)
- Convert pollUntilReady to createContext method (6 params → 1)
- Add colorize() helper to eliminate piped-vs-colored branching
- Extract registerCreateFlags to fix funlen lint violation
- Wrap external DisplayResults error to fix wrapcheck lint
- Fix test to call parseTableInput directly instead of reimplementing
- Trim help examples from 15+ to 6 focused patterns
- Simplify resolveWorkspaceUserOptions branching
---------1 parent a53c504 commit 272bf99
5 files changed
Lines changed: 1292 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
275 | 276 | | |
276 | 277 | | |
277 | 278 | | |
| |||
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
286 | | - | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
0 commit comments