@tensorlakeai/tensorlake 0.5.154 → 0.5.156
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/applications/index.cjs +131 -40
- package/dist/applications/index.cjs.map +1 -1
- package/dist/applications/index.d.cts +3 -3
- package/dist/applications/index.d.ts +3 -3
- package/dist/applications/index.js +131 -40
- package/dist/applications/index.js.map +1 -1
- package/dist/function-agent/main.cjs +1 -1
- package/dist/function-agent/main.js +1 -1
- package/dist/function-executor/main.cjs +2 -2
- package/dist/function-executor/main.js +2 -2
- package/dist/index.cjs +151 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -23
- package/dist/index.d.ts +25 -23
- package/dist/index.js +151 -47
- package/dist/index.js.map +1 -1
- package/dist/{remote-B3vn4tt1.d.cts → remote-CEs4GFGP.d.cts} +1 -1
- package/dist/{remote-DqBUuciu.d.ts → remote-DYBXCTNC.d.ts} +1 -1
- package/dist/{sandbox-image-BMiFlzAs.d.cts → sandbox-image-C2GTVnx3.d.cts} +99 -52
- package/dist/{sandbox-image-BMiFlzAs.d.ts → sandbox-image-C2GTVnx3.d.ts} +99 -52
- package/dist/sandbox-image.cjs +119 -30
- package/dist/sandbox-image.cjs.map +1 -1
- package/dist/sandbox-image.d.cts +1 -1
- package/dist/sandbox-image.d.ts +1 -1
- package/dist/sandbox-image.js +119 -30
- package/dist/sandbox-image.js.map +1 -1
- package/package.json +7 -7
- package/runtime/function-executor/manifest.json +5 -5
- package/runtime/function-executor/package/dist/function-executor/main.js +2 -2
- package/runtime/function-executor/package/npm-shrinkwrap.json +2 -2
- package/runtime/function-executor/package/package.json +1 -1
- package/runtime/typescript-function-runner/manifest.json +5 -5
- package/runtime/typescript-function-runner/package/dist/function-agent/main.js +1 -1
- package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +26 -26
- package/runtime/typescript-function-runner/package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CloudClientOptions, A as ApplicationManifest, F as FileSystem, a as ApplicationSummary, R as RequestInput, b as RequestOutput, I as Image } from './sandbox-image-
|
|
1
|
+
import { C as CloudClientOptions, A as ApplicationManifest, F as FileSystem, a as ApplicationSummary, R as RequestInput, b as RequestOutput, I as Image } from './sandbox-image-C2GTVnx3.cjs';
|
|
2
2
|
|
|
3
3
|
declare class APIClient {
|
|
4
4
|
private readonly cloudClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CloudClientOptions, A as ApplicationManifest, F as FileSystem, a as ApplicationSummary, R as RequestInput, b as RequestOutput, I as Image } from './sandbox-image-
|
|
1
|
+
import { C as CloudClientOptions, A as ApplicationManifest, F as FileSystem, a as ApplicationSummary, R as RequestInput, b as RequestOutput, I as Image } from './sandbox-image-C2GTVnx3.js';
|
|
2
2
|
|
|
3
3
|
declare class APIClient {
|
|
4
4
|
private readonly cloudClient;
|
|
@@ -137,12 +137,12 @@ interface ApplicationBuildResponse {
|
|
|
137
137
|
imageBuilds: ApplicationBuildImageResult[];
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
|
-
* A registered sandbox image in the
|
|
141
|
-
* families answer it: legacy
|
|
142
|
-
* CAS images (`snapshotFormatVersion ===
|
|
143
|
-
* derived by the core from the
|
|
144
|
-
* snapshot id, visibility, sizes,
|
|
145
|
-
* provenance rides on either.
|
|
140
|
+
* A registered CAS or legacy sandbox image in the sandbox-template shape.
|
|
141
|
+
* Both image families answer it: legacy images verbatim from the legacy image
|
|
142
|
+
* registry, and CAS images (`snapshotFormatVersion ===
|
|
143
|
+
* "content_addressed_streaming_v1"`) derived by the core from the CAS image
|
|
144
|
+
* registry's trimmed record (id, name, snapshot id, visibility, sizes,
|
|
145
|
+
* timestamps); no content digest or build provenance rides on either.
|
|
146
146
|
*/
|
|
147
147
|
interface SandboxTemplate {
|
|
148
148
|
id?: string;
|
|
@@ -208,10 +208,11 @@ declare class Image {
|
|
|
208
208
|
run(commands: string | string[], options?: Record<string, string> | undefined): this;
|
|
209
209
|
workdir(directory: string): this;
|
|
210
210
|
/**
|
|
211
|
-
* Build this image as a sandbox
|
|
211
|
+
* Build this image and register it as a CAS sandbox image (the default) or,
|
|
212
|
+
* with `cas: false`, a legacy sandbox image.
|
|
212
213
|
*
|
|
213
214
|
* Materializes the image in a build sandbox, snapshots the filesystem,
|
|
214
|
-
* and registers the snapshot
|
|
215
|
+
* and registers the snapshot under the image's name.
|
|
215
216
|
*/
|
|
216
217
|
build(options?: CreateSandboxImageOptions): Promise<Record<string, unknown>>;
|
|
217
218
|
private _addOperation;
|
|
@@ -235,6 +236,14 @@ interface CreateSandboxImageOptions {
|
|
|
235
236
|
* Pass "{}" to disable discovery and use no registry credentials.
|
|
236
237
|
*/
|
|
237
238
|
dockerConfigJson?: string;
|
|
239
|
+
/**
|
|
240
|
+
* Name to register the image under. Defaults to the image's `name` or the
|
|
241
|
+
* Dockerfile stem (the parent directory's name for a file named
|
|
242
|
+
* `Dockerfile`).
|
|
243
|
+
* A CAS image name is lowercased, as the CAS image registry stores it; a
|
|
244
|
+
* default CAS image name is also made valid (other characters become `-`).
|
|
245
|
+
* Legacy image names are kept as given.
|
|
246
|
+
*/
|
|
238
247
|
registeredName?: string;
|
|
239
248
|
cpus?: number;
|
|
240
249
|
memoryMb?: number;
|
|
@@ -257,22 +266,22 @@ interface CreateSandboxImageOptions {
|
|
|
257
266
|
*/
|
|
258
267
|
dockerCompat?: boolean;
|
|
259
268
|
/**
|
|
260
|
-
* Build a CAS (content-addressed streaming) image
|
|
261
|
-
*
|
|
269
|
+
* Build a CAS (content-addressed streaming) image, the default. Pass
|
|
270
|
+
* `false` to build a legacy image instead.
|
|
262
271
|
*/
|
|
263
272
|
cas?: boolean;
|
|
264
273
|
/**
|
|
265
274
|
* Dockerfile build args (`--build-arg KEY=VALUE`), forwarded to BuildKit
|
|
266
|
-
* and expanded in `FROM` references. CAS
|
|
267
|
-
* build args is rejected.
|
|
275
|
+
* and expanded in `FROM` references. CAS images only; a legacy image build
|
|
276
|
+
* with build args is rejected.
|
|
268
277
|
*/
|
|
269
278
|
buildArgs?: Record<string, string>;
|
|
270
279
|
/**
|
|
271
|
-
* CAS
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
* Abandoning the promise alone never cancels anything.
|
|
280
|
+
* CAS images only: aborting requests *remote cancellation* of the CAS
|
|
281
|
+
* image build through a bounded handshake, and the call rejects with
|
|
282
|
+
* `ImageBuildInterruptedError` carrying the outcome. It is rejected for a
|
|
283
|
+
* legacy image build (`cas: false`), which has no build operation to
|
|
284
|
+
* cancel. Abandoning the promise alone never cancels anything.
|
|
276
285
|
*/
|
|
277
286
|
signal?: AbortSignal;
|
|
278
287
|
/**
|
|
@@ -293,6 +302,9 @@ interface ImportSandboxImageOptions {
|
|
|
293
302
|
* Name to register the image under. Defaults to the image reference's last
|
|
294
303
|
* path segment with any tag/digest stripped (e.g. `pytorch/pytorch:2.4.1`
|
|
295
304
|
* -> `pytorch`).
|
|
305
|
+
* A CAS image name is lowercased, as the CAS image registry stores it; a
|
|
306
|
+
* default CAS image name is also made valid (other characters become `-`).
|
|
307
|
+
* Legacy image names are kept as given.
|
|
296
308
|
*/
|
|
297
309
|
registeredName?: string;
|
|
298
310
|
cpus?: number;
|
|
@@ -306,13 +318,13 @@ interface ImportSandboxImageOptions {
|
|
|
306
318
|
*/
|
|
307
319
|
dockerCompat?: boolean;
|
|
308
320
|
/**
|
|
309
|
-
* Import as a CAS (content-addressed streaming) image
|
|
310
|
-
*
|
|
321
|
+
* Import as a CAS (content-addressed streaming) image, the default. Pass
|
|
322
|
+
* `false` to import a legacy image instead.
|
|
311
323
|
*/
|
|
312
324
|
cas?: boolean;
|
|
313
325
|
/**
|
|
314
|
-
* CAS
|
|
315
|
-
*
|
|
326
|
+
* CAS images only: aborting requests remote cancellation of the CAS image
|
|
327
|
+
* import; see `CreateSandboxImageOptions.signal`.
|
|
316
328
|
*/
|
|
317
329
|
signal?: AbortSignal;
|
|
318
330
|
/**
|
|
@@ -415,8 +427,12 @@ interface NativeBinding {
|
|
|
415
427
|
listSandboxImages(options: NativeBindingCatalogOptions): Promise<string>;
|
|
416
428
|
/** JSON record of one image by name or id, or null when unknown. */
|
|
417
429
|
findSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<string | null>;
|
|
418
|
-
/**
|
|
419
|
-
|
|
430
|
+
/**
|
|
431
|
+
* Delete one image by name or id; a name is deleted from both catalogs.
|
|
432
|
+
* Unknown in both catalogs rejects. Resolves to the same-named legacy
|
|
433
|
+
* image a name's CAS delete could not remove, or null.
|
|
434
|
+
*/
|
|
435
|
+
deleteSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<NativeLegacyCleanupFailure | null | undefined>;
|
|
420
436
|
}
|
|
421
437
|
/** Test seam: replace the native binding with a stub. */
|
|
422
438
|
declare function __setNativeBindingForTest(binding: NativeBinding | undefined): void;
|
|
@@ -431,9 +447,9 @@ interface BuildContext {
|
|
|
431
447
|
}
|
|
432
448
|
declare function buildContextFromEnv(): BuildContext;
|
|
433
449
|
/**
|
|
434
|
-
* @internal Shared with `image-builds.ts`, which implements the
|
|
435
|
-
*
|
|
436
|
-
*
|
|
450
|
+
* @internal Shared with `image-builds.ts`, which implements the CAS image
|
|
451
|
+
* build operations on top of the same native binding and environment
|
|
452
|
+
* context.
|
|
437
453
|
*/
|
|
438
454
|
declare const __imageBuildInternals: {
|
|
439
455
|
loadNativeBinding: () => NativeBinding;
|
|
@@ -444,6 +460,11 @@ declare const __imageBuildInternals: {
|
|
|
444
460
|
imageRequiresContext: (image: Image) => boolean;
|
|
445
461
|
defaultRegisteredName: (dockerfilePath: string) => string;
|
|
446
462
|
defaultRegisteredNameFromImage: (reference: string) => string;
|
|
463
|
+
registeredImageName: (explicit: string | undefined, generated: string | undefined, cas: boolean, fallback?: string) => string;
|
|
464
|
+
casImageNameFrom: (raw: string, fallback: string) => string;
|
|
465
|
+
canonicalCasImageName: (name: string) => string;
|
|
466
|
+
isAddressableCasImageName: (name: string) => boolean;
|
|
467
|
+
defaultImportedImageName: string;
|
|
447
468
|
};
|
|
448
469
|
declare function createSandboxImage(source: SandboxImageSource, options?: CreateSandboxImageOptions, deps?: CreateSandboxImageDeps): Promise<Record<string, unknown>>;
|
|
449
470
|
/**
|
|
@@ -466,47 +487,73 @@ interface SandboxImageCatalogCredentials {
|
|
|
466
487
|
projectId?: string;
|
|
467
488
|
}
|
|
468
489
|
/**
|
|
469
|
-
* Delete a registered sandbox image by name or id. Both
|
|
470
|
-
* covered: an `image_` id or a name registered in the
|
|
471
|
-
* a CAS image, a `sandbox_template_` id or a name registered
|
|
472
|
-
*
|
|
473
|
-
* knows the reference.
|
|
490
|
+
* Delete a registered CAS or legacy sandbox image by name or id. Both
|
|
491
|
+
* families are covered: an `image_` id or a name registered in the CAS image
|
|
492
|
+
* registry deletes a CAS image, a `sandbox_template_` id or a name registered
|
|
493
|
+
* only in the legacy image registry deletes a legacy image. Rejects when
|
|
494
|
+
* neither the CAS nor the legacy image registry knows the reference.
|
|
495
|
+
*
|
|
496
|
+
* A name is deleted from both the CAS and the legacy image registries: once
|
|
497
|
+
* its CAS image is deleted, a legacy image of the same name can no longer
|
|
498
|
+
* start sandboxes, so it is deleted too. CAS image names ignore case
|
|
499
|
+
* (`MyProject` deletes the CAS image `myproject`), legacy image names match
|
|
500
|
+
* exactly. Failing to delete that legacy image
|
|
501
|
+
* does not reject, since the CAS image is already gone: a `console.warn`
|
|
502
|
+
* names the legacy image, the error and the call that deletes it. An
|
|
503
|
+
* `image_` or `sandbox_template_` id deletes only the image it names.
|
|
474
504
|
*
|
|
475
|
-
* Deleting removes a *published* image. An unfinished CAS build is
|
|
476
|
-
* with `cancelImageBuild({ buildId })` (or `tl sbx image build
|
|
477
|
-
* BUILD_ID`), never by deleting its name: a name whose only state is
|
|
478
|
-
* unfinished first build has no image, so the
|
|
479
|
-
* the lookup falls through to the
|
|
480
|
-
* (deletion in progress) counts as success; a 409
|
|
481
|
-
* a 5xx or a transport failure rejects as is and
|
|
505
|
+
* Deleting removes a *published* image. An unfinished CAS image build is
|
|
506
|
+
* cancelled with `cancelImageBuild({ buildId })` (or `tl sbx image build
|
|
507
|
+
* cancel BUILD_ID`), never by deleting its name: a name whose only state is
|
|
508
|
+
* an unfinished first build has no CAS image, so the CAS image registry
|
|
509
|
+
* answers 404 and the lookup falls through to the legacy image registry as
|
|
510
|
+
* usual. A 202 (deletion in progress) counts as success; a 409
|
|
511
|
+
* `image_build_in_progress`, a 5xx or a transport failure rejects as is and
|
|
512
|
+
* never falls through.
|
|
482
513
|
*
|
|
483
514
|
* Accepted merged-catalog differences from the released SDKs, for legacy
|
|
484
|
-
* images: this
|
|
485
|
-
* only
|
|
486
|
-
*
|
|
515
|
+
* images: this removes the legacy image from the legacy image registry (the
|
|
516
|
+
* released SDKs only made it unusable and left it listed), and an unknown
|
|
517
|
+
* name rejects instead of succeeding silently.
|
|
487
518
|
*/
|
|
488
519
|
declare function deleteSandboxImage(imageName: string): Promise<void>;
|
|
489
520
|
/** @internal `APIClient.deleteSandboxImage` with the client's credentials. */
|
|
490
521
|
declare function deleteSandboxImageWithCredentials(credentials: SandboxImageCatalogCredentials, imageName: string): Promise<void>;
|
|
491
522
|
/**
|
|
492
|
-
*
|
|
523
|
+
* The same-named legacy image a name's CAS delete could not remove. Its name
|
|
524
|
+
* is the deleted CAS image's name, in the CAS image registry's lowercase
|
|
525
|
+
* spelling.
|
|
526
|
+
*/
|
|
527
|
+
interface NativeLegacyCleanupFailure {
|
|
528
|
+
legacyImageName: string;
|
|
529
|
+
legacyImageId?: string | null;
|
|
530
|
+
error: string;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Look up a registered CAS or legacy sandbox image by its registered name or
|
|
534
|
+
* id.
|
|
493
535
|
*
|
|
494
536
|
* Returns the image in the sandbox-template shape (CAS images carry
|
|
495
537
|
* `snapshotFormatVersion === "content_addressed_streaming_v1"`; the shape is
|
|
496
|
-
* derived from the
|
|
497
|
-
* build provenance rides on it), or `null` if neither the
|
|
498
|
-
*
|
|
499
|
-
* auth as `createSandboxImage`. Ingress derives project scope from
|
|
538
|
+
* derived from the CAS image registry's trimmed record, so no content digest
|
|
539
|
+
* or build provenance rides on it), or `null` if neither the CAS nor the
|
|
540
|
+
* legacy image registry knows the reference. Uses the same environment-based
|
|
541
|
+
* Tensorlake auth as `createSandboxImage`. Ingress derives project scope from
|
|
542
|
+
* the API key.
|
|
500
543
|
*
|
|
501
|
-
* An `image_` id names the *current* image under its name; a rebuild
|
|
544
|
+
* An `image_` id names the *current* CAS image under its name; a rebuild
|
|
502
545
|
* replaces it. A build's own immutable result is read with `getImageBuild`.
|
|
503
546
|
*
|
|
547
|
+
* A name is looked up in the CAS image registry in lowercase, as the
|
|
548
|
+
* registry stores it, and in the legacy image registry exactly as given.
|
|
549
|
+
*
|
|
504
550
|
* Accepted merged-catalog difference from the released SDKs, for legacy
|
|
505
|
-
* images: a name that fits the
|
|
506
|
-
* and only a clean 404 falls through to the
|
|
507
|
-
*
|
|
508
|
-
* where the released SDKs touched only
|
|
509
|
-
* never consults the
|
|
551
|
+
* images: a name that fits the CAS image registry's grammar is looked up
|
|
552
|
+
* there first and only a clean 404 falls through to the legacy image
|
|
553
|
+
* registry, so CAS image registry unavailability (or a deploy 5xx) rejects
|
|
554
|
+
* the lookup of a legacy image name where the released SDKs touched only the
|
|
555
|
+
* legacy image registry. A `sandbox_template_` id never consults the CAS
|
|
556
|
+
* image registry.
|
|
510
557
|
*/
|
|
511
558
|
declare function findSandboxImageByName(imageName: string): Promise<SandboxTemplate | null>;
|
|
512
559
|
/** @internal `CloudClient.findSandboxImageByName` with the client's credentials. */
|
|
@@ -137,12 +137,12 @@ interface ApplicationBuildResponse {
|
|
|
137
137
|
imageBuilds: ApplicationBuildImageResult[];
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
|
-
* A registered sandbox image in the
|
|
141
|
-
* families answer it: legacy
|
|
142
|
-
* CAS images (`snapshotFormatVersion ===
|
|
143
|
-
* derived by the core from the
|
|
144
|
-
* snapshot id, visibility, sizes,
|
|
145
|
-
* provenance rides on either.
|
|
140
|
+
* A registered CAS or legacy sandbox image in the sandbox-template shape.
|
|
141
|
+
* Both image families answer it: legacy images verbatim from the legacy image
|
|
142
|
+
* registry, and CAS images (`snapshotFormatVersion ===
|
|
143
|
+
* "content_addressed_streaming_v1"`) derived by the core from the CAS image
|
|
144
|
+
* registry's trimmed record (id, name, snapshot id, visibility, sizes,
|
|
145
|
+
* timestamps); no content digest or build provenance rides on either.
|
|
146
146
|
*/
|
|
147
147
|
interface SandboxTemplate {
|
|
148
148
|
id?: string;
|
|
@@ -208,10 +208,11 @@ declare class Image {
|
|
|
208
208
|
run(commands: string | string[], options?: Record<string, string> | undefined): this;
|
|
209
209
|
workdir(directory: string): this;
|
|
210
210
|
/**
|
|
211
|
-
* Build this image as a sandbox
|
|
211
|
+
* Build this image and register it as a CAS sandbox image (the default) or,
|
|
212
|
+
* with `cas: false`, a legacy sandbox image.
|
|
212
213
|
*
|
|
213
214
|
* Materializes the image in a build sandbox, snapshots the filesystem,
|
|
214
|
-
* and registers the snapshot
|
|
215
|
+
* and registers the snapshot under the image's name.
|
|
215
216
|
*/
|
|
216
217
|
build(options?: CreateSandboxImageOptions): Promise<Record<string, unknown>>;
|
|
217
218
|
private _addOperation;
|
|
@@ -235,6 +236,14 @@ interface CreateSandboxImageOptions {
|
|
|
235
236
|
* Pass "{}" to disable discovery and use no registry credentials.
|
|
236
237
|
*/
|
|
237
238
|
dockerConfigJson?: string;
|
|
239
|
+
/**
|
|
240
|
+
* Name to register the image under. Defaults to the image's `name` or the
|
|
241
|
+
* Dockerfile stem (the parent directory's name for a file named
|
|
242
|
+
* `Dockerfile`).
|
|
243
|
+
* A CAS image name is lowercased, as the CAS image registry stores it; a
|
|
244
|
+
* default CAS image name is also made valid (other characters become `-`).
|
|
245
|
+
* Legacy image names are kept as given.
|
|
246
|
+
*/
|
|
238
247
|
registeredName?: string;
|
|
239
248
|
cpus?: number;
|
|
240
249
|
memoryMb?: number;
|
|
@@ -257,22 +266,22 @@ interface CreateSandboxImageOptions {
|
|
|
257
266
|
*/
|
|
258
267
|
dockerCompat?: boolean;
|
|
259
268
|
/**
|
|
260
|
-
* Build a CAS (content-addressed streaming) image
|
|
261
|
-
*
|
|
269
|
+
* Build a CAS (content-addressed streaming) image, the default. Pass
|
|
270
|
+
* `false` to build a legacy image instead.
|
|
262
271
|
*/
|
|
263
272
|
cas?: boolean;
|
|
264
273
|
/**
|
|
265
274
|
* Dockerfile build args (`--build-arg KEY=VALUE`), forwarded to BuildKit
|
|
266
|
-
* and expanded in `FROM` references. CAS
|
|
267
|
-
* build args is rejected.
|
|
275
|
+
* and expanded in `FROM` references. CAS images only; a legacy image build
|
|
276
|
+
* with build args is rejected.
|
|
268
277
|
*/
|
|
269
278
|
buildArgs?: Record<string, string>;
|
|
270
279
|
/**
|
|
271
|
-
* CAS
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
* Abandoning the promise alone never cancels anything.
|
|
280
|
+
* CAS images only: aborting requests *remote cancellation* of the CAS
|
|
281
|
+
* image build through a bounded handshake, and the call rejects with
|
|
282
|
+
* `ImageBuildInterruptedError` carrying the outcome. It is rejected for a
|
|
283
|
+
* legacy image build (`cas: false`), which has no build operation to
|
|
284
|
+
* cancel. Abandoning the promise alone never cancels anything.
|
|
276
285
|
*/
|
|
277
286
|
signal?: AbortSignal;
|
|
278
287
|
/**
|
|
@@ -293,6 +302,9 @@ interface ImportSandboxImageOptions {
|
|
|
293
302
|
* Name to register the image under. Defaults to the image reference's last
|
|
294
303
|
* path segment with any tag/digest stripped (e.g. `pytorch/pytorch:2.4.1`
|
|
295
304
|
* -> `pytorch`).
|
|
305
|
+
* A CAS image name is lowercased, as the CAS image registry stores it; a
|
|
306
|
+
* default CAS image name is also made valid (other characters become `-`).
|
|
307
|
+
* Legacy image names are kept as given.
|
|
296
308
|
*/
|
|
297
309
|
registeredName?: string;
|
|
298
310
|
cpus?: number;
|
|
@@ -306,13 +318,13 @@ interface ImportSandboxImageOptions {
|
|
|
306
318
|
*/
|
|
307
319
|
dockerCompat?: boolean;
|
|
308
320
|
/**
|
|
309
|
-
* Import as a CAS (content-addressed streaming) image
|
|
310
|
-
*
|
|
321
|
+
* Import as a CAS (content-addressed streaming) image, the default. Pass
|
|
322
|
+
* `false` to import a legacy image instead.
|
|
311
323
|
*/
|
|
312
324
|
cas?: boolean;
|
|
313
325
|
/**
|
|
314
|
-
* CAS
|
|
315
|
-
*
|
|
326
|
+
* CAS images only: aborting requests remote cancellation of the CAS image
|
|
327
|
+
* import; see `CreateSandboxImageOptions.signal`.
|
|
316
328
|
*/
|
|
317
329
|
signal?: AbortSignal;
|
|
318
330
|
/**
|
|
@@ -415,8 +427,12 @@ interface NativeBinding {
|
|
|
415
427
|
listSandboxImages(options: NativeBindingCatalogOptions): Promise<string>;
|
|
416
428
|
/** JSON record of one image by name or id, or null when unknown. */
|
|
417
429
|
findSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<string | null>;
|
|
418
|
-
/**
|
|
419
|
-
|
|
430
|
+
/**
|
|
431
|
+
* Delete one image by name or id; a name is deleted from both catalogs.
|
|
432
|
+
* Unknown in both catalogs rejects. Resolves to the same-named legacy
|
|
433
|
+
* image a name's CAS delete could not remove, or null.
|
|
434
|
+
*/
|
|
435
|
+
deleteSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<NativeLegacyCleanupFailure | null | undefined>;
|
|
420
436
|
}
|
|
421
437
|
/** Test seam: replace the native binding with a stub. */
|
|
422
438
|
declare function __setNativeBindingForTest(binding: NativeBinding | undefined): void;
|
|
@@ -431,9 +447,9 @@ interface BuildContext {
|
|
|
431
447
|
}
|
|
432
448
|
declare function buildContextFromEnv(): BuildContext;
|
|
433
449
|
/**
|
|
434
|
-
* @internal Shared with `image-builds.ts`, which implements the
|
|
435
|
-
*
|
|
436
|
-
*
|
|
450
|
+
* @internal Shared with `image-builds.ts`, which implements the CAS image
|
|
451
|
+
* build operations on top of the same native binding and environment
|
|
452
|
+
* context.
|
|
437
453
|
*/
|
|
438
454
|
declare const __imageBuildInternals: {
|
|
439
455
|
loadNativeBinding: () => NativeBinding;
|
|
@@ -444,6 +460,11 @@ declare const __imageBuildInternals: {
|
|
|
444
460
|
imageRequiresContext: (image: Image) => boolean;
|
|
445
461
|
defaultRegisteredName: (dockerfilePath: string) => string;
|
|
446
462
|
defaultRegisteredNameFromImage: (reference: string) => string;
|
|
463
|
+
registeredImageName: (explicit: string | undefined, generated: string | undefined, cas: boolean, fallback?: string) => string;
|
|
464
|
+
casImageNameFrom: (raw: string, fallback: string) => string;
|
|
465
|
+
canonicalCasImageName: (name: string) => string;
|
|
466
|
+
isAddressableCasImageName: (name: string) => boolean;
|
|
467
|
+
defaultImportedImageName: string;
|
|
447
468
|
};
|
|
448
469
|
declare function createSandboxImage(source: SandboxImageSource, options?: CreateSandboxImageOptions, deps?: CreateSandboxImageDeps): Promise<Record<string, unknown>>;
|
|
449
470
|
/**
|
|
@@ -466,47 +487,73 @@ interface SandboxImageCatalogCredentials {
|
|
|
466
487
|
projectId?: string;
|
|
467
488
|
}
|
|
468
489
|
/**
|
|
469
|
-
* Delete a registered sandbox image by name or id. Both
|
|
470
|
-
* covered: an `image_` id or a name registered in the
|
|
471
|
-
* a CAS image, a `sandbox_template_` id or a name registered
|
|
472
|
-
*
|
|
473
|
-
* knows the reference.
|
|
490
|
+
* Delete a registered CAS or legacy sandbox image by name or id. Both
|
|
491
|
+
* families are covered: an `image_` id or a name registered in the CAS image
|
|
492
|
+
* registry deletes a CAS image, a `sandbox_template_` id or a name registered
|
|
493
|
+
* only in the legacy image registry deletes a legacy image. Rejects when
|
|
494
|
+
* neither the CAS nor the legacy image registry knows the reference.
|
|
495
|
+
*
|
|
496
|
+
* A name is deleted from both the CAS and the legacy image registries: once
|
|
497
|
+
* its CAS image is deleted, a legacy image of the same name can no longer
|
|
498
|
+
* start sandboxes, so it is deleted too. CAS image names ignore case
|
|
499
|
+
* (`MyProject` deletes the CAS image `myproject`), legacy image names match
|
|
500
|
+
* exactly. Failing to delete that legacy image
|
|
501
|
+
* does not reject, since the CAS image is already gone: a `console.warn`
|
|
502
|
+
* names the legacy image, the error and the call that deletes it. An
|
|
503
|
+
* `image_` or `sandbox_template_` id deletes only the image it names.
|
|
474
504
|
*
|
|
475
|
-
* Deleting removes a *published* image. An unfinished CAS build is
|
|
476
|
-
* with `cancelImageBuild({ buildId })` (or `tl sbx image build
|
|
477
|
-
* BUILD_ID`), never by deleting its name: a name whose only state is
|
|
478
|
-
* unfinished first build has no image, so the
|
|
479
|
-
* the lookup falls through to the
|
|
480
|
-
* (deletion in progress) counts as success; a 409
|
|
481
|
-
* a 5xx or a transport failure rejects as is and
|
|
505
|
+
* Deleting removes a *published* image. An unfinished CAS image build is
|
|
506
|
+
* cancelled with `cancelImageBuild({ buildId })` (or `tl sbx image build
|
|
507
|
+
* cancel BUILD_ID`), never by deleting its name: a name whose only state is
|
|
508
|
+
* an unfinished first build has no CAS image, so the CAS image registry
|
|
509
|
+
* answers 404 and the lookup falls through to the legacy image registry as
|
|
510
|
+
* usual. A 202 (deletion in progress) counts as success; a 409
|
|
511
|
+
* `image_build_in_progress`, a 5xx or a transport failure rejects as is and
|
|
512
|
+
* never falls through.
|
|
482
513
|
*
|
|
483
514
|
* Accepted merged-catalog differences from the released SDKs, for legacy
|
|
484
|
-
* images: this
|
|
485
|
-
* only
|
|
486
|
-
*
|
|
515
|
+
* images: this removes the legacy image from the legacy image registry (the
|
|
516
|
+
* released SDKs only made it unusable and left it listed), and an unknown
|
|
517
|
+
* name rejects instead of succeeding silently.
|
|
487
518
|
*/
|
|
488
519
|
declare function deleteSandboxImage(imageName: string): Promise<void>;
|
|
489
520
|
/** @internal `APIClient.deleteSandboxImage` with the client's credentials. */
|
|
490
521
|
declare function deleteSandboxImageWithCredentials(credentials: SandboxImageCatalogCredentials, imageName: string): Promise<void>;
|
|
491
522
|
/**
|
|
492
|
-
*
|
|
523
|
+
* The same-named legacy image a name's CAS delete could not remove. Its name
|
|
524
|
+
* is the deleted CAS image's name, in the CAS image registry's lowercase
|
|
525
|
+
* spelling.
|
|
526
|
+
*/
|
|
527
|
+
interface NativeLegacyCleanupFailure {
|
|
528
|
+
legacyImageName: string;
|
|
529
|
+
legacyImageId?: string | null;
|
|
530
|
+
error: string;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Look up a registered CAS or legacy sandbox image by its registered name or
|
|
534
|
+
* id.
|
|
493
535
|
*
|
|
494
536
|
* Returns the image in the sandbox-template shape (CAS images carry
|
|
495
537
|
* `snapshotFormatVersion === "content_addressed_streaming_v1"`; the shape is
|
|
496
|
-
* derived from the
|
|
497
|
-
* build provenance rides on it), or `null` if neither the
|
|
498
|
-
*
|
|
499
|
-
* auth as `createSandboxImage`. Ingress derives project scope from
|
|
538
|
+
* derived from the CAS image registry's trimmed record, so no content digest
|
|
539
|
+
* or build provenance rides on it), or `null` if neither the CAS nor the
|
|
540
|
+
* legacy image registry knows the reference. Uses the same environment-based
|
|
541
|
+
* Tensorlake auth as `createSandboxImage`. Ingress derives project scope from
|
|
542
|
+
* the API key.
|
|
500
543
|
*
|
|
501
|
-
* An `image_` id names the *current* image under its name; a rebuild
|
|
544
|
+
* An `image_` id names the *current* CAS image under its name; a rebuild
|
|
502
545
|
* replaces it. A build's own immutable result is read with `getImageBuild`.
|
|
503
546
|
*
|
|
547
|
+
* A name is looked up in the CAS image registry in lowercase, as the
|
|
548
|
+
* registry stores it, and in the legacy image registry exactly as given.
|
|
549
|
+
*
|
|
504
550
|
* Accepted merged-catalog difference from the released SDKs, for legacy
|
|
505
|
-
* images: a name that fits the
|
|
506
|
-
* and only a clean 404 falls through to the
|
|
507
|
-
*
|
|
508
|
-
* where the released SDKs touched only
|
|
509
|
-
* never consults the
|
|
551
|
+
* images: a name that fits the CAS image registry's grammar is looked up
|
|
552
|
+
* there first and only a clean 404 falls through to the legacy image
|
|
553
|
+
* registry, so CAS image registry unavailability (or a deploy 5xx) rejects
|
|
554
|
+
* the lookup of a legacy image name where the released SDKs touched only the
|
|
555
|
+
* legacy image registry. A `sandbox_template_` id never consults the CAS
|
|
556
|
+
* image registry.
|
|
510
557
|
*/
|
|
511
558
|
declare function findSandboxImageByName(imageName: string): Promise<SandboxTemplate | null>;
|
|
512
559
|
/** @internal `CloudClient.findSandboxImageByName` with the client's credentials. */
|