@ornncompute/cli 0.2.23 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +304 -420
- package/package.json +12 -6
- package/src/admin-capacity-reservations.mjs +280 -0
- package/src/admin-command-handlers.mjs +57 -0
- package/src/admin-enrollment.mjs +680 -0
- package/src/admin-mutations.mjs +187 -0
- package/src/admin-node-diagnostics.mjs +412 -0
- package/src/admin-node-lifecycle.mjs +908 -0
- package/src/admin-shell.mjs +322 -0
- package/src/api-client.mjs +81 -28
- package/src/atomic-output.mjs +112 -0
- package/src/auth-store.mjs +182 -11
- package/src/capability-catalog.mjs +7 -0
- package/src/catalog-shell.mjs +1350 -0
- package/src/cli.mjs +123 -10266
- package/src/connect-mode-handlers.mjs +170 -0
- package/src/device-auth.mjs +178 -61
- package/src/evidence-commands.mjs +1340 -0
- package/src/external-bucket-commands.mjs +1374 -0
- package/src/interaction-runtime.mjs +310 -0
- package/src/kubernetes-commands.mjs +2229 -0
- package/src/launch-mode-handlers.mjs +119 -0
- package/src/machine-reference.mjs +277 -0
- package/src/mount-commands.mjs +1146 -0
- package/src/session-commands.mjs +565 -0
- package/src/slurm-commands.mjs +263 -0
- package/src/startup.mjs +34 -11
- package/src/storage-commands.mjs +1144 -0
- package/src/update.mjs +172 -24
- package/src/vm-commands.mjs +4273 -0
- package/src/vpn-secret-output.mjs +150 -0
- package/src/wait-runtime.mjs +231 -0
- package/vendor/capabilities/capabilities/admin-capacity-reservations.js +126 -0
- package/vendor/capabilities/capabilities/admin-enrollment.js +321 -0
- package/vendor/capabilities/capabilities/admin-node-diagnostics.js +88 -0
- package/vendor/capabilities/capabilities/admin-nodes-lifecycle.js +235 -0
- package/vendor/capabilities/capabilities/admin.js +89 -0
- package/vendor/capabilities/capabilities/capacity-offers.js +368 -0
- package/vendor/capabilities/capabilities/cli.js +156 -0
- package/vendor/capabilities/capabilities/clusters.js +150 -1
- package/vendor/capabilities/capabilities/compute.js +522 -0
- package/vendor/capabilities/capabilities/evidence.js +145 -0
- package/vendor/capabilities/capabilities/external-buckets.js +191 -0
- package/vendor/capabilities/capabilities/fleet.js +21 -5
- package/vendor/capabilities/capabilities/identity.js +114 -3
- package/vendor/capabilities/capabilities/listings.js +14 -8
- package/vendor/capabilities/capabilities/mounts.js +176 -0
- package/vendor/capabilities/capabilities/networks.js +1257 -0
- package/vendor/capabilities/capabilities/observability.js +38 -8
- package/vendor/capabilities/capabilities/tokens.js +20 -8
- package/vendor/capabilities/capabilities/volumes.js +178 -0
- package/vendor/capabilities/capability.js +19 -13
- package/vendor/capabilities/cli-catalog.js +65 -0
- package/vendor/capabilities/cli-migrations.js +288 -0
- package/vendor/capabilities/cli.js +7 -0
- package/vendor/capabilities/software-catalog.js +36 -0
- package/vendor/capabilities/spec-catalog.js +2 -2
- package/src/catalog-dispatch.mjs +0 -605
- package/src/color.mjs +0 -71
- package/vendor/capabilities/capabilities/clusters.d.ts +0 -2
- package/vendor/capabilities/capabilities/fleet.d.ts +0 -8
- package/vendor/capabilities/capabilities/identity.d.ts +0 -3
- package/vendor/capabilities/capabilities/listings.d.ts +0 -51
- package/vendor/capabilities/capabilities/observability.d.ts +0 -5
- package/vendor/capabilities/capabilities/staff-access.d.ts +0 -29
- package/vendor/capabilities/capabilities/staff-access.js +0 -278
- package/vendor/capabilities/capabilities/staff-commerce.d.ts +0 -160
- package/vendor/capabilities/capabilities/staff-commerce.js +0 -689
- package/vendor/capabilities/capabilities/staff-fleet.d.ts +0 -140
- package/vendor/capabilities/capabilities/staff-fleet.js +0 -538
- package/vendor/capabilities/capabilities/staff-gtm.d.ts +0 -142
- package/vendor/capabilities/capabilities/staff-gtm.js +0 -521
- package/vendor/capabilities/capabilities/staff-shared.d.ts +0 -47
- package/vendor/capabilities/capabilities/staff-shared.js +0 -98
- package/vendor/capabilities/capabilities/tokens.d.ts +0 -10
- package/vendor/capabilities/capabilities/users.d.ts +0 -2
- package/vendor/capabilities/capability.d.ts +0 -93
- package/vendor/capabilities/catalog.d.ts +0 -3
- package/vendor/capabilities/catalog.js +0 -26
- package/vendor/capabilities/index.d.ts +0 -16
- package/vendor/capabilities/index.js +0 -16
- package/vendor/capabilities/names.d.ts +0 -6
- package/vendor/capabilities/role.d.ts +0 -6
- package/vendor/capabilities/role.js +0 -17
- package/vendor/capabilities/spec-catalog.d.ts +0 -78
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { defineCapability, preview } from "../capability.js";
|
|
2
|
+
import { defineCapability, preview, } from "../capability.js";
|
|
3
3
|
const reservationInput = z.object({
|
|
4
4
|
reservation_id: z.string().min(1),
|
|
5
5
|
reservationId: z.string().optional(),
|
|
@@ -9,12 +9,66 @@ const launchInput = reservationInput.extend({
|
|
|
9
9
|
node_count: z.number().int().positive().optional(),
|
|
10
10
|
node_ids: z.array(z.string()).optional(),
|
|
11
11
|
});
|
|
12
|
+
const clusterCliInput = z
|
|
13
|
+
.object({
|
|
14
|
+
$positionals: z.array(z.string()).optional(),
|
|
15
|
+
cursor: z.string().optional(),
|
|
16
|
+
guided: z.boolean().optional(),
|
|
17
|
+
idempotencyKey: z.string().optional(),
|
|
18
|
+
limit: z.union([z.string(), z.number()]).optional(),
|
|
19
|
+
machine: z.string().optional(),
|
|
20
|
+
machines: z.string().optional(),
|
|
21
|
+
network: z.enum(["public", "private"]).optional(),
|
|
22
|
+
noWait: z.boolean().optional(),
|
|
23
|
+
nodes: z.union([z.string(), z.number()]).optional(),
|
|
24
|
+
output: z.string().optional(),
|
|
25
|
+
overwrite: z.boolean().optional(),
|
|
26
|
+
timeout: z.string().optional(),
|
|
27
|
+
wait: z.boolean().optional(),
|
|
28
|
+
yes: z.boolean().optional(),
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
12
31
|
function reservationId(input) {
|
|
13
32
|
return (input.reservation_id || input.reservationId || "").trim();
|
|
14
33
|
}
|
|
15
34
|
function clusterPath(kind, id, suffix) {
|
|
16
35
|
return `/${kind}/reservations/${encodeURIComponent(id)}/${suffix}`;
|
|
17
36
|
}
|
|
37
|
+
function clusterExecutor(context) {
|
|
38
|
+
const runtime = context.cli?.interaction;
|
|
39
|
+
if (!runtime?.cluster) {
|
|
40
|
+
throw new Error("This capability must execute through the Ornn CLI cluster runtime.");
|
|
41
|
+
}
|
|
42
|
+
return runtime.cluster.bind(runtime);
|
|
43
|
+
}
|
|
44
|
+
function clusterCliCapability({ acceptedReferences = [], automation, command, description, human, id, mutation, outcome, related = [], review, }) {
|
|
45
|
+
return defineCapability({
|
|
46
|
+
id,
|
|
47
|
+
domain: "clusters",
|
|
48
|
+
roles: ["user"],
|
|
49
|
+
description,
|
|
50
|
+
mutation,
|
|
51
|
+
input: clusterCliInput,
|
|
52
|
+
cli: {
|
|
53
|
+
command,
|
|
54
|
+
vnext: {
|
|
55
|
+
arguments: "semantic",
|
|
56
|
+
audience: "customer",
|
|
57
|
+
category: "resource",
|
|
58
|
+
outcome,
|
|
59
|
+
human,
|
|
60
|
+
automation,
|
|
61
|
+
acceptedReferences,
|
|
62
|
+
...(review ? { review } : {}),
|
|
63
|
+
resumableStates: ["working", "ready", "partial", "failed", "ended"],
|
|
64
|
+
related,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
mcp: false,
|
|
68
|
+
slack: false,
|
|
69
|
+
execute: async (context, input) => clusterExecutor(context)(id, input),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
18
72
|
function clusterPair(kind, domain) {
|
|
19
73
|
const label = kind === "slurm" ? "Slurm" : "Kubernetes";
|
|
20
74
|
return [
|
|
@@ -25,6 +79,7 @@ function clusterPair(kind, domain) {
|
|
|
25
79
|
description: `${label} launch is blocked only when the reservation's nodes already belong to a different controller. Returns eligible=false with reason other_cluster in that case.`,
|
|
26
80
|
mutation: "read",
|
|
27
81
|
http: { method: "GET", path: `/${kind}/reservations/{id}/cluster/eligible` },
|
|
82
|
+
slack: false,
|
|
28
83
|
input: reservationInput,
|
|
29
84
|
execute: async (ctx, input) => {
|
|
30
85
|
const parsed = reservationInput.parse(input);
|
|
@@ -40,6 +95,7 @@ function clusterPair(kind, domain) {
|
|
|
40
95
|
description: `Launch a ${label} controller on a reservation. Blocked when ${kind}.eligible reports other_cluster.`,
|
|
41
96
|
mutation: "preview-confirm",
|
|
42
97
|
http: { method: "POST", path: `/${kind}/reservations/{id}/cluster/launch` },
|
|
98
|
+
slack: false,
|
|
43
99
|
input: launchInput,
|
|
44
100
|
execute: async (ctx, input) => {
|
|
45
101
|
const parsed = launchInput.parse(input);
|
|
@@ -70,6 +126,7 @@ function clusterPair(kind, domain) {
|
|
|
70
126
|
description: `Tear down the ${label} controller for a reservation.`,
|
|
71
127
|
mutation: "preview-confirm",
|
|
72
128
|
http: { method: "POST", path: `/${kind}/reservations/{id}/cluster/teardown` },
|
|
129
|
+
slack: false,
|
|
73
130
|
input: reservationInput,
|
|
74
131
|
execute: async (ctx, input) => {
|
|
75
132
|
const parsed = reservationInput.parse(input);
|
|
@@ -87,6 +144,7 @@ function clusterPair(kind, domain) {
|
|
|
87
144
|
description: `Show the ${label} controller for a reservation.`,
|
|
88
145
|
mutation: "read",
|
|
89
146
|
http: { method: "GET", path: `/${kind}/reservations/{id}/cluster` },
|
|
147
|
+
slack: false,
|
|
90
148
|
input: reservationInput,
|
|
91
149
|
execute: async (ctx, input) => {
|
|
92
150
|
const parsed = reservationInput.parse(input);
|
|
@@ -95,5 +153,96 @@ function clusterPair(kind, domain) {
|
|
|
95
153
|
}),
|
|
96
154
|
];
|
|
97
155
|
}
|
|
156
|
+
export const clusterCliCapabilities = [
|
|
157
|
+
clusterCliCapability({
|
|
158
|
+
id: "clusters.list",
|
|
159
|
+
command: ["clusters", "list"],
|
|
160
|
+
description: "List customer-safe Kubernetes and Slurm cluster facts in one bounded page.",
|
|
161
|
+
mutation: "read",
|
|
162
|
+
outcome: "List clusters without generated names, credentials, or controller details.",
|
|
163
|
+
human: "ornn clusters list [--limit <1-500>] [--cursor <cursor>]",
|
|
164
|
+
automation: "ornn clusters list --limit 50 --format json",
|
|
165
|
+
related: ["clusters show", "clusters wait"],
|
|
166
|
+
}),
|
|
167
|
+
clusterCliCapability({
|
|
168
|
+
id: "clusters.show",
|
|
169
|
+
command: ["clusters", "show"],
|
|
170
|
+
description: "Inspect one exact cluster through safe customer facts.",
|
|
171
|
+
mutation: "read",
|
|
172
|
+
outcome: "Show lifecycle and membership without exposing credentials or controller internals.",
|
|
173
|
+
human: "ornn clusters show [<cluster-id>] [--guided]",
|
|
174
|
+
automation: "ornn clusters show <cluster-id> --format json",
|
|
175
|
+
acceptedReferences: ["canonical cluster ID", "invocation-local guided choice"],
|
|
176
|
+
related: ["clusters wait", "connect"],
|
|
177
|
+
}),
|
|
178
|
+
clusterCliCapability({
|
|
179
|
+
id: "clusters.wait",
|
|
180
|
+
command: ["clusters", "wait"],
|
|
181
|
+
description: "Wait locally for one cluster to become usable without cancelling remote work.",
|
|
182
|
+
mutation: "read",
|
|
183
|
+
outcome: "Wait for usable native access with bounded timeout and interruption results.",
|
|
184
|
+
human: "ornn clusters wait [<cluster-id>] [--guided] [--timeout <duration>]",
|
|
185
|
+
automation: "ornn clusters wait <cluster-id> --timeout <duration> --format json",
|
|
186
|
+
acceptedReferences: ["canonical cluster ID", "invocation-local guided choice"],
|
|
187
|
+
related: ["clusters show", "connect"],
|
|
188
|
+
}),
|
|
189
|
+
clusterCliCapability({
|
|
190
|
+
id: "clusters.eligible_machines",
|
|
191
|
+
command: ["clusters", "eligible-machines"],
|
|
192
|
+
description: "Read the authoritative same-reservation eligible-machine projection.",
|
|
193
|
+
mutation: "read",
|
|
194
|
+
outcome: "List only canonical machine IDs and hostnames currently eligible for this cluster.",
|
|
195
|
+
human: "ornn clusters eligible-machines [<cluster-id>] [--guided] [--limit <1-500>] [--cursor <cursor>]",
|
|
196
|
+
automation: "ornn clusters eligible-machines <cluster-id> --limit 50 --format json",
|
|
197
|
+
acceptedReferences: ["canonical cluster ID", "invocation-local guided choice"],
|
|
198
|
+
related: ["clusters add-node", "clusters remove-node"],
|
|
199
|
+
}),
|
|
200
|
+
clusterCliCapability({
|
|
201
|
+
id: "clusters.add_node",
|
|
202
|
+
command: ["clusters", "add-node"],
|
|
203
|
+
description: "Reconcile one exact cluster membership-increase goal.",
|
|
204
|
+
mutation: "preview-confirm",
|
|
205
|
+
outcome: "Add one currently eligible machine, or rediscover that exact membership goal.",
|
|
206
|
+
human: "ornn clusters add-node [<cluster-id>] [<machine-id-or-hostname>] [--guided] [--no-wait]",
|
|
207
|
+
automation: "ornn clusters add-node <cluster-id> <machine-id> --yes --idempotency-key <key> --format json",
|
|
208
|
+
acceptedReferences: [
|
|
209
|
+
"canonical cluster ID",
|
|
210
|
+
"canonical machine ID",
|
|
211
|
+
"exact unique eligible hostname",
|
|
212
|
+
"invocation-local guided choice",
|
|
213
|
+
],
|
|
214
|
+
review: "Review the exact cluster, selected machine, and resulting membership count.",
|
|
215
|
+
related: ["clusters eligible-machines", "clusters remove-node"],
|
|
216
|
+
}),
|
|
217
|
+
clusterCliCapability({
|
|
218
|
+
id: "clusters.remove_node",
|
|
219
|
+
command: ["clusters", "remove-node"],
|
|
220
|
+
description: "Reconcile one exact cluster membership-reduction goal.",
|
|
221
|
+
mutation: "preview-confirm",
|
|
222
|
+
outcome: "Remove one exact member, or rediscover that exact membership goal.",
|
|
223
|
+
human: "ornn clusters remove-node [<cluster-id>] [<machine-id-or-hostname>] [--guided] [--no-wait]",
|
|
224
|
+
automation: "ornn clusters remove-node <cluster-id> <machine-id> --yes --idempotency-key <key> --format json",
|
|
225
|
+
acceptedReferences: [
|
|
226
|
+
"canonical cluster ID",
|
|
227
|
+
"canonical machine ID",
|
|
228
|
+
"exact unique member hostname",
|
|
229
|
+
"invocation-local guided choice",
|
|
230
|
+
],
|
|
231
|
+
review: "Review the exact cluster, removed machine, access reduction, and resulting membership count.",
|
|
232
|
+
related: ["clusters eligible-machines", "clusters add-node"],
|
|
233
|
+
}),
|
|
234
|
+
clusterCliCapability({
|
|
235
|
+
id: "clusters.teardown",
|
|
236
|
+
command: ["clusters", "teardown"],
|
|
237
|
+
description: "Tear down one cluster without surrendering its capacity reservation.",
|
|
238
|
+
mutation: "preview-confirm",
|
|
239
|
+
outcome: "End cluster lifecycle while reporting partial member failures and continuing reservation charges.",
|
|
240
|
+
human: "ornn clusters teardown [<cluster-id>] [--guided] [--no-wait]",
|
|
241
|
+
automation: "ornn clusters teardown <cluster-id> --yes --idempotency-key <key> --format json",
|
|
242
|
+
acceptedReferences: ["canonical cluster ID", "invocation-local guided choice"],
|
|
243
|
+
review: "The cluster and native access end; the capacity reservation and its charges remain.",
|
|
244
|
+
related: ["clusters show", "reservations show"],
|
|
245
|
+
}),
|
|
246
|
+
];
|
|
98
247
|
export const slurmCapabilities = clusterPair("slurm", "slurm");
|
|
99
248
|
export const kubernetesCapabilities = clusterPair("kubernetes", "kubernetes");
|