@dreamlake/dreamlake-cli 0.124.0 → 0.125.1
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/dist/api/cict.d.ts +49 -4
- package/dist/api/cict.js +21 -4
- package/dist/api/index.d.ts +40 -6
- package/dist/cli/cict/index.js +45 -17
- package/dist/cli/help-examples.generated.js +2 -1
- package/dist/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/package.json +9 -9
package/dist/api/cict.d.ts
CHANGED
|
@@ -210,6 +210,19 @@ export interface CictPlatformStatus {
|
|
|
210
210
|
waiting: number;
|
|
211
211
|
monthGpuSeconds: number;
|
|
212
212
|
}
|
|
213
|
+
/** One DreamLake GPU job's GPU time. */
|
|
214
|
+
export interface CictUsageRun {
|
|
215
|
+
runId: string | null;
|
|
216
|
+
repository: string;
|
|
217
|
+
workflowName: string | null;
|
|
218
|
+
name: string | null;
|
|
219
|
+
/** The GitHub user who triggered the job. */
|
|
220
|
+
sender: string | null;
|
|
221
|
+
headBranch: string | null;
|
|
222
|
+
headSha: string | null;
|
|
223
|
+
gpuSeconds: number;
|
|
224
|
+
completedAt: string;
|
|
225
|
+
}
|
|
213
226
|
export interface CictUsage {
|
|
214
227
|
month: string;
|
|
215
228
|
gpuSeconds: number;
|
|
@@ -220,6 +233,15 @@ export interface CictUsage {
|
|
|
220
233
|
gpuSeconds: number;
|
|
221
234
|
jobs: number;
|
|
222
235
|
}>;
|
|
236
|
+
/** Absent from older servers. */
|
|
237
|
+
bySender?: Array<{
|
|
238
|
+
sender: string | null;
|
|
239
|
+
gpuSeconds: number;
|
|
240
|
+
jobs: number;
|
|
241
|
+
}>;
|
|
242
|
+
/** Newest first; narrowed by `sender` when asked. */
|
|
243
|
+
runs?: CictUsageRun[];
|
|
244
|
+
runsTotal?: number;
|
|
223
245
|
}
|
|
224
246
|
/**
|
|
225
247
|
* CI/CT through GitHub Actions (channel A): connect a GitHub App installation,
|
|
@@ -276,8 +298,15 @@ export declare function cictApi(t: Transport, namespace: string, fetchImpl?: typ
|
|
|
276
298
|
};
|
|
277
299
|
}>;
|
|
278
300
|
};
|
|
279
|
-
/**
|
|
280
|
-
|
|
301
|
+
/**
|
|
302
|
+
* DreamLake GPU time in a month (default: this month): by repository and
|
|
303
|
+
* workflow, by the GitHub user who triggered each job, and the jobs
|
|
304
|
+
* (newest first; `sender` narrows the job list, `limit` caps it at 1-500).
|
|
305
|
+
*/
|
|
306
|
+
usage: (month?: string, options?: {
|
|
307
|
+
sender?: string;
|
|
308
|
+
limit?: number;
|
|
309
|
+
}) => Promise<CictUsage>;
|
|
281
310
|
github: {
|
|
282
311
|
/** GitHub App installations bound to this namespace. */
|
|
283
312
|
installations: () => Promise<CictInstallation[]>;
|
|
@@ -296,7 +325,13 @@ export declare function cictApi(t: Transport, namespace: string, fetchImpl?: typ
|
|
|
296
325
|
* which namespaces may use it, their limits, and the machine types.
|
|
297
326
|
*/
|
|
298
327
|
export declare function cictPlatformAdminApi(t: Transport): {
|
|
299
|
-
overview: () => Promise<{
|
|
328
|
+
overview: (month?: string) => Promise<{
|
|
329
|
+
platformNamespace?: string | null;
|
|
330
|
+
month?: string;
|
|
331
|
+
total?: {
|
|
332
|
+
gpuSeconds: number;
|
|
333
|
+
jobs: number;
|
|
334
|
+
};
|
|
300
335
|
machines: Array<CictPlatformMachine & {
|
|
301
336
|
providerId: string;
|
|
302
337
|
env: Record<string, string>;
|
|
@@ -305,9 +340,11 @@ export declare function cictPlatformAdminApi(t: Transport): {
|
|
|
305
340
|
namespaces: Array<CictPlatformAccess & {
|
|
306
341
|
namespaceId: string;
|
|
307
342
|
slug: string | null;
|
|
343
|
+
authorizer?: CictAuthorizer | null;
|
|
308
344
|
running: number;
|
|
309
345
|
waiting: number;
|
|
310
346
|
monthGpuSeconds: number;
|
|
347
|
+
monthJobs?: number;
|
|
311
348
|
}>;
|
|
312
349
|
}>;
|
|
313
350
|
/** Allow (`allowed`), pause (`suspended`) or set the concurrency limit of a namespace. */
|
|
@@ -318,6 +355,15 @@ export declare function cictPlatformAdminApi(t: Transport): {
|
|
|
318
355
|
namespaceId: string;
|
|
319
356
|
}>;
|
|
320
357
|
/** Create or change a machine type; the provider must be in the platform namespace. */
|
|
358
|
+
/** Slurm providers in the platform namespace, with what one job gets on each (from its launch layer). */
|
|
359
|
+
providers: () => Promise<{
|
|
360
|
+
id: string;
|
|
361
|
+
name: string;
|
|
362
|
+
usable: boolean;
|
|
363
|
+
reason: string | null;
|
|
364
|
+
spec: CictPlatformMachine["spec"] | null;
|
|
365
|
+
}[]>;
|
|
366
|
+
/** Create or change a machine type. What one job gets is read from the provider's launch layer. */
|
|
321
367
|
putMachine: (id: string, body: {
|
|
322
368
|
label?: string;
|
|
323
369
|
title?: string;
|
|
@@ -325,7 +371,6 @@ export declare function cictPlatformAdminApi(t: Transport): {
|
|
|
325
371
|
enabled?: boolean;
|
|
326
372
|
maxConcurrent?: number;
|
|
327
373
|
env?: Record<string, string>;
|
|
328
|
-
spec?: CictPlatformMachine["spec"];
|
|
329
374
|
}) => Promise<CictPlatformMachine & {
|
|
330
375
|
providerId: string;
|
|
331
376
|
maxConcurrent: number;
|
package/dist/api/cict.js
CHANGED
|
@@ -71,11 +71,21 @@ export function cictApi(t, namespace, fetchImpl) {
|
|
|
71
71
|
/** Change where DreamLake GPU runs save results. */
|
|
72
72
|
setSource: (sourceId) => call(t, "PATCH", ns + "/cict/platform", { sourceId }),
|
|
73
73
|
},
|
|
74
|
-
/**
|
|
75
|
-
|
|
74
|
+
/**
|
|
75
|
+
* DreamLake GPU time in a month (default: this month): by repository and
|
|
76
|
+
* workflow, by the GitHub user who triggered each job, and the jobs
|
|
77
|
+
* (newest first; `sender` narrows the job list, `limit` caps it at 1-500).
|
|
78
|
+
*/
|
|
79
|
+
usage: (month, options = {}) => {
|
|
76
80
|
if (month !== undefined && !MONTH.test(month))
|
|
77
81
|
throw new Error("Use a month as YYYY-MM");
|
|
78
|
-
|
|
82
|
+
if (options.sender !== undefined && !/^[A-Za-z0-9][A-Za-z0-9_.[\]-]{0,99}$/.test(options.sender))
|
|
83
|
+
throw new Error("Use a GitHub login as the sender");
|
|
84
|
+
if (options.limit !== undefined && (!Number.isSafeInteger(options.limit) || options.limit < 1 || options.limit > 500))
|
|
85
|
+
throw new Error("Use a limit from 1 to 500");
|
|
86
|
+
return call(t, "GET", ns + "/cict/usage", undefined, {
|
|
87
|
+
...(month ? { month } : {}), ...(options.sender ? { sender: options.sender } : {}), ...(options.limit ? { limit: String(options.limit) } : {}),
|
|
88
|
+
});
|
|
79
89
|
},
|
|
80
90
|
github: {
|
|
81
91
|
/** GitHub App installations bound to this namespace. */
|
|
@@ -95,10 +105,17 @@ export function cictApi(t, namespace, fetchImpl) {
|
|
|
95
105
|
*/
|
|
96
106
|
export function cictPlatformAdminApi(t) {
|
|
97
107
|
return {
|
|
98
|
-
overview: () =>
|
|
108
|
+
overview: (month) => {
|
|
109
|
+
if (month !== undefined && !MONTH.test(month))
|
|
110
|
+
throw new Error("Use a month as YYYY-MM");
|
|
111
|
+
return call(t, "GET", "/cict/platform/admin", undefined, month ? { month } : {});
|
|
112
|
+
},
|
|
99
113
|
/** Allow (`allowed`), pause (`suspended`) or set the concurrency limit of a namespace. */
|
|
100
114
|
setNamespace: (slug, body) => call(t, "PUT", "/cict/platform/admin/namespaces/" + seg(slug), body),
|
|
101
115
|
/** Create or change a machine type; the provider must be in the platform namespace. */
|
|
116
|
+
/** Slurm providers in the platform namespace, with what one job gets on each (from its launch layer). */
|
|
117
|
+
providers: async () => (await call(t, "GET", "/cict/platform/admin/providers")).providers,
|
|
118
|
+
/** Create or change a machine type. What one job gets is read from the provider's launch layer. */
|
|
102
119
|
putMachine: (id, body) => call(t, "PUT", "/cict/platform/admin/machines/" + seg(id), body),
|
|
103
120
|
};
|
|
104
121
|
}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1312,7 +1312,10 @@ export declare function createApi(transport: Transport, storageFetch?: typeof fe
|
|
|
1312
1312
|
};
|
|
1313
1313
|
}>;
|
|
1314
1314
|
};
|
|
1315
|
-
usage: (month?: string
|
|
1315
|
+
usage: (month?: string, options?: {
|
|
1316
|
+
sender?: string;
|
|
1317
|
+
limit?: number;
|
|
1318
|
+
}) => Promise<import("./cict.js").CictUsage>;
|
|
1316
1319
|
github: {
|
|
1317
1320
|
installations: () => Promise<import("./cict.js").CictInstallation[]>;
|
|
1318
1321
|
connect: () => Promise<{
|
|
@@ -1322,7 +1325,13 @@ export declare function createApi(transport: Transport, storageFetch?: typeof fe
|
|
|
1322
1325
|
};
|
|
1323
1326
|
/** DreamLake GPU administration (admins of the platform namespace). */
|
|
1324
1327
|
cictPlatformAdmin: {
|
|
1325
|
-
overview: () => Promise<{
|
|
1328
|
+
overview: (month?: string) => Promise<{
|
|
1329
|
+
platformNamespace?: string | null;
|
|
1330
|
+
month?: string;
|
|
1331
|
+
total?: {
|
|
1332
|
+
gpuSeconds: number;
|
|
1333
|
+
jobs: number;
|
|
1334
|
+
};
|
|
1326
1335
|
machines: Array<import("./cict.js").CictPlatformMachine & {
|
|
1327
1336
|
providerId: string;
|
|
1328
1337
|
env: Record<string, string>;
|
|
@@ -1331,9 +1340,11 @@ export declare function createApi(transport: Transport, storageFetch?: typeof fe
|
|
|
1331
1340
|
namespaces: Array<import("./cict.js").CictPlatformAccess & {
|
|
1332
1341
|
namespaceId: string;
|
|
1333
1342
|
slug: string | null;
|
|
1343
|
+
authorizer?: import("./cict.js").CictAuthorizer | null;
|
|
1334
1344
|
running: number;
|
|
1335
1345
|
waiting: number;
|
|
1336
1346
|
monthGpuSeconds: number;
|
|
1347
|
+
monthJobs?: number;
|
|
1337
1348
|
}>;
|
|
1338
1349
|
}>;
|
|
1339
1350
|
setNamespace: (slug: string, body: {
|
|
@@ -1342,6 +1353,13 @@ export declare function createApi(transport: Transport, storageFetch?: typeof fe
|
|
|
1342
1353
|
}) => Promise<import("./cict.js").CictPlatformAccess & {
|
|
1343
1354
|
namespaceId: string;
|
|
1344
1355
|
}>;
|
|
1356
|
+
providers: () => Promise<{
|
|
1357
|
+
id: string;
|
|
1358
|
+
name: string;
|
|
1359
|
+
usable: boolean;
|
|
1360
|
+
reason: string | null;
|
|
1361
|
+
spec: import("./cict.js").CictPlatformMachine["spec"] | null;
|
|
1362
|
+
}[]>;
|
|
1345
1363
|
putMachine: (id: string, body: {
|
|
1346
1364
|
label?: string;
|
|
1347
1365
|
title?: string;
|
|
@@ -1349,7 +1367,6 @@ export declare function createApi(transport: Transport, storageFetch?: typeof fe
|
|
|
1349
1367
|
enabled?: boolean;
|
|
1350
1368
|
maxConcurrent?: number;
|
|
1351
1369
|
env?: Record<string, string>;
|
|
1352
|
-
spec?: import("./cict.js").CictPlatformMachine["spec"];
|
|
1353
1370
|
}) => Promise<import("./cict.js").CictPlatformMachine & {
|
|
1354
1371
|
providerId: string;
|
|
1355
1372
|
maxConcurrent: number;
|
|
@@ -2741,7 +2758,10 @@ export declare function createClient(options: ClientOptions): {
|
|
|
2741
2758
|
};
|
|
2742
2759
|
}>;
|
|
2743
2760
|
};
|
|
2744
|
-
usage: (month?: string
|
|
2761
|
+
usage: (month?: string, options?: {
|
|
2762
|
+
sender?: string;
|
|
2763
|
+
limit?: number;
|
|
2764
|
+
}) => Promise<import("./cict.js").CictUsage>;
|
|
2745
2765
|
github: {
|
|
2746
2766
|
installations: () => Promise<import("./cict.js").CictInstallation[]>;
|
|
2747
2767
|
connect: () => Promise<{
|
|
@@ -2751,7 +2771,13 @@ export declare function createClient(options: ClientOptions): {
|
|
|
2751
2771
|
};
|
|
2752
2772
|
/** DreamLake GPU administration (admins of the platform namespace). */
|
|
2753
2773
|
cictPlatformAdmin: {
|
|
2754
|
-
overview: () => Promise<{
|
|
2774
|
+
overview: (month?: string) => Promise<{
|
|
2775
|
+
platformNamespace?: string | null;
|
|
2776
|
+
month?: string;
|
|
2777
|
+
total?: {
|
|
2778
|
+
gpuSeconds: number;
|
|
2779
|
+
jobs: number;
|
|
2780
|
+
};
|
|
2755
2781
|
machines: Array<import("./cict.js").CictPlatformMachine & {
|
|
2756
2782
|
providerId: string;
|
|
2757
2783
|
env: Record<string, string>;
|
|
@@ -2760,9 +2786,11 @@ export declare function createClient(options: ClientOptions): {
|
|
|
2760
2786
|
namespaces: Array<import("./cict.js").CictPlatformAccess & {
|
|
2761
2787
|
namespaceId: string;
|
|
2762
2788
|
slug: string | null;
|
|
2789
|
+
authorizer?: import("./cict.js").CictAuthorizer | null;
|
|
2763
2790
|
running: number;
|
|
2764
2791
|
waiting: number;
|
|
2765
2792
|
monthGpuSeconds: number;
|
|
2793
|
+
monthJobs?: number;
|
|
2766
2794
|
}>;
|
|
2767
2795
|
}>;
|
|
2768
2796
|
setNamespace: (slug: string, body: {
|
|
@@ -2771,6 +2799,13 @@ export declare function createClient(options: ClientOptions): {
|
|
|
2771
2799
|
}) => Promise<import("./cict.js").CictPlatformAccess & {
|
|
2772
2800
|
namespaceId: string;
|
|
2773
2801
|
}>;
|
|
2802
|
+
providers: () => Promise<{
|
|
2803
|
+
id: string;
|
|
2804
|
+
name: string;
|
|
2805
|
+
usable: boolean;
|
|
2806
|
+
reason: string | null;
|
|
2807
|
+
spec: import("./cict.js").CictPlatformMachine["spec"] | null;
|
|
2808
|
+
}[]>;
|
|
2774
2809
|
putMachine: (id: string, body: {
|
|
2775
2810
|
label?: string;
|
|
2776
2811
|
title?: string;
|
|
@@ -2778,7 +2813,6 @@ export declare function createClient(options: ClientOptions): {
|
|
|
2778
2813
|
enabled?: boolean;
|
|
2779
2814
|
maxConcurrent?: number;
|
|
2780
2815
|
env?: Record<string, string>;
|
|
2781
|
-
spec?: import("./cict.js").CictPlatformMachine["spec"];
|
|
2782
2816
|
}) => Promise<import("./cict.js").CictPlatformMachine & {
|
|
2783
2817
|
providerId: string;
|
|
2784
2818
|
maxConcurrent: number;
|
package/dist/cli/cict/index.js
CHANGED
|
@@ -37,6 +37,8 @@ function count(value, flag, max = 1000) {
|
|
|
37
37
|
throw new Error(`${flag} must be a whole number from 0 to ${max}`);
|
|
38
38
|
return n;
|
|
39
39
|
}
|
|
40
|
+
/** What one job gets: `1x RTX 5090 · 8 CPU · 32 GB · 02:00:00`. */
|
|
41
|
+
const specText = (s) => s ? [`${s.gpus}x ${s.gpu}`, `${s.cpus} CPU`, `${s.memGiB} GB`, s.timeLimit].filter(Boolean).join(" · ") : "unknown";
|
|
40
42
|
const gpuMinutes = (seconds) => `${seconds > 0 && seconds < 60 ? "<1" : Math.round(seconds / 60)} GPU min`;
|
|
41
43
|
function selector(value, pattern, shape) {
|
|
42
44
|
const at = value.indexOf("/");
|
|
@@ -220,7 +222,7 @@ export function registerCictCommand(program) {
|
|
|
220
222
|
...(st.authorizer ? [` authorized by ${st.authorizer.name ?? st.authorizer.userId}${st.authorizer.writable ? ""
|
|
221
223
|
: ` — can no longer write; jobs wait until a namespace admin runs: dl cict platform source ${ns} --source ${a.evidence?.sourceId}`}`] : [])] : []),
|
|
222
224
|
"Machines:",
|
|
223
|
-
...st.machines.map((m) => ` ${m.label}
|
|
225
|
+
...st.machines.map((m) => ` ${m.label} per job: ${specText(m.spec)}`),
|
|
224
226
|
].join("\n");
|
|
225
227
|
}));
|
|
226
228
|
platform.command("start <namespace>").description("start using DreamLake GPU: create cict-evidence (or use --source) for results; you authorize the writes")
|
|
@@ -239,21 +241,47 @@ export function registerCictCommand(program) {
|
|
|
239
241
|
throw new Error("--source must be a 24-character Source ID");
|
|
240
242
|
return api(ns).platform.setSource(opts.source);
|
|
241
243
|
}, (r) => `Results now go to ${r.source.name}.`));
|
|
242
|
-
group.command("usage <namespace>").description("DreamLake GPU time in a month, by repository and workflow")
|
|
244
|
+
group.command("usage <namespace>").description("DreamLake GPU time in a month: by who triggered each job, by repository and workflow, or job by job (--jobs)")
|
|
243
245
|
.option("--month <YYYY-MM>", "default: this month")
|
|
246
|
+
.option("--jobs", "list the jobs, newest first, instead of the totals")
|
|
247
|
+
.option("--sender <login>", "with --jobs: only jobs this GitHub user triggered")
|
|
248
|
+
.option("--limit <n>", "with --jobs: how many (1-500, default 100)")
|
|
244
249
|
.option("--json")
|
|
245
|
-
.action((ns, opts) => execute(opts, async () =>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
.action((ns, opts) => execute(opts, async () => {
|
|
251
|
+
if ((opts.sender !== undefined || opts.limit !== undefined) && !opts.jobs)
|
|
252
|
+
throw new Error("--sender and --limit go with --jobs");
|
|
253
|
+
return api(ns).usage(opts.month, {
|
|
254
|
+
...(opts.sender !== undefined ? { sender: opts.sender } : {}),
|
|
255
|
+
...(opts.limit !== undefined ? { limit: count(opts.limit, "--limit", 500) } : {}),
|
|
256
|
+
});
|
|
257
|
+
}, (u) => {
|
|
258
|
+
const head = `${u.month}: ${gpuMinutes(u.gpuSeconds)} over ${u.jobs} job${u.jobs === 1 ? "" : "s"}`;
|
|
259
|
+
if (opts.jobs) {
|
|
260
|
+
const runs = u.runs ?? [];
|
|
261
|
+
return [
|
|
262
|
+
head + (opts.sender ? ` (jobs by ${opts.sender})` : ""),
|
|
263
|
+
...runs.map((r) => ` ${r.completedAt.slice(0, 16).replace("T", " ")} ${r.runId ?? "-"} ${r.repository} · ${r.name ?? r.workflowName ?? "job"} ${r.headBranch ?? "-"} by ${r.sender ?? "unknown"} ${gpuMinutes(r.gpuSeconds)}`),
|
|
264
|
+
...(u.runsTotal > runs.length ? [` … latest ${runs.length} of ${u.runsTotal}; raise --limit for more`] : []),
|
|
265
|
+
...(runs.length ? [] : [" no DreamLake GPU jobs"]),
|
|
266
|
+
].join("\n");
|
|
267
|
+
}
|
|
268
|
+
return [
|
|
269
|
+
head,
|
|
270
|
+
...(u.bySender ? ["By person:", ...u.bySender.map((p) => ` ${p.sender ?? "unknown"} ${p.jobs} jobs ${gpuMinutes(p.gpuSeconds)}`)] : []),
|
|
271
|
+
"By workflow:",
|
|
272
|
+
...u.byWorkflow.map((r) => ` ${r.repository} ${r.workflowName ?? "-"} ${r.jobs} jobs ${gpuMinutes(r.gpuSeconds)}`),
|
|
273
|
+
].join("\n");
|
|
274
|
+
}));
|
|
249
275
|
const admin = platform.command("admin").description("administer DreamLake GPU (admins of the platform namespace)");
|
|
250
|
-
admin.command("list").description("machine types and namespaces with their limits, occupancy and
|
|
276
|
+
admin.command("list").description("machine types and namespaces with their limits, occupancy and a month's GPU time")
|
|
277
|
+
.option("--month <YYYY-MM>", "default: this month")
|
|
251
278
|
.option("--json")
|
|
252
|
-
.action((opts) => execute(opts, () => adminApi().overview(), (o) => [
|
|
279
|
+
.action((opts) => execute(opts, () => adminApi().overview(opts.month), (o) => [
|
|
280
|
+
...(o.total ? [`${o.month}: ${gpuMinutes(o.total.gpuSeconds)} over ${o.total.jobs} job${o.total.jobs === 1 ? "" : "s"}, all namespaces`] : []),
|
|
253
281
|
"Namespaces:",
|
|
254
282
|
...o.namespaces.map((n) => ` ${n.slug ?? n.namespaceId} ${n.state}${n.authorizer && !n.authorizer.writable ? " (needs re-authorization)" : ""} limit ${n.maxConcurrent} running ${n.running} queued ${n.waiting} ${gpuMinutes(n.monthGpuSeconds)}`),
|
|
255
283
|
"Machines:",
|
|
256
|
-
...o.machines.map((m) => ` ${m.id} ${m.label} ${m.enabled ? "enabled" : "disabled"}
|
|
284
|
+
...o.machines.map((m) => ` ${m.id} ${m.label} per job: ${specText(m.spec)} ${m.enabled ? "enabled" : "disabled"} ${m.maxConcurrent} jobs at once provider ${m.providerId}`),
|
|
257
285
|
].join("\n")));
|
|
258
286
|
admin.command("allow <namespace>").description("let a namespace use DreamLake GPU (or resume a paused one)")
|
|
259
287
|
.option("--limit <n>", "jobs at once for this namespace")
|
|
@@ -265,21 +293,22 @@ export function registerCictCommand(program) {
|
|
|
265
293
|
admin.command("limit <namespace> <n>").description("set how many DreamLake GPU jobs a namespace runs at once")
|
|
266
294
|
.option("--json")
|
|
267
295
|
.action((slug, n, opts) => execute(opts, () => adminApi().setNamespace(slug, { maxConcurrent: count(n, "limit", 100) }), (a) => `${slug}: limit ${a.maxConcurrent}`));
|
|
268
|
-
admin.command("
|
|
296
|
+
admin.command("providers").description("Slurm providers in the platform namespace and what one job gets on each, from its launch layer")
|
|
297
|
+
.option("--json")
|
|
298
|
+
.action((opts) => execute(opts, () => adminApi().providers(), (list) => list.length
|
|
299
|
+
? list.map((p) => `${p.id} ${p.name} ${p.usable ? `per job: ${specText(p.spec)}` : `not usable: ${p.reason}`}`).join("\n")
|
|
300
|
+
: "No Slurm provider in the platform namespace"));
|
|
301
|
+
admin.command("machine <id>").description("create or change a machine type; what one job gets comes from the provider's launch layer")
|
|
269
302
|
.option("--label <label>", "runs-on label, dreamlake-…")
|
|
270
303
|
.option("--title <text>")
|
|
271
|
-
.option("--provider <id>", "Slurm provider in the platform namespace")
|
|
304
|
+
.option("--provider <id>", "Slurm provider in the platform namespace (see: platform admin providers)")
|
|
272
305
|
.option("--limit <n>", "jobs at once across all namespaces")
|
|
273
306
|
.option("--enable").option("--disable")
|
|
274
|
-
.option("--gpus <n>").option("--gpu <model>").option("--cpus <n>").option("--mem-gib <n>").option("--time-limit <hh:mm:ss>")
|
|
275
307
|
.option("--env <NAME=value>", "replace every variable (repeatable)", collect)
|
|
276
308
|
.option("--json")
|
|
277
309
|
.action((id, opts) => execute(opts, () => {
|
|
278
310
|
if (opts.enable && opts.disable)
|
|
279
311
|
throw new Error("Pass --enable or --disable, not both");
|
|
280
|
-
const specFlags = [opts.gpus, opts.gpu, opts.cpus, opts.memGib, opts.timeLimit];
|
|
281
|
-
if (specFlags.some((v) => v !== undefined) && specFlags.some((v) => v === undefined))
|
|
282
|
-
throw new Error("The catalog spec needs all of --gpus, --gpu, --cpus, --mem-gib and --time-limit");
|
|
283
312
|
if (opts.provider !== undefined && !ID.test(opts.provider))
|
|
284
313
|
throw new Error("--provider must be a 24-character provider ID");
|
|
285
314
|
return adminApi().putMachine(id, {
|
|
@@ -287,10 +316,9 @@ export function registerCictCommand(program) {
|
|
|
287
316
|
...(opts.provider ? { providerId: opts.provider } : {}),
|
|
288
317
|
...(opts.limit !== undefined ? { maxConcurrent: count(opts.limit, "--limit") } : {}),
|
|
289
318
|
...(opts.enable ? { enabled: true } : opts.disable ? { enabled: false } : {}),
|
|
290
|
-
...(opts.gpus !== undefined ? { spec: { gpus: count(opts.gpus, "--gpus", 16), gpu: opts.gpu, cpus: count(opts.cpus, "--cpus", 512), memGiB: count(opts.memGib, "--mem-gib", 4096), timeLimit: opts.timeLimit } } : {}),
|
|
291
319
|
...(opts.env ? { env: envOf(opts.env) } : {}),
|
|
292
320
|
});
|
|
293
|
-
}, (m) => `${m.id}: ${m.label} ${m.enabled ? "enabled" : "disabled"},
|
|
321
|
+
}, (m) => `${m.id}: ${m.label} per job: ${specText(m.spec)} ${m.enabled ? "enabled" : "disabled"}, ${m.maxConcurrent} jobs at once`));
|
|
294
322
|
}
|
|
295
323
|
// Text output for `runs show`, with or without the result.
|
|
296
324
|
function runShowText(value) {
|
|
@@ -49,7 +49,8 @@ export const helpExamples = {
|
|
|
49
49
|
"cict platform admin allow": "dl cict platform admin allow robotics-lab --limit 2",
|
|
50
50
|
"cict platform admin pause": "dl cict platform admin pause robotics-lab",
|
|
51
51
|
"cict platform admin limit": "dl cict platform admin limit robotics-lab 4",
|
|
52
|
-
"cict platform admin
|
|
52
|
+
"cict platform admin providers": "dl cict platform admin providers",
|
|
53
|
+
"cict platform admin machine": "dl cict platform admin machine gpu-rtx5090 --label dreamlake-gpu-rtx5090 \\\n --provider 0123456789abcdef01234567 --limit 6 --enable \\\n --env DREAMLAKE_ROBOT_ASSETS_CACHE=/work/shared/robot-assets\ndl cict platform admin machine gpu-rtx5090 --disable",
|
|
53
54
|
"hosts": "dl hosts\ndl hosts --all\ndl hosts -h\ndl hosts list -h",
|
|
54
55
|
"su": "dl su fortyfive\ndl hosts list\ndl hosts list --namespace geyang\ndl su geyang",
|
|
55
56
|
"logout": "dl logout --env staging",
|
package/dist/cli/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.125.1";
|
package/dist/cli/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamlake/dreamlake-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.125.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dreamlake-ai/dreamlake-cli.git"
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"node": ">=18"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@dreamlake/dreamlake-cli-darwin-arm64": "0.
|
|
41
|
-
"@dreamlake/dreamlake-cli-darwin-x64": "0.
|
|
42
|
-
"@dreamlake/dreamlake-cli-linux-x64": "0.
|
|
43
|
-
"@dreamlake/dreamlake-cli-linux-arm64": "0.
|
|
44
|
-
"@dreamlake/dreamlake-cli-linux-x64-musl": "0.
|
|
45
|
-
"@dreamlake/dreamlake-cli-linux-arm64-musl": "0.
|
|
46
|
-
"@dreamlake/dreamlake-cli-win32-x64": "0.
|
|
47
|
-
"@dreamlake/dreamlake-cli-win32-arm64": "0.
|
|
40
|
+
"@dreamlake/dreamlake-cli-darwin-arm64": "0.125.1",
|
|
41
|
+
"@dreamlake/dreamlake-cli-darwin-x64": "0.125.1",
|
|
42
|
+
"@dreamlake/dreamlake-cli-linux-x64": "0.125.1",
|
|
43
|
+
"@dreamlake/dreamlake-cli-linux-arm64": "0.125.1",
|
|
44
|
+
"@dreamlake/dreamlake-cli-linux-x64-musl": "0.125.1",
|
|
45
|
+
"@dreamlake/dreamlake-cli-linux-arm64-musl": "0.125.1",
|
|
46
|
+
"@dreamlake/dreamlake-cli-win32-x64": "0.125.1",
|
|
47
|
+
"@dreamlake/dreamlake-cli-win32-arm64": "0.125.1"
|
|
48
48
|
}
|
|
49
49
|
}
|