Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 29 additions & 76 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@commander-js/extra-typings": "^12.1.0",
"@inkjs/ui": "^2.0.0",
"@inquirer/prompts": "^5.1.2",
"@sfcompute/nodes-sdk-alpha": "0.1.0-alpha.5",
"@sfcompute/nodes-sdk-alpha": "0.1.0-alpha.7",
"@types/ms": "^0.7.34",
"axios": "^1.8.4",
"boxen": "^8.0.1",
Expand Down
8 changes: 4 additions & 4 deletions src/lib/nodes/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const create = new Command("create")

const isReserved = !!(duration || end);
if (!isReserved && !zone) {
console.error(red("Must specify --zone when creating on-demand nodes\n"));
console.error(red("Must specify --zone when creating spot nodes\n"));
command.help();
process.exit(1);
}
Expand Down Expand Up @@ -193,7 +193,7 @@ async function createNodesAction(
);
}
} else if (options.maxPrice) {
// On-demand nodes - show max price they're willing to pay
// Spot nodes - show max price they're willing to pay
confirmationMessage += ` for up to $${
options.maxPrice.toFixed(2)
}/node/hr`;
Expand Down Expand Up @@ -249,8 +249,8 @@ async function createNodesAction(
createParams.end_at = Math.floor(endDate.getTime() / 1000);
createParams.node_type = "reserved";
} else {
// Neither provided - on-demand
createParams.node_type = "on_demand";
// Neither provided - spot
createParams.node_type = "spot";
}

const { data: createdNodes } = await client.nodes.create(createParams);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/nodes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function registerNodes(program: Command) {
"after",
`
A node is a compute instance that provides GPUs for your workloads. Nodes can be created
as reservations (with specific start/end times) or as procurements (on-demand pricing).
as reservations (with specific start/end times) or as procurements (spot pricing).

Examples:
\x1b[2m# Create a single node\x1b[0m
Expand Down
18 changes: 6 additions & 12 deletions src/lib/nodes/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
getStatusColor,
jsonOption,
printNodeType,
printProcurementStatus,
} from "./utils.ts";

// Component for displaying a single node in verbose format
Expand Down Expand Up @@ -67,14 +66,14 @@ function NodeVerboseDisplay({ node }: { node: SFCNodes.Node }) {
<Box marginTop={1} paddingX={1}>
<Text>📅 Schedule:</Text>
</Box>
{node.node_type === "on_demand" && (
{node.node_type === "spot" && (
<Box marginLeft={4}>
<Text color="yellow">
This node is on-demand and has no explicit start, end, or duration.
This node is spot and has no explicit start, end, or duration.
</Text>
</Box>
)}
{node.node_type !== "on_demand" && (
{node.node_type !== "spot" && (
<Box marginLeft={3} flexDirection="column" paddingX={1}>
<Row
head="Start: "
Expand All @@ -99,20 +98,15 @@ function NodeVerboseDisplay({ node }: { node: SFCNodes.Node }) {
<Text>💰 Pricing:</Text>
</Box>
<Box marginLeft={3} flexDirection="column" paddingX={1}>
{node.node_type === "on_demand" && node.procurement_status && (
{node.node_type === "spot" && (
<>
<Row
head="Max Price: "
value={`$${pricePerHour.toFixed(2)}/hour`}
/>

<Row
head="Procurement Status: "
value={printProcurementStatus(node.procurement_status)}
/>
</>
)}
{node.node_type !== "on_demand" && (
{node.node_type !== "spot" && (
<>
<Row head="Price: " value={`$${pricePerHour.toFixed(2)}/hour`} />

Expand All @@ -130,7 +124,7 @@ function NodeVerboseDisplay({ node }: { node: SFCNodes.Node }) {
<Box marginLeft={3} flexDirection="column" paddingX={1}>
<Row head="Logs: " value={`sf vms logs ${node.name}`} />
<Row head="SSH: " value={`sf vms ssh ${node.name}`} />
{node.node_type !== "on_demand" && (
{node.node_type !== "spot" && (
<Row
head="Extend: "
value={`sf nodes extend ${node.name} --duration 60 --max-price 12.00`}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/nodes/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function setNodesAction(
else notFound.push(nameOrId);
}

// Filter nodes that have procurement_id (on-demand nodes)
// Filter nodes that have procurement_id (spot nodes)
const nodesWithProcurement = nodesToUpdate.filter((node) =>
node.procurement_id
);
Expand All @@ -51,7 +51,7 @@ async function setNodesAction(
throw new CommanderError(
1,
"NO_UPDATABLE_NODES",
"No nodes with procurement IDs found. Only on-demand nodes can have their pricing updated.",
"No nodes with procurement IDs found. Only spot nodes can have their pricing updated.",
);
}

Expand Down
Loading