tensorlake 0.5.3 → 0.5.5
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/bin/darwin-arm64/tensorlake +0 -0
- package/dist/bin/darwin-arm64/tl +0 -0
- package/dist/bin/linux-x64/tensorlake +0 -0
- package/dist/bin/linux-x64/tl +0 -0
- package/dist/bin/win32-x64/tensorlake.exe +0 -0
- package/dist/bin/win32-x64/tl.exe +0 -0
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/{sandbox-image-B0WMhyoM.d.cts → sandbox-image-BmhjX2bC.d.cts} +22 -12
- package/dist/{sandbox-image-B0WMhyoM.d.ts → sandbox-image-BmhjX2bC.d.ts} +22 -12
- package/dist/sandbox-image.cjs +8 -8
- 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 +8 -8
- package/dist/sandbox-image.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,16 +12,25 @@ declare enum SnapshotStatus {
|
|
|
12
12
|
FAILED = "failed"
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Snapshot type for sandbox snapshot creation.
|
|
16
16
|
*
|
|
17
|
-
* - `"
|
|
18
|
-
*
|
|
19
|
-
* - `"
|
|
17
|
+
* - `"memory"`: Capture VM memory + filesystem state. Sandboxes restored
|
|
18
|
+
* from this snapshot warm-restore VM memory.
|
|
19
|
+
* - `"filesystem"`: Capture filesystem state only. Sandboxes restored from
|
|
20
20
|
* this snapshot cold-boot from the snapshot tarball instead of warm-
|
|
21
21
|
* restoring VM state. Use this for sandbox image builds so that the
|
|
22
22
|
* restored sandbox bypasses Firecracker's overlay-path constraints.
|
|
23
23
|
*/
|
|
24
|
-
type
|
|
24
|
+
type SnapshotType = "memory" | "filesystem";
|
|
25
|
+
/**
|
|
26
|
+
* Checkpoint type for {@link Sandbox.checkpoint}.
|
|
27
|
+
*
|
|
28
|
+
* - `"memory"`: Capture VM memory + filesystem state. Sandboxes restored
|
|
29
|
+
* from this checkpoint warm-restore VM memory and running processes.
|
|
30
|
+
* - `"filesystem"`: Capture filesystem state only. Sandboxes restored from
|
|
31
|
+
* this checkpoint cold-boot from the snapshot tarball.
|
|
32
|
+
*/
|
|
33
|
+
type CheckpointType = "memory" | "filesystem";
|
|
25
34
|
declare enum ProcessStatus {
|
|
26
35
|
RUNNING = "running",
|
|
27
36
|
EXITED = "exited",
|
|
@@ -120,6 +129,7 @@ interface SnapshotInfo {
|
|
|
120
129
|
sandboxId: string;
|
|
121
130
|
baseImage: string;
|
|
122
131
|
status: SnapshotStatus;
|
|
132
|
+
snapshotType?: SnapshotType;
|
|
123
133
|
error?: string;
|
|
124
134
|
snapshotUri?: string;
|
|
125
135
|
sizeBytes?: number;
|
|
@@ -128,11 +138,11 @@ interface SnapshotInfo {
|
|
|
128
138
|
}
|
|
129
139
|
interface SnapshotOptions {
|
|
130
140
|
/**
|
|
131
|
-
* Optional
|
|
132
|
-
*
|
|
133
|
-
*
|
|
141
|
+
* Optional snapshot type. When omitted the server picks its default. Use
|
|
142
|
+
* `"filesystem"` for snapshots intended for sandbox image builds so that
|
|
143
|
+
* restored sandboxes cold-boot.
|
|
134
144
|
*/
|
|
135
|
-
|
|
145
|
+
snapshotType?: SnapshotType;
|
|
136
146
|
}
|
|
137
147
|
interface SnapshotAndWaitOptions extends SnapshotOptions {
|
|
138
148
|
timeout?: number;
|
|
@@ -292,7 +302,7 @@ interface SuspendResumeOptions {
|
|
|
292
302
|
pollInterval?: number;
|
|
293
303
|
}
|
|
294
304
|
interface CheckpointOptions extends SuspendResumeOptions {
|
|
295
|
-
|
|
305
|
+
checkpointType?: CheckpointType;
|
|
296
306
|
}
|
|
297
307
|
interface ConnectOptions {
|
|
298
308
|
sandboxId: string;
|
|
@@ -413,7 +423,7 @@ interface BuildClient {
|
|
|
413
423
|
snapshotAndWait(sandboxId: string, options?: {
|
|
414
424
|
timeout?: number;
|
|
415
425
|
pollInterval?: number;
|
|
416
|
-
|
|
426
|
+
snapshotType?: SnapshotType;
|
|
417
427
|
}): Promise<SnapshotInfo>;
|
|
418
428
|
close(): void;
|
|
419
429
|
}
|
|
@@ -433,4 +443,4 @@ declare function loadImagePlan(image: Image, options?: Pick<CreateSandboxImageOp
|
|
|
433
443
|
declare function createSandboxImage(source: SandboxImageSource, options?: CreateSandboxImageOptions, deps?: CreateSandboxImageDeps): Promise<Record<string, unknown>>;
|
|
434
444
|
declare function runCreateSandboxImageCli(argv?: string[]): Promise<void>;
|
|
435
445
|
|
|
436
|
-
export {
|
|
446
|
+
export { defaultRegisteredName as $, type CreateSandboxImageOptions as A, type DirectoryEntry as B, type CreatePtySessionOptions as C, type DaemonInfo as D, type DockerfileBuildPlan as E, type DockerfileInstruction as F, type ImageBuildOperation as G, type HealthResponse as H, Image as I, ImageBuildOperationType as J, type ImageOptions as K, type ListDirectoryResponse as L, OutputMode as M, type NetworkConfig as N, type OutputResponse as O, type ProcessInfo as P, type PoolContainerInfo as Q, type RunOptions as R, type SandboxOptions as S, ProcessStatus as T, type UpdateSandboxOptions as U, type SandboxImageSource as V, SnapshotStatus as W, type SnapshotType as X, StdinMode as Y, createSandboxImage as Z, dockerfileContent as _, type CreateAndConnectOptions as a, loadDockerfilePlan as a0, loadImagePlan as a1, logicalDockerfileLines as a2, runCreateSandboxImageCli as a3, type SandboxClientOptions as b, type ConnectOptions as c, type SnapshotInfo as d, SandboxStatus as e, type SandboxInfo as f, type SuspendResumeOptions as g, type CheckpointOptions as h, type CommandResult as i, type StartProcessOptions as j, type SendSignalResponse as k, type OutputEvent as l, type PtySessionInfo as m, type CreateSandboxOptions as n, type CreateSandboxResponse as o, type SandboxPortAccess as p, type SnapshotOptions as q, type CreateSnapshotResponse as r, type SnapshotAndWaitOptions as s, type CreatePoolOptions as t, type CreateSandboxPoolResponse as u, type SandboxPoolInfo as v, type UpdatePoolOptions as w, type CheckpointType as x, type ContainerResourcesInfo as y, ContainerState as z };
|
|
@@ -12,16 +12,25 @@ declare enum SnapshotStatus {
|
|
|
12
12
|
FAILED = "failed"
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Snapshot type for sandbox snapshot creation.
|
|
16
16
|
*
|
|
17
|
-
* - `"
|
|
18
|
-
*
|
|
19
|
-
* - `"
|
|
17
|
+
* - `"memory"`: Capture VM memory + filesystem state. Sandboxes restored
|
|
18
|
+
* from this snapshot warm-restore VM memory.
|
|
19
|
+
* - `"filesystem"`: Capture filesystem state only. Sandboxes restored from
|
|
20
20
|
* this snapshot cold-boot from the snapshot tarball instead of warm-
|
|
21
21
|
* restoring VM state. Use this for sandbox image builds so that the
|
|
22
22
|
* restored sandbox bypasses Firecracker's overlay-path constraints.
|
|
23
23
|
*/
|
|
24
|
-
type
|
|
24
|
+
type SnapshotType = "memory" | "filesystem";
|
|
25
|
+
/**
|
|
26
|
+
* Checkpoint type for {@link Sandbox.checkpoint}.
|
|
27
|
+
*
|
|
28
|
+
* - `"memory"`: Capture VM memory + filesystem state. Sandboxes restored
|
|
29
|
+
* from this checkpoint warm-restore VM memory and running processes.
|
|
30
|
+
* - `"filesystem"`: Capture filesystem state only. Sandboxes restored from
|
|
31
|
+
* this checkpoint cold-boot from the snapshot tarball.
|
|
32
|
+
*/
|
|
33
|
+
type CheckpointType = "memory" | "filesystem";
|
|
25
34
|
declare enum ProcessStatus {
|
|
26
35
|
RUNNING = "running",
|
|
27
36
|
EXITED = "exited",
|
|
@@ -120,6 +129,7 @@ interface SnapshotInfo {
|
|
|
120
129
|
sandboxId: string;
|
|
121
130
|
baseImage: string;
|
|
122
131
|
status: SnapshotStatus;
|
|
132
|
+
snapshotType?: SnapshotType;
|
|
123
133
|
error?: string;
|
|
124
134
|
snapshotUri?: string;
|
|
125
135
|
sizeBytes?: number;
|
|
@@ -128,11 +138,11 @@ interface SnapshotInfo {
|
|
|
128
138
|
}
|
|
129
139
|
interface SnapshotOptions {
|
|
130
140
|
/**
|
|
131
|
-
* Optional
|
|
132
|
-
*
|
|
133
|
-
*
|
|
141
|
+
* Optional snapshot type. When omitted the server picks its default. Use
|
|
142
|
+
* `"filesystem"` for snapshots intended for sandbox image builds so that
|
|
143
|
+
* restored sandboxes cold-boot.
|
|
134
144
|
*/
|
|
135
|
-
|
|
145
|
+
snapshotType?: SnapshotType;
|
|
136
146
|
}
|
|
137
147
|
interface SnapshotAndWaitOptions extends SnapshotOptions {
|
|
138
148
|
timeout?: number;
|
|
@@ -292,7 +302,7 @@ interface SuspendResumeOptions {
|
|
|
292
302
|
pollInterval?: number;
|
|
293
303
|
}
|
|
294
304
|
interface CheckpointOptions extends SuspendResumeOptions {
|
|
295
|
-
|
|
305
|
+
checkpointType?: CheckpointType;
|
|
296
306
|
}
|
|
297
307
|
interface ConnectOptions {
|
|
298
308
|
sandboxId: string;
|
|
@@ -413,7 +423,7 @@ interface BuildClient {
|
|
|
413
423
|
snapshotAndWait(sandboxId: string, options?: {
|
|
414
424
|
timeout?: number;
|
|
415
425
|
pollInterval?: number;
|
|
416
|
-
|
|
426
|
+
snapshotType?: SnapshotType;
|
|
417
427
|
}): Promise<SnapshotInfo>;
|
|
418
428
|
close(): void;
|
|
419
429
|
}
|
|
@@ -433,4 +443,4 @@ declare function loadImagePlan(image: Image, options?: Pick<CreateSandboxImageOp
|
|
|
433
443
|
declare function createSandboxImage(source: SandboxImageSource, options?: CreateSandboxImageOptions, deps?: CreateSandboxImageDeps): Promise<Record<string, unknown>>;
|
|
434
444
|
declare function runCreateSandboxImageCli(argv?: string[]): Promise<void>;
|
|
435
445
|
|
|
436
|
-
export {
|
|
446
|
+
export { defaultRegisteredName as $, type CreateSandboxImageOptions as A, type DirectoryEntry as B, type CreatePtySessionOptions as C, type DaemonInfo as D, type DockerfileBuildPlan as E, type DockerfileInstruction as F, type ImageBuildOperation as G, type HealthResponse as H, Image as I, ImageBuildOperationType as J, type ImageOptions as K, type ListDirectoryResponse as L, OutputMode as M, type NetworkConfig as N, type OutputResponse as O, type ProcessInfo as P, type PoolContainerInfo as Q, type RunOptions as R, type SandboxOptions as S, ProcessStatus as T, type UpdateSandboxOptions as U, type SandboxImageSource as V, SnapshotStatus as W, type SnapshotType as X, StdinMode as Y, createSandboxImage as Z, dockerfileContent as _, type CreateAndConnectOptions as a, loadDockerfilePlan as a0, loadImagePlan as a1, logicalDockerfileLines as a2, runCreateSandboxImageCli as a3, type SandboxClientOptions as b, type ConnectOptions as c, type SnapshotInfo as d, SandboxStatus as e, type SandboxInfo as f, type SuspendResumeOptions as g, type CheckpointOptions as h, type CommandResult as i, type StartProcessOptions as j, type SendSignalResponse as k, type OutputEvent as l, type PtySessionInfo as m, type CreateSandboxOptions as n, type CreateSandboxResponse as o, type SandboxPortAccess as p, type SnapshotOptions as q, type CreateSnapshotResponse as r, type SnapshotAndWaitOptions as s, type CreatePoolOptions as t, type CreateSandboxPoolResponse as u, type SandboxPoolInfo as v, type UpdatePoolOptions as w, type CheckpointType as x, type ContainerResourcesInfo as y, ContainerState as z };
|
package/dist/sandbox-image.cjs
CHANGED
|
@@ -3297,13 +3297,13 @@ var init_sandbox = __esm({
|
|
|
3297
3297
|
async checkpoint(options) {
|
|
3298
3298
|
const client = this.requireLifecycleClient("checkpoint");
|
|
3299
3299
|
if (options?.wait === false) {
|
|
3300
|
-
await client.snapshot(this.lifecycleIdentifier, {
|
|
3300
|
+
await client.snapshot(this.lifecycleIdentifier, { snapshotType: options.checkpointType });
|
|
3301
3301
|
return void 0;
|
|
3302
3302
|
}
|
|
3303
3303
|
return client.snapshotAndWait(this.lifecycleIdentifier, {
|
|
3304
3304
|
timeout: options?.timeout,
|
|
3305
3305
|
pollInterval: options?.pollInterval,
|
|
3306
|
-
|
|
3306
|
+
snapshotType: options?.checkpointType
|
|
3307
3307
|
});
|
|
3308
3308
|
}
|
|
3309
3309
|
/**
|
|
@@ -3962,11 +3962,11 @@ var init_client = __esm({
|
|
|
3962
3962
|
* status — the snapshot is created asynchronously. Poll `getSnapshot()` until
|
|
3963
3963
|
* `completed` or `failed`, or use `snapshotAndWait()` to block automatically.
|
|
3964
3964
|
*
|
|
3965
|
-
* @param options.
|
|
3966
|
-
* Omit to use the server default (
|
|
3965
|
+
* @param options.snapshotType - `"filesystem"` for cold-boot snapshots (e.g. image builds).
|
|
3966
|
+
* Omit to use the server default (`filesystem`).
|
|
3967
3967
|
*/
|
|
3968
3968
|
async snapshot(sandboxId, options) {
|
|
3969
|
-
const requestOptions = options?.
|
|
3969
|
+
const requestOptions = options?.snapshotType != null ? { body: { snapshot_type: options.snapshotType } } : void 0;
|
|
3970
3970
|
const raw = await this.http.requestJson(
|
|
3971
3971
|
"POST",
|
|
3972
3972
|
this.path(`sandboxes/${sandboxId}/snapshot`),
|
|
@@ -4010,14 +4010,14 @@ var init_client = __esm({
|
|
|
4010
4010
|
* @param sandboxId - ID of the running sandbox to snapshot.
|
|
4011
4011
|
* @param options.timeout - Max seconds to wait (default 300).
|
|
4012
4012
|
* @param options.pollInterval - Seconds between status polls (default 1).
|
|
4013
|
-
* @param options.
|
|
4013
|
+
* @param options.snapshotType - Snapshot type passed through to `snapshot()`.
|
|
4014
4014
|
* @throws {SandboxError} If the snapshot fails or `timeout` elapses.
|
|
4015
4015
|
*/
|
|
4016
4016
|
async snapshotAndWait(sandboxId, options) {
|
|
4017
4017
|
const timeout = options?.timeout ?? 300;
|
|
4018
4018
|
const pollInterval = options?.pollInterval ?? 1;
|
|
4019
4019
|
const result = await this.snapshot(sandboxId, {
|
|
4020
|
-
|
|
4020
|
+
snapshotType: options?.snapshotType
|
|
4021
4021
|
});
|
|
4022
4022
|
const deadline = Date.now() + timeout * 1e3;
|
|
4023
4023
|
while (Date.now() < deadline) {
|
|
@@ -4916,7 +4916,7 @@ async function createSandboxImage(source, options = {}, deps = {}) {
|
|
|
4916
4916
|
await executeDockerfilePlan(sandbox, plan, emit, sleep3);
|
|
4917
4917
|
emit({ type: "status", message: "Creating snapshot..." });
|
|
4918
4918
|
const snapshot = await client.snapshotAndWait(sandbox.sandboxId, {
|
|
4919
|
-
|
|
4919
|
+
snapshotType: "filesystem"
|
|
4920
4920
|
});
|
|
4921
4921
|
emit({
|
|
4922
4922
|
type: "snapshot_created",
|