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
|
Binary file
|
package/dist/bin/darwin-arm64/tl
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/bin/linux-x64/tl
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.cjs
CHANGED
|
@@ -3358,13 +3358,13 @@ var init_sandbox = __esm({
|
|
|
3358
3358
|
async checkpoint(options) {
|
|
3359
3359
|
const client = this.requireLifecycleClient("checkpoint");
|
|
3360
3360
|
if (options?.wait === false) {
|
|
3361
|
-
await client.snapshot(this.lifecycleIdentifier, {
|
|
3361
|
+
await client.snapshot(this.lifecycleIdentifier, { snapshotType: options.checkpointType });
|
|
3362
3362
|
return void 0;
|
|
3363
3363
|
}
|
|
3364
3364
|
return client.snapshotAndWait(this.lifecycleIdentifier, {
|
|
3365
3365
|
timeout: options?.timeout,
|
|
3366
3366
|
pollInterval: options?.pollInterval,
|
|
3367
|
-
|
|
3367
|
+
snapshotType: options?.checkpointType
|
|
3368
3368
|
});
|
|
3369
3369
|
}
|
|
3370
3370
|
/**
|
|
@@ -4023,11 +4023,11 @@ var init_client = __esm({
|
|
|
4023
4023
|
* status — the snapshot is created asynchronously. Poll `getSnapshot()` until
|
|
4024
4024
|
* `completed` or `failed`, or use `snapshotAndWait()` to block automatically.
|
|
4025
4025
|
*
|
|
4026
|
-
* @param options.
|
|
4027
|
-
* Omit to use the server default (
|
|
4026
|
+
* @param options.snapshotType - `"filesystem"` for cold-boot snapshots (e.g. image builds).
|
|
4027
|
+
* Omit to use the server default (`filesystem`).
|
|
4028
4028
|
*/
|
|
4029
4029
|
async snapshot(sandboxId, options) {
|
|
4030
|
-
const requestOptions = options?.
|
|
4030
|
+
const requestOptions = options?.snapshotType != null ? { body: { snapshot_type: options.snapshotType } } : void 0;
|
|
4031
4031
|
const raw = await this.http.requestJson(
|
|
4032
4032
|
"POST",
|
|
4033
4033
|
this.path(`sandboxes/${sandboxId}/snapshot`),
|
|
@@ -4071,14 +4071,14 @@ var init_client = __esm({
|
|
|
4071
4071
|
* @param sandboxId - ID of the running sandbox to snapshot.
|
|
4072
4072
|
* @param options.timeout - Max seconds to wait (default 300).
|
|
4073
4073
|
* @param options.pollInterval - Seconds between status polls (default 1).
|
|
4074
|
-
* @param options.
|
|
4074
|
+
* @param options.snapshotType - Snapshot type passed through to `snapshot()`.
|
|
4075
4075
|
* @throws {SandboxError} If the snapshot fails or `timeout` elapses.
|
|
4076
4076
|
*/
|
|
4077
4077
|
async snapshotAndWait(sandboxId, options) {
|
|
4078
4078
|
const timeout = options?.timeout ?? 300;
|
|
4079
4079
|
const pollInterval = options?.pollInterval ?? 1;
|
|
4080
4080
|
const result = await this.snapshot(sandboxId, {
|
|
4081
|
-
|
|
4081
|
+
snapshotType: options?.snapshotType
|
|
4082
4082
|
});
|
|
4083
4083
|
const deadline = Date.now() + timeout * 1e3;
|
|
4084
4084
|
while (Date.now() < deadline) {
|
|
@@ -5070,7 +5070,7 @@ async function createSandboxImage(source, options = {}, deps = {}) {
|
|
|
5070
5070
|
await executeDockerfilePlan(sandbox, plan, emit, sleep3);
|
|
5071
5071
|
emit({ type: "status", message: "Creating snapshot..." });
|
|
5072
5072
|
const snapshot = await client.snapshotAndWait(sandbox.sandboxId, {
|
|
5073
|
-
|
|
5073
|
+
snapshotType: "filesystem"
|
|
5074
5074
|
});
|
|
5075
5075
|
emit({
|
|
5076
5076
|
type: "snapshot_created",
|
|
@@ -5131,25 +5131,25 @@ async function runCreateSandboxImageCli(argv = process.argv.slice(2)) {
|
|
|
5131
5131
|
name: { type: "string", short: "n" },
|
|
5132
5132
|
cpus: { type: "string" },
|
|
5133
5133
|
memory: { type: "string" },
|
|
5134
|
-
|
|
5134
|
+
disk_mb: { type: "string" },
|
|
5135
5135
|
public: { type: "boolean", default: false }
|
|
5136
5136
|
}
|
|
5137
5137
|
});
|
|
5138
5138
|
const dockerfilePath = parsed.positionals[0];
|
|
5139
5139
|
if (!dockerfilePath) {
|
|
5140
|
-
throw new Error("Usage: tensorlake-create-sandbox-image <dockerfile_path> [--name NAME] [--cpus N] [--memory MB] [--
|
|
5140
|
+
throw new Error("Usage: tensorlake-create-sandbox-image <dockerfile_path> [--name NAME] [--cpus N] [--memory MB] [--disk_mb MB] [--public]");
|
|
5141
5141
|
}
|
|
5142
5142
|
const cpus = parsed.values.cpus != null ? Number(parsed.values.cpus) : void 0;
|
|
5143
5143
|
const memoryMb = parsed.values.memory != null ? Number(parsed.values.memory) : void 0;
|
|
5144
|
-
const
|
|
5144
|
+
const diskMb = parsed.values.disk_mb != null ? Number(parsed.values.disk_mb) : void 0;
|
|
5145
5145
|
if (cpus != null && !Number.isFinite(cpus)) {
|
|
5146
5146
|
throw new Error(`Invalid --cpus value: ${parsed.values.cpus}`);
|
|
5147
5147
|
}
|
|
5148
5148
|
if (memoryMb != null && !Number.isInteger(memoryMb)) {
|
|
5149
5149
|
throw new Error(`Invalid --memory value: ${parsed.values.memory}`);
|
|
5150
5150
|
}
|
|
5151
|
-
if (
|
|
5152
|
-
throw new Error(`Invalid --
|
|
5151
|
+
if (diskMb != null && !Number.isInteger(diskMb)) {
|
|
5152
|
+
throw new Error(`Invalid --disk_mb value: ${parsed.values.disk_mb}`);
|
|
5153
5153
|
}
|
|
5154
5154
|
await createSandboxImage(
|
|
5155
5155
|
dockerfilePath,
|
|
@@ -5157,7 +5157,7 @@ async function runCreateSandboxImageCli(argv = process.argv.slice(2)) {
|
|
|
5157
5157
|
registeredName: parsed.values.name,
|
|
5158
5158
|
cpus,
|
|
5159
5159
|
memoryMb,
|
|
5160
|
-
diskMb
|
|
5160
|
+
diskMb,
|
|
5161
5161
|
isPublic: parsed.values.public
|
|
5162
5162
|
},
|
|
5163
5163
|
{ emit: ndjsonStdoutEmit }
|