Display and accept compute prices in $/node-hr for scale and orders#271
Closed
claude[bot] wants to merge 1 commit into
Closed
Display and accept compute prices in $/node-hr for scale and orders#271claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
Make the `sf scale` and `sf orders` command families consistent with `sf nodes` by showing and accepting limit prices in dollars-per-node-hour instead of dollars-per-GPU-hour (a node is 8 GPUs). - orders/OrderDisplay: compute and label price as $/node/hr (drop the per-GPU division); rename pricePerGPUHour -> pricePerNodeHour and the executed-price field accordingly. - scale create/update: --price input is now interpreted as $/node-hr and converted to the API's per-GPU field (buy_limit_price_per_gpu_hour); display, help text, and examples updated to node-hr. - scale ProcurementDisplay/ConfirmationMessage: show the limit price as $/node/hr (multiply the API's per-GPU value by 8 for display). - nodes/set: relabel the already-node-hr max price as /node/hr (was /GPU/hr). - helpers/quote: add getPricePerNodeHourFromQuote; keep the per-GPU helper for the nodes callers that still convert per-GPU for display. - Update OrderDisplay and quote tests to node-hr expectations. BREAKING UX: scale/orders --price now means $/node-hr, so a value that previously meant $2/gpu-hr must now be passed as $16/node-hr.
Changed Files
|
Member
|
I'm hesitant to make logical changes with such a high blast radius especially while we're in the process of deprecating this CLI. Also, this is a breaking change. |
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.
Before / After
Makes the whole CLI consistent on price units.
sf nodesalready displayed and accepted prices as $/node-hr; this bringssf scaleandsf ordersin line.sf scaleandsf ordersdisplayed limit/order prices as$2.00/gpu/hr, andsf scale --pricewas interpreted as dollars-per-GPU-hour.$16.00/node/hr, andsf scale --priceis interpreted as dollars-per-node-hour.A node is 8 GPUs (
GPUS_PER_NODE = 8), so$2.00/gpu-hr = $16.00/node-hr.The
--priceinput semantics forsf scale create/sf scale updatechange. A user who previously ran--price 2(meaning $2/gpu-hr) must now run--price 16($16/node-hr) to express the same limit. Same factor-of-8 shift applies to anyone who had memorized typical values. This is intentional (it matchessf nodesand the rest of the CLI) but is worth calling out explicitly since it silently changes the meaning of an existing flag.How
orders/OrderDisplay.tsx: dropped the* GPUS_PER_NODEin the price math, renamedpricePerGPUHour→pricePerNodeHour(and the executed-price field), relabeled/gpu/hr→/node/hr.scale/ProcurementDisplay.tsxandscale/ConfirmationMessage.tsx: the API value is per-GPU, so multiply byGPUS_PER_NODEfor display and relabel to/node/hr.buy_limit_price_per_gpu_hour), so we keep converting — but now from a node-hr input. Inscale/create.tsxandscale/update.tsxthe user's--price(cents/node-hr) is divided byGPUS_PER_NODEbefore being sent to the API. This mirrors the existingsf nodes setpattern (node-hr input → per-GPU for the API).getPricePerNodeHourFromQuoteinhelpers/quote.ts; keptgetPricePerGpuHourFromQuotefor thesf nodes create/extendcallers, which already convert it to node-hr for display./GPU/hr→/node/hr(and example values rescaled, e.g.-p 1.50→-p 12.00), and relabeled thesf nodes setconfirmation (it was already node-hr but printed/GPU/hr).OrderDisplay.test.ts(node-hr expectations + renamed field) andquote.test.ts(exercises the new node-hr helper).GPU-count math (e.g. "16 gpus", accelerators → node count) was deliberately left unchanged — only price-per-hour units changed. The unused helpers in
helpers/price.ts(no callers insrc/) were left as-is.Validation
bun run check(tsc) — passesbun run test(vitest) — 14/14 passbun run lint(biome) — passes (only pre-existing warnings, none on the changed lines)