@ornncompute/cli 1.0.118 → 1.0.119
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/package.json
CHANGED
package/src/gpu-catalog.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getHardwareCatalog } from "../vendor/api-client/orchestrator.js";
|
|
2
|
+
import { gpuDisplay, parseHardwareCatalog } from "../vendor/capabilities/cli.js";
|
|
2
3
|
|
|
3
4
|
const catalogs = new WeakMap();
|
|
4
5
|
|
|
@@ -7,11 +8,11 @@ const catalogs = new WeakMap();
|
|
|
7
8
|
* per fetch. An unreadable catalog renders GPUs as unknown instead of
|
|
8
9
|
* failing the command.
|
|
9
10
|
*/
|
|
10
|
-
export async function gpuLabeler(fetch
|
|
11
|
+
export async function gpuLabeler(fetch) {
|
|
11
12
|
let terms = catalogs.get(fetch);
|
|
12
13
|
if (!terms) {
|
|
13
14
|
terms = Promise.resolve()
|
|
14
|
-
.then(() => fetch
|
|
15
|
+
.then(() => getHardwareCatalog(fetch))
|
|
15
16
|
.then((payload) => parseHardwareCatalog(payload).terms)
|
|
16
17
|
.catch(() => []);
|
|
17
18
|
catalogs.set(fetch, terms);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// ../../packages/api-client/dist/orchestrator/catalog.js
|
|
2
|
+
var hardwareCatalogPath = "/v1/orchestrator/catalog/hardware";
|
|
3
|
+
function getHardwareCatalog(request, signal) {
|
|
4
|
+
return request(hardwareCatalogPath, {
|
|
5
|
+
method: "GET",
|
|
6
|
+
...signal ? { signal } : {}
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function getSoftwareCatalog(request, signal) {
|
|
10
|
+
return request("/v1/orchestrator/catalog/software", {
|
|
11
|
+
method: "GET",
|
|
12
|
+
...signal ? { signal } : {}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// ../../packages/api-client/dist/orchestrator/locality.js
|
|
17
|
+
var localityGeolocatePath = "/v1/orchestrator/locality/geolocate";
|
|
18
|
+
function listLocalityRegions(request, signal) {
|
|
19
|
+
return request("/v1/orchestrator/locality/regions", {
|
|
20
|
+
method: "GET",
|
|
21
|
+
...signal ? { signal } : {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function geolocate(request, query, signal) {
|
|
25
|
+
const target = query.ip !== void 0 ? `ip=${encodeURIComponent(query.ip)}` : `address=${encodeURIComponent(query.address)}`;
|
|
26
|
+
return request(`${localityGeolocatePath}?${target}`, {
|
|
27
|
+
method: "GET",
|
|
28
|
+
...signal ? { signal } : {}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
geolocate,
|
|
33
|
+
getHardwareCatalog,
|
|
34
|
+
getSoftwareCatalog,
|
|
35
|
+
hardwareCatalogPath,
|
|
36
|
+
listLocalityRegions,
|
|
37
|
+
localityGeolocatePath
|
|
38
|
+
};
|
|
@@ -1320,6 +1320,25 @@ function listOffers(request, filter = {}) {
|
|
|
1320
1320
|
// ../../packages/capabilities/dist/capabilities/admin-capacity-reservations.js
|
|
1321
1321
|
import { z as z9 } from "zod";
|
|
1322
1322
|
|
|
1323
|
+
// ../../packages/api-client/dist/orchestrator/catalog.js
|
|
1324
|
+
var hardwareCatalogPath = "/v1/orchestrator/catalog/hardware";
|
|
1325
|
+
function getHardwareCatalog(request, signal) {
|
|
1326
|
+
return request(hardwareCatalogPath, {
|
|
1327
|
+
method: "GET",
|
|
1328
|
+
...signal ? { signal } : {}
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
// ../../packages/api-client/dist/orchestrator/locality.js
|
|
1333
|
+
var localityGeolocatePath = "/v1/orchestrator/locality/geolocate";
|
|
1334
|
+
function geolocate(request, query3, signal) {
|
|
1335
|
+
const target = query3.ip !== void 0 ? `ip=${encodeURIComponent(query3.ip)}` : `address=${encodeURIComponent(query3.address)}`;
|
|
1336
|
+
return request(`${localityGeolocatePath}?${target}`, {
|
|
1337
|
+
method: "GET",
|
|
1338
|
+
...signal ? { signal } : {}
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1323
1342
|
// ../../packages/capabilities/dist/capabilities/staff-shared.js
|
|
1324
1343
|
function statusOf(error) {
|
|
1325
1344
|
if (error && typeof error === "object" && "status" in error) {
|
|
@@ -1331,16 +1350,13 @@ function statusOf(error) {
|
|
|
1331
1350
|
}
|
|
1332
1351
|
|
|
1333
1352
|
// ../../packages/capabilities/dist/capabilities/locality.js
|
|
1334
|
-
var LOCALITY_GEOLOCATE_PATH = "/v1/orchestrator/locality/geolocate";
|
|
1335
1353
|
async function locateRegion(fetch, place) {
|
|
1336
1354
|
const address = place.trim();
|
|
1337
1355
|
if (!address)
|
|
1338
1356
|
return null;
|
|
1339
1357
|
let located;
|
|
1340
1358
|
try {
|
|
1341
|
-
located = await fetch
|
|
1342
|
-
method: "GET"
|
|
1343
|
-
});
|
|
1359
|
+
located = await geolocate(fetch, { address });
|
|
1344
1360
|
} catch (error) {
|
|
1345
1361
|
if (statusOf(error) === 404)
|
|
1346
1362
|
return null;
|
|
@@ -1941,7 +1957,6 @@ var commerceMarketCapabilities = [
|
|
|
1941
1957
|
import { z as z11 } from "zod";
|
|
1942
1958
|
|
|
1943
1959
|
// ../../packages/capabilities/dist/spec-catalog.js
|
|
1944
|
-
var HARDWARE_CATALOG_PATH = "/v1/orchestrator/catalog/hardware";
|
|
1945
1960
|
var UNRESOLVED_CATALOG_HINT = "Leave this field empty. Only dictionary.csv product names are allowed. Do not ask to add spec-sheet text to the dictionary.";
|
|
1946
1961
|
var HARDWARE_LISTING_FIELDS = [
|
|
1947
1962
|
{ field: "gpu_type", kind: "gpu" },
|
|
@@ -1994,7 +2009,7 @@ function parseHardwareCatalog(payload) {
|
|
|
1994
2009
|
return { terms };
|
|
1995
2010
|
}
|
|
1996
2011
|
async function loadHardwareCatalog(fetchImpl) {
|
|
1997
|
-
return parseHardwareCatalog(await fetchImpl
|
|
2012
|
+
return parseHardwareCatalog(await getHardwareCatalog(fetchImpl));
|
|
1998
2013
|
}
|
|
1999
2014
|
var UNKNOWN_GPU = "Unknown GPU";
|
|
2000
2015
|
function gpuDisplay(terms, slug) {
|
|
@@ -5253,7 +5268,7 @@ var listCatalogTermsCapability = defineCapability({
|
|
|
5253
5268
|
roles: ["admin"],
|
|
5254
5269
|
description: "Dump the orchestrator hardware dictionary (display name + aliases). Call once and pick from it. Hardware fields on listings must match a term. Optional kind filter: gpu, cpu, node, or link.",
|
|
5255
5270
|
mutation: "read",
|
|
5256
|
-
http: { method: "GET", path:
|
|
5271
|
+
http: { method: "GET", path: hardwareCatalogPath },
|
|
5257
5272
|
slack: {
|
|
5258
5273
|
parameters: {
|
|
5259
5274
|
type: "object",
|
|
@@ -8072,15 +8087,10 @@ var LEGACY_CLI_MIGRATIONS = [
|
|
|
8072
8087
|
function findLegacyCliMigration(argv) {
|
|
8073
8088
|
return [...LEGACY_CLI_MIGRATIONS].sort((left, right) => right.legacy.length - left.legacy.length).find((entry) => entry.legacy.every((part, index) => argv[index] === part)) ?? null;
|
|
8074
8089
|
}
|
|
8075
|
-
|
|
8076
|
-
// ../../packages/capabilities/dist/software-catalog.js
|
|
8077
|
-
var SOFTWARE_CATALOG_PATH = "/v1/orchestrator/catalog/software";
|
|
8078
8090
|
export {
|
|
8079
8091
|
ADMIN_CLI_ROOTS,
|
|
8080
8092
|
CLI_MIGRATION_GUIDE_URL,
|
|
8081
|
-
HARDWARE_CATALOG_PATH,
|
|
8082
8093
|
LEGACY_CLI_MIGRATIONS,
|
|
8083
|
-
SOFTWARE_CATALOG_PATH,
|
|
8084
8094
|
byCliCommand,
|
|
8085
8095
|
byMcpName,
|
|
8086
8096
|
catalog,
|