Skip to content

feat(aws): add Capabilities.VCPUs (default vCPU count per instance type) - #134

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/492-export-vcpu-capability
Aug 10, 2026
Merged

feat(aws): add Capabilities.VCPUs (default vCPU count per instance type)#134
scttfrdmn merged 1 commit into
mainfrom
feat/492-export-vcpu-capability

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

  • New Capabilities.VCPUs field, populated from DescribeInstanceTypes' VCpuInfo.DefaultVCpus.
  • Lets a caller convert a per-family vCPU quota (pkg/quotas.QuotaInfo) into an instance-count ceiling using the real EC2 API value, instead of re-implementing pkg/quotas.getVCPUCount's name-based size-suffix parsing — which is already documented (in obtainability.go) as an unreliable fallback for non-linear sizes.
  • Needed by spawn#492 (quota-derived --max-concurrent=auto for the sweep orchestrator), which needs to turn "64 vCPUs of G-family Spot quota" into "8 concurrent g7e.2xlarge" without guessing.

Additive, backward-compatible field on an existing exported struct — no behavior change for existing callers.

Test plan

  • go build ./..., go test ./... (full repo), go vet ./... all green
  • golangci-lint run ./pkg/aws/... — 0 issues
  • make check-fmt, make check-docs, ./scripts/verify-pins.sh all clean
  • Existing TestGetCapabilities_Substrate unaffected (Substrate doesn't model c5n.18xlarge's VCpuInfo, so it can't assert a nonzero value here — verified the field is present and zero-valued when unmodeled, consistent with every other capability bit in that test)

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/aws/client.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Populated from DescribeInstanceTypes' VCpuInfo.DefaultVCpus. Lets a
caller (spawn's sweep orchestrator, spawn#492) convert a per-family
vCPU quota into an instance-count ceiling without re-implementing
pkg/quotas.getVCPUCount's name-based size-suffix parsing, which its
own fallback comment already documents as unreliable for non-linear
sizes (p6-b200.48xlarge, metal sizes).
@scttfrdmn
scttfrdmn force-pushed the feat/492-export-vcpu-capability branch from 3117a40 to bc7c11c Compare August 10, 2026 22:03
@scttfrdmn
scttfrdmn merged commit 7007e26 into main Aug 10, 2026
5 checks passed
@scttfrdmn
scttfrdmn deleted the feat/492-export-vcpu-capability branch August 10, 2026 22:06
scttfrdmn added a commit that referenced this pull request Aug 10, 2026
Promotes Unreleased (Capabilities.VCPUs added in #134, CanLaunch Spot
usage tracking fixed in #133) to 0.49.0 and updates comparison links.
Also removes a stray unresolved merge-conflict marker left in the
Unreleased section by #134's merge.
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.

1 participant