Skip to content

feat(task): TaskSpec resources.instance_type pins the exact instance type (#413) - #416

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/413-instance-type-pin
Jul 20, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/413-instance-type-pin

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

Adds resources.instance_type to the TaskSpec: when set, the sizer returns it verbatim and skips candidate search + family/price ranking. Closes #413.

Why (found during the nf-spawn migration)

nf-spawn's ext.instanceType is an exact type (default t3.medium), and nf-spawn sets no cpu/memory directives. Mapping it to the existing resources.families (the lossy family hint) would give families:[t3] with no cpu/mem → spawn's sizer picks the cheapest t3 = t3.nano (2 vCPU / 0.5 GB). That's a severe silent downsizing for every nf-spawn task. An exact pin is required to migrate nf-spawn without regressing.

Behavior

  • resources.instance_type set → sizer returns {InstanceType: pin, Family: familyOf(pin), Considered: 1}, finder never consulted. Takes precedence over families/cpu/memory_gib.
  • Unset → unchanged (family/price sizing).

Testing

  • TestSize_ExactInstanceTypePin: pin returned verbatim, finder not called (fake errors if consulted), family derived, families/cpu ignored.
  • taskproto suite + full go build green.

Closes #413. Refs #386

…type (#413)

When resources.instance_type is set, the sizer returns it verbatim and skips
candidate search + family/price ranking. For adapters that expose a specific
instance type (nf-spawn's ext.instanceType) rather than a cpu/memory request:
a family-only hint (t3.medium → families:[t3]) with no cpu/mem would otherwise
size to the cheapest in-family type (t3.nano) — a severe regression. Closes #413.

Refs #386
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/taskproto/sizer.go 93.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 92b0b9f into main Jul 20, 2026
7 checks passed
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.

Add resources.instance_type to TaskSpec for exact instance-type pinning

1 participant