Skip to content

feat(create): add --disk-size flag - #439

Open
theFong wants to merge 2 commits into
mainfrom
codex/fix-create-disk-size
Open

feat(create): add --disk-size flag#439
theFong wants to merge 2 commits into
mainfrom
codex/fix-create-disk-size

Conversation

@theFong

@theFong theFong commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • add a --disk-size <GB> flag to brev create
  • apply the requested size to every resolved fallback instance type
  • allow an explicit disk size to override launchable storage defaults
  • reject zero, negative, NaN, and infinite disk sizes
  • preserve fractional sizes in create requests and dry-run output

Why

The create API already accepts diskStorage, and search/piped workflows already populate InstanceSpec.DiskGB. However, explicitly selected instance types were created with DiskGB: 0, so agents and users had no direct way to request variable storage while using --type.

Impact

Agents can now deploy a GPU with provider-supported variable storage directly:

brev create my-gpu --type g5.xlarge --disk-size 1000

The value is sent to the create API as a Gi quantity. Provider-side storage constraints continue to determine which sizes are supported.

Validation

  • go build ./...
  • go test ./pkg/cmd/gpucreate
  • go test -race ./pkg/cmd/gpucreate
  • go vet ./pkg/cmd/gpucreate
  • golangci-lint run ./pkg/cmd/gpucreate

Closes #380.

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.07%. Comparing base (17ccd79) to head (57691c4).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cmd/gpucreate/gpucreate.go 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #439      +/-   ##
==========================================
+ Coverage   24.67%   26.07%   +1.40%     
==========================================
  Files         134      135       +1     
  Lines       18337    18620     +283     
==========================================
+ Hits         4525     4856     +331     
+ Misses      13335    13259      -76     
- Partials      477      505      +28     
Flag Coverage Δ
Linux 26.07% <88.88%> (+1.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@theFong
theFong marked this pull request as ready for review August 22, 2026 21:34
@theFong
theFong requested a review from a team as a code owner August 22, 2026 21:34
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.

Honor --min-disk when paired with --type in brev create

1 participant