From e40227ee538c80f9f70d1d275330fa9e9491c248 Mon Sep 17 00:00:00 2001 From: Romi Phadte Date: Sun, 16 Feb 2025 22:56:02 -0800 Subject: [PATCH] Add vcluster to buy command --- src/lib/buy/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/buy/index.tsx b/src/lib/buy/index.tsx index 863e5c6..e6cb439 100644 --- a/src/lib/buy/index.tsx +++ b/src/lib/buy/index.tsx @@ -76,6 +76,7 @@ function _registerBuy(program: Command) { "Colocate with existing contracts", (value) => value.split(","), ) + .option("--vcluster", "Enable vcluster virtualization technology") .option("-q, --quote", "Only provide a quote for the order") .action(function buyOrderAction(options) { /* @@ -219,16 +220,18 @@ function QuoteAndBuy(props: { options: SfBuyOptions }) { accelerators, colocate, yes, + vcluster, } = props.options; setOrderProps({ - type, price: pricePerGpuHour, size: accelerators / GPUS_PER_NODE, startAt, endsAt, + type, colocate, yes, + vcluster, }); })(); }, [props.options]); @@ -328,6 +331,7 @@ type BuyOrderProps = { type: string; colocate?: Array; yes?: boolean; + vcluster?: boolean; }; function BuyOrder(props: BuyOrderProps) { @@ -357,6 +361,7 @@ function BuyOrder(props: BuyOrderProps) { endsAt, colocateWith: props.colocate || [], numberNodes: props.size, + vcluster: props.vcluster, }); setOrder(order); } @@ -523,6 +528,7 @@ export async function placeBuyOrder(options: { endsAt: Date; colocateWith: Array; numberNodes: number; + vcluster?: boolean; }) { invariant( options.totalPriceInCents === Math.ceil(options.totalPriceInCents), @@ -546,6 +552,7 @@ export async function placeBuyOrder(options: { end_at: roundEndDate(options.endsAt).toISOString(), price: options.totalPriceInCents, colocate_with: options.colocateWith, + vcluster: options.vcluster, } as const; const { data, error, response } = await api.POST("/v0/orders", { body,