tensorlake 0.5.2 → 0.5.4
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 +14 -14
- 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 +14 -14
- 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 +14 -14
- 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 +14 -14
- package/dist/sandbox-image.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreatePtySessionOptions, S as SandboxOptions, a as CreateAndConnectOptions, b as SandboxClientOptions, c as ConnectOptions, d as SnapshotInfo, e as SandboxStatus, U as UpdateSandboxOptions, f as SandboxInfo, g as SuspendResumeOptions, h as CheckpointOptions, R as RunOptions, i as CommandResult, j as StartProcessOptions, P as ProcessInfo, k as SendSignalResponse, O as OutputResponse, l as OutputEvent, L as ListDirectoryResponse, m as PtySessionInfo, H as HealthResponse, D as DaemonInfo, n as CreateSandboxOptions, o as CreateSandboxResponse, p as SandboxPortAccess, q as SnapshotOptions, r as CreateSnapshotResponse, s as SnapshotAndWaitOptions, t as CreatePoolOptions, u as CreateSandboxPoolResponse, v as SandboxPoolInfo, w as UpdatePoolOptions } from './sandbox-image-
|
|
2
|
-
export { x as
|
|
1
|
+
import { C as CreatePtySessionOptions, S as SandboxOptions, a as CreateAndConnectOptions, b as SandboxClientOptions, c as ConnectOptions, d as SnapshotInfo, e as SandboxStatus, U as UpdateSandboxOptions, f as SandboxInfo, g as SuspendResumeOptions, h as CheckpointOptions, R as RunOptions, i as CommandResult, j as StartProcessOptions, P as ProcessInfo, k as SendSignalResponse, O as OutputResponse, l as OutputEvent, L as ListDirectoryResponse, m as PtySessionInfo, H as HealthResponse, D as DaemonInfo, n as CreateSandboxOptions, o as CreateSandboxResponse, p as SandboxPortAccess, q as SnapshotOptions, r as CreateSnapshotResponse, s as SnapshotAndWaitOptions, t as CreatePoolOptions, u as CreateSandboxPoolResponse, v as SandboxPoolInfo, w as UpdatePoolOptions } from './sandbox-image-BmhjX2bC.cjs';
|
|
2
|
+
export { x as CheckpointType, y as ContainerResourcesInfo, z as ContainerState, A as CreateSandboxImageOptions, B as DirectoryEntry, E as DockerfileBuildPlan, F as DockerfileInstruction, I as Image, G as ImageBuildOperation, J as ImageBuildOperationType, J as ImageBuildOperationTypeValue, K as ImageOptions, N as NetworkConfig, M as OutputMode, Q as PoolContainerInfo, T as ProcessStatus, V as SandboxImageSource, W as SnapshotStatus, X as SnapshotType, Y as StdinMode, Z as createSandboxImage, _ as dockerfileContent } from './sandbox-image-BmhjX2bC.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The return value of every SDK operation. Carries the W3C `trace_id` so callers
|
|
@@ -403,8 +403,8 @@ declare class SandboxClient {
|
|
|
403
403
|
* status — the snapshot is created asynchronously. Poll `getSnapshot()` until
|
|
404
404
|
* `completed` or `failed`, or use `snapshotAndWait()` to block automatically.
|
|
405
405
|
*
|
|
406
|
-
* @param options.
|
|
407
|
-
* Omit to use the server default (
|
|
406
|
+
* @param options.snapshotType - `"filesystem"` for cold-boot snapshots (e.g. image builds).
|
|
407
|
+
* Omit to use the server default (`filesystem`).
|
|
408
408
|
*/
|
|
409
409
|
snapshot(sandboxId: string, options?: SnapshotOptions): Promise<CreateSnapshotResponse>;
|
|
410
410
|
/** Get current status and metadata for a snapshot by ID. */
|
|
@@ -423,7 +423,7 @@ declare class SandboxClient {
|
|
|
423
423
|
* @param sandboxId - ID of the running sandbox to snapshot.
|
|
424
424
|
* @param options.timeout - Max seconds to wait (default 300).
|
|
425
425
|
* @param options.pollInterval - Seconds between status polls (default 1).
|
|
426
|
-
* @param options.
|
|
426
|
+
* @param options.snapshotType - Snapshot type passed through to `snapshot()`.
|
|
427
427
|
* @throws {SandboxError} If the snapshot fails or `timeout` elapses.
|
|
428
428
|
*/
|
|
429
429
|
snapshotAndWait(sandboxId: string, options?: SnapshotAndWaitOptions): Promise<SnapshotInfo>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreatePtySessionOptions, S as SandboxOptions, a as CreateAndConnectOptions, b as SandboxClientOptions, c as ConnectOptions, d as SnapshotInfo, e as SandboxStatus, U as UpdateSandboxOptions, f as SandboxInfo, g as SuspendResumeOptions, h as CheckpointOptions, R as RunOptions, i as CommandResult, j as StartProcessOptions, P as ProcessInfo, k as SendSignalResponse, O as OutputResponse, l as OutputEvent, L as ListDirectoryResponse, m as PtySessionInfo, H as HealthResponse, D as DaemonInfo, n as CreateSandboxOptions, o as CreateSandboxResponse, p as SandboxPortAccess, q as SnapshotOptions, r as CreateSnapshotResponse, s as SnapshotAndWaitOptions, t as CreatePoolOptions, u as CreateSandboxPoolResponse, v as SandboxPoolInfo, w as UpdatePoolOptions } from './sandbox-image-
|
|
2
|
-
export { x as
|
|
1
|
+
import { C as CreatePtySessionOptions, S as SandboxOptions, a as CreateAndConnectOptions, b as SandboxClientOptions, c as ConnectOptions, d as SnapshotInfo, e as SandboxStatus, U as UpdateSandboxOptions, f as SandboxInfo, g as SuspendResumeOptions, h as CheckpointOptions, R as RunOptions, i as CommandResult, j as StartProcessOptions, P as ProcessInfo, k as SendSignalResponse, O as OutputResponse, l as OutputEvent, L as ListDirectoryResponse, m as PtySessionInfo, H as HealthResponse, D as DaemonInfo, n as CreateSandboxOptions, o as CreateSandboxResponse, p as SandboxPortAccess, q as SnapshotOptions, r as CreateSnapshotResponse, s as SnapshotAndWaitOptions, t as CreatePoolOptions, u as CreateSandboxPoolResponse, v as SandboxPoolInfo, w as UpdatePoolOptions } from './sandbox-image-BmhjX2bC.js';
|
|
2
|
+
export { x as CheckpointType, y as ContainerResourcesInfo, z as ContainerState, A as CreateSandboxImageOptions, B as DirectoryEntry, E as DockerfileBuildPlan, F as DockerfileInstruction, I as Image, G as ImageBuildOperation, J as ImageBuildOperationType, J as ImageBuildOperationTypeValue, K as ImageOptions, N as NetworkConfig, M as OutputMode, Q as PoolContainerInfo, T as ProcessStatus, V as SandboxImageSource, W as SnapshotStatus, X as SnapshotType, Y as StdinMode, Z as createSandboxImage, _ as dockerfileContent } from './sandbox-image-BmhjX2bC.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The return value of every SDK operation. Carries the W3C `trace_id` so callers
|
|
@@ -403,8 +403,8 @@ declare class SandboxClient {
|
|
|
403
403
|
* status — the snapshot is created asynchronously. Poll `getSnapshot()` until
|
|
404
404
|
* `completed` or `failed`, or use `snapshotAndWait()` to block automatically.
|
|
405
405
|
*
|
|
406
|
-
* @param options.
|
|
407
|
-
* Omit to use the server default (
|
|
406
|
+
* @param options.snapshotType - `"filesystem"` for cold-boot snapshots (e.g. image builds).
|
|
407
|
+
* Omit to use the server default (`filesystem`).
|
|
408
408
|
*/
|
|
409
409
|
snapshot(sandboxId: string, options?: SnapshotOptions): Promise<CreateSnapshotResponse>;
|
|
410
410
|
/** Get current status and metadata for a snapshot by ID. */
|
|
@@ -423,7 +423,7 @@ declare class SandboxClient {
|
|
|
423
423
|
* @param sandboxId - ID of the running sandbox to snapshot.
|
|
424
424
|
* @param options.timeout - Max seconds to wait (default 300).
|
|
425
425
|
* @param options.pollInterval - Seconds between status polls (default 1).
|
|
426
|
-
* @param options.
|
|
426
|
+
* @param options.snapshotType - Snapshot type passed through to `snapshot()`.
|
|
427
427
|
* @throws {SandboxError} If the snapshot fails or `timeout` elapses.
|
|
428
428
|
*/
|
|
429
429
|
snapshotAndWait(sandboxId: string, options?: SnapshotAndWaitOptions): Promise<SnapshotInfo>;
|
package/dist/index.js
CHANGED
|
@@ -3340,13 +3340,13 @@ var init_sandbox = __esm({
|
|
|
3340
3340
|
async checkpoint(options) {
|
|
3341
3341
|
const client = this.requireLifecycleClient("checkpoint");
|
|
3342
3342
|
if (options?.wait === false) {
|
|
3343
|
-
await client.snapshot(this.lifecycleIdentifier, {
|
|
3343
|
+
await client.snapshot(this.lifecycleIdentifier, { snapshotType: options.checkpointType });
|
|
3344
3344
|
return void 0;
|
|
3345
3345
|
}
|
|
3346
3346
|
return client.snapshotAndWait(this.lifecycleIdentifier, {
|
|
3347
3347
|
timeout: options?.timeout,
|
|
3348
3348
|
pollInterval: options?.pollInterval,
|
|
3349
|
-
|
|
3349
|
+
snapshotType: options?.checkpointType
|
|
3350
3350
|
});
|
|
3351
3351
|
}
|
|
3352
3352
|
/**
|
|
@@ -4005,11 +4005,11 @@ var init_client = __esm({
|
|
|
4005
4005
|
* status — the snapshot is created asynchronously. Poll `getSnapshot()` until
|
|
4006
4006
|
* `completed` or `failed`, or use `snapshotAndWait()` to block automatically.
|
|
4007
4007
|
*
|
|
4008
|
-
* @param options.
|
|
4009
|
-
* Omit to use the server default (
|
|
4008
|
+
* @param options.snapshotType - `"filesystem"` for cold-boot snapshots (e.g. image builds).
|
|
4009
|
+
* Omit to use the server default (`filesystem`).
|
|
4010
4010
|
*/
|
|
4011
4011
|
async snapshot(sandboxId, options) {
|
|
4012
|
-
const requestOptions = options?.
|
|
4012
|
+
const requestOptions = options?.snapshotType != null ? { body: { snapshot_type: options.snapshotType } } : void 0;
|
|
4013
4013
|
const raw = await this.http.requestJson(
|
|
4014
4014
|
"POST",
|
|
4015
4015
|
this.path(`sandboxes/${sandboxId}/snapshot`),
|
|
@@ -4053,14 +4053,14 @@ var init_client = __esm({
|
|
|
4053
4053
|
* @param sandboxId - ID of the running sandbox to snapshot.
|
|
4054
4054
|
* @param options.timeout - Max seconds to wait (default 300).
|
|
4055
4055
|
* @param options.pollInterval - Seconds between status polls (default 1).
|
|
4056
|
-
* @param options.
|
|
4056
|
+
* @param options.snapshotType - Snapshot type passed through to `snapshot()`.
|
|
4057
4057
|
* @throws {SandboxError} If the snapshot fails or `timeout` elapses.
|
|
4058
4058
|
*/
|
|
4059
4059
|
async snapshotAndWait(sandboxId, options) {
|
|
4060
4060
|
const timeout = options?.timeout ?? 300;
|
|
4061
4061
|
const pollInterval = options?.pollInterval ?? 1;
|
|
4062
4062
|
const result = await this.snapshot(sandboxId, {
|
|
4063
|
-
|
|
4063
|
+
snapshotType: options?.snapshotType
|
|
4064
4064
|
});
|
|
4065
4065
|
const deadline = Date.now() + timeout * 1e3;
|
|
4066
4066
|
while (Date.now() < deadline) {
|
|
@@ -5055,7 +5055,7 @@ async function createSandboxImage(source, options = {}, deps = {}) {
|
|
|
5055
5055
|
await executeDockerfilePlan(sandbox, plan, emit, sleep3);
|
|
5056
5056
|
emit({ type: "status", message: "Creating snapshot..." });
|
|
5057
5057
|
const snapshot = await client.snapshotAndWait(sandbox.sandboxId, {
|
|
5058
|
-
|
|
5058
|
+
snapshotType: "filesystem"
|
|
5059
5059
|
});
|
|
5060
5060
|
emit({
|
|
5061
5061
|
type: "snapshot_created",
|
|
@@ -5116,25 +5116,25 @@ async function runCreateSandboxImageCli(argv = process.argv.slice(2)) {
|
|
|
5116
5116
|
name: { type: "string", short: "n" },
|
|
5117
5117
|
cpus: { type: "string" },
|
|
5118
5118
|
memory: { type: "string" },
|
|
5119
|
-
|
|
5119
|
+
disk_mb: { type: "string" },
|
|
5120
5120
|
public: { type: "boolean", default: false }
|
|
5121
5121
|
}
|
|
5122
5122
|
});
|
|
5123
5123
|
const dockerfilePath = parsed.positionals[0];
|
|
5124
5124
|
if (!dockerfilePath) {
|
|
5125
|
-
throw new Error("Usage: tensorlake-create-sandbox-image <dockerfile_path> [--name NAME] [--cpus N] [--memory MB] [--
|
|
5125
|
+
throw new Error("Usage: tensorlake-create-sandbox-image <dockerfile_path> [--name NAME] [--cpus N] [--memory MB] [--disk_mb MB] [--public]");
|
|
5126
5126
|
}
|
|
5127
5127
|
const cpus = parsed.values.cpus != null ? Number(parsed.values.cpus) : void 0;
|
|
5128
5128
|
const memoryMb = parsed.values.memory != null ? Number(parsed.values.memory) : void 0;
|
|
5129
|
-
const
|
|
5129
|
+
const diskMb = parsed.values.disk_mb != null ? Number(parsed.values.disk_mb) : void 0;
|
|
5130
5130
|
if (cpus != null && !Number.isFinite(cpus)) {
|
|
5131
5131
|
throw new Error(`Invalid --cpus value: ${parsed.values.cpus}`);
|
|
5132
5132
|
}
|
|
5133
5133
|
if (memoryMb != null && !Number.isInteger(memoryMb)) {
|
|
5134
5134
|
throw new Error(`Invalid --memory value: ${parsed.values.memory}`);
|
|
5135
5135
|
}
|
|
5136
|
-
if (
|
|
5137
|
-
throw new Error(`Invalid --
|
|
5136
|
+
if (diskMb != null && !Number.isInteger(diskMb)) {
|
|
5137
|
+
throw new Error(`Invalid --disk_mb value: ${parsed.values.disk_mb}`);
|
|
5138
5138
|
}
|
|
5139
5139
|
await createSandboxImage(
|
|
5140
5140
|
dockerfilePath,
|
|
@@ -5142,7 +5142,7 @@ async function runCreateSandboxImageCli(argv = process.argv.slice(2)) {
|
|
|
5142
5142
|
registeredName: parsed.values.name,
|
|
5143
5143
|
cpus,
|
|
5144
5144
|
memoryMb,
|
|
5145
|
-
diskMb
|
|
5145
|
+
diskMb,
|
|
5146
5146
|
isPublic: parsed.values.public
|
|
5147
5147
|
},
|
|
5148
5148
|
{ emit: ndjsonStdoutEmit }
|