Repository navigation
fix(cli): --type-id sends no gpu_count; volumes list reads the API's shape; create needs a region - #14
Merged
Conversation
…shape; create needs a region instances create (and schedule create, which shares buildInstanceRequest) sent gpu_count 1 beside --type-id, because --gpu-count defaults to 1. The server refuses a gpu_count that differs from the type's own, so CPU types (0 GPUs) and every 2, 4 or 8 GPU type failed with a 400. With --type-id a count is now sent only when the user gave one (the flag or the colon form). RUN-2478. volumes list read size_gb and cost_per_hour; the API answers sizeGb (its OpenAPI StorageVolume) and no cost, so every volume showed 0 GB and $0.0000, and the region as its id (582 for Wasabi EU West 1). It now reads sizeGb, shows the region's name from `volumes regions` (the id when the lookup fails or the volume holds an older region name) and drops the cost column. volumes create refuses a missing --region before signing in: the API requires it. RUN-2479.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Torque (a customer, through Neo) hit three CLI bugs, checked against the server (runcrate_app main 6f7780813) and fixed here. Linear RUN-2478 and RUN-2479. The server is right on all three: the check in provisioning.ts is deliberate and the OpenAPI documents the response shape.
1.
instances create --type-idalways sentgpu_count: 1(RUN-2478)--gpu-countdefaults to 1 andCreateInstanceRequest.GPUCountisomitempty, but 1 is not empty. The server refuses agpu_countbesideinstance_type_idthat differs from the type's own (Instance type "..." has 0 GPUs, but gpu_count is 1), so a CPU type (0 GPUs) and every 2, 4 or 8 GPU type failed with a 400; only 1-GPU types worked.buildInstanceRequestnow sends no count with--type-idunless the user gave one (--gpu-countor the colon form--gpu H100:2).schedule createshares the function, so it is fixed too. The--gpu H100:8auto-pick path is unchanged.2.
volumes listshowed 0 GB, a region id and $0.0000 (RUN-2479)GET /api/v1/storage answers camelCase (
sizeGb,createdAt) and the region as its id (OpenAPIStorageVolume:regionis "the id of the region the volume was created in, one of GET /storage/regions"); it has no cost field. The CLI struct readsize_gb,cost_per_hour,mount_path,created_at.sizeGbandcreatedAt; dropsmount_pathand the cost column (the API never sent them).volumes regions(582 iseu-west-1); a failed lookup, or an older volume that holds a region name, shows the value as it is.--jsonnow carries the API's keys (sizeGb,createdAt), as the other commands do.3.
volumes createwithout--regionThe API requires it (
Missing required fields: name, size_gb, region) but the flag looked optional. It is now said to be required, and the command refuses before signing in or sending anything. The "created" line prints the region the user gave, not the id the API answers with.Tests
internal/api/storage_test.go: decodes the list exactly as the server sends it (fails on the old struct:SizeGB = 0).internal/commands/instances_test.go: a type id alone sends no count; with--gpu-count 8it sends 8; with--gpu H100:2it sends 2; auto-deploy without a count is 1; colon form 4 (the first fails on the old code:GPUCount = 1, want 0).internal/commands/storage_test.go:regionLabel(id to name, older name kept, unknown id kept, no regions) and create refusing a missing region.go vet,go test ./...green. Smoke: the built binary prints the region error without a login.Not in this PR (noticed): the
volumes listtable has no ID column, thoughinstances create --volumesays to take the id from it;--jsonshows it.