tensorlake 0.5.1 → 0.5.2
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 +63 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +63 -4
- package/dist/index.js.map +1 -1
- package/dist/{sandbox-image-CEGsGg4V.d.cts → sandbox-image-B0WMhyoM.d.cts} +6 -1
- package/dist/{sandbox-image-CEGsGg4V.d.ts → sandbox-image-B0WMhyoM.d.ts} +6 -1
- package/dist/sandbox-image.cjs +63 -4
- 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 +63 -4
- package/dist/sandbox-image.js.map +1 -1
- package/package.json +1 -1
package/dist/sandbox-image.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { z as CreateSandboxImageOptions, B as DockerfileBuildPlan, E as DockerfileInstruction, T as SandboxImageSource, Y as createSandboxImage, _ as defaultRegisteredName, $ as loadDockerfilePlan, a0 as loadImagePlan, a1 as logicalDockerfileLines, a2 as runCreateSandboxImageCli } from './sandbox-image-
|
|
1
|
+
export { z as CreateSandboxImageOptions, B as DockerfileBuildPlan, E as DockerfileInstruction, T as SandboxImageSource, Y as createSandboxImage, _ as defaultRegisteredName, $ as loadDockerfilePlan, a0 as loadImagePlan, a1 as logicalDockerfileLines, a2 as runCreateSandboxImageCli } from './sandbox-image-B0WMhyoM.cjs';
|
package/dist/sandbox-image.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { z as CreateSandboxImageOptions, B as DockerfileBuildPlan, E as DockerfileInstruction, T as SandboxImageSource, Y as createSandboxImage, _ as defaultRegisteredName, $ as loadDockerfilePlan, a0 as loadImagePlan, a1 as logicalDockerfileLines, a2 as runCreateSandboxImageCli } from './sandbox-image-
|
|
1
|
+
export { z as CreateSandboxImageOptions, B as DockerfileBuildPlan, E as DockerfileInstruction, T as SandboxImageSource, Y as createSandboxImage, _ as defaultRegisteredName, $ as loadDockerfilePlan, a0 as loadImagePlan, a1 as logicalDockerfileLines, a2 as runCreateSandboxImageCli } from './sandbox-image-B0WMhyoM.js';
|
package/dist/sandbox-image.js
CHANGED
|
@@ -3642,6 +3642,38 @@ __export(client_exports, {
|
|
|
3642
3642
|
function sleep2(ms) {
|
|
3643
3643
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3644
3644
|
}
|
|
3645
|
+
function formatStartupFailureMessage(sandboxId, status, options) {
|
|
3646
|
+
const prefix = status === "terminated" /* TERMINATED */ ? `Sandbox ${sandboxId} terminated during startup` : `Sandbox ${sandboxId} became ${status} during startup`;
|
|
3647
|
+
const detail = formatErrorDetails(options.errorDetails);
|
|
3648
|
+
if (detail) {
|
|
3649
|
+
return `${prefix}: ${detail}`;
|
|
3650
|
+
}
|
|
3651
|
+
if (options.terminationReason) {
|
|
3652
|
+
return `${prefix}: termination reason: ${options.terminationReason}`;
|
|
3653
|
+
}
|
|
3654
|
+
return prefix;
|
|
3655
|
+
}
|
|
3656
|
+
function formatErrorDetails(errorDetails) {
|
|
3657
|
+
if (errorDetails == null) return void 0;
|
|
3658
|
+
if (typeof errorDetails === "string") {
|
|
3659
|
+
const detail = errorDetails.trim();
|
|
3660
|
+
return detail || void 0;
|
|
3661
|
+
}
|
|
3662
|
+
if (Array.isArray(errorDetails)) {
|
|
3663
|
+
const parts = errorDetails.map((item) => formatErrorDetails(item)).filter((item) => Boolean(item));
|
|
3664
|
+
return parts.length > 0 ? parts.join("; ") : JSON.stringify(errorDetails);
|
|
3665
|
+
}
|
|
3666
|
+
if (typeof errorDetails === "object") {
|
|
3667
|
+
for (const key of ["message", "detail", "error", "reason"]) {
|
|
3668
|
+
const value = errorDetails[key];
|
|
3669
|
+
if (typeof value === "string" && value.trim()) {
|
|
3670
|
+
return value.trim();
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
return JSON.stringify(errorDetails);
|
|
3674
|
+
}
|
|
3675
|
+
return String(errorDetails);
|
|
3676
|
+
}
|
|
3645
3677
|
function normalizeUserPorts(ports) {
|
|
3646
3678
|
return dedupeAndSortPorts(ports.map(validateUserPort));
|
|
3647
3679
|
}
|
|
@@ -4092,15 +4124,26 @@ var init_client = __esm({
|
|
|
4092
4124
|
if (result.status === "running" /* RUNNING */) {
|
|
4093
4125
|
return finishConnect(result.routingHint, result.name);
|
|
4094
4126
|
}
|
|
4127
|
+
if (result.status === "suspended" /* SUSPENDED */ || result.status === "terminated" /* TERMINATED */) {
|
|
4128
|
+
throw new SandboxError(
|
|
4129
|
+
formatStartupFailureMessage(result.sandboxId, result.status, {
|
|
4130
|
+
errorDetails: result.errorDetails,
|
|
4131
|
+
terminationReason: result.terminationReason
|
|
4132
|
+
})
|
|
4133
|
+
);
|
|
4134
|
+
}
|
|
4095
4135
|
const deadline = Date.now() + startupTimeout * 1e3;
|
|
4096
4136
|
while (Date.now() < deadline) {
|
|
4097
4137
|
const info = await this.get(result.sandboxId);
|
|
4098
4138
|
if (info.status === "running" /* RUNNING */) {
|
|
4099
4139
|
return finishConnect(info.routingHint, info.name);
|
|
4100
4140
|
}
|
|
4101
|
-
if (info.status === "terminated" /* TERMINATED */) {
|
|
4141
|
+
if (info.status === "suspended" /* SUSPENDED */ || info.status === "terminated" /* TERMINATED */) {
|
|
4102
4142
|
throw new SandboxError(
|
|
4103
|
-
|
|
4143
|
+
formatStartupFailureMessage(result.sandboxId, info.status, {
|
|
4144
|
+
errorDetails: info.errorDetails,
|
|
4145
|
+
terminationReason: info.terminationReason
|
|
4146
|
+
})
|
|
4104
4147
|
);
|
|
4105
4148
|
}
|
|
4106
4149
|
await sleep2(500);
|
|
@@ -4777,7 +4820,7 @@ async function executeDockerfilePlan(sandbox, plan, emit, sleep3) {
|
|
|
4777
4820
|
);
|
|
4778
4821
|
}
|
|
4779
4822
|
}
|
|
4780
|
-
async function registerImage(context, name, dockerfile, snapshotId, snapshotUri, isPublic) {
|
|
4823
|
+
async function registerImage(context, name, dockerfile, snapshotId, snapshotSandboxId, snapshotUri, snapshotSizeBytes, rootfsDiskBytes, isPublic) {
|
|
4781
4824
|
if (!context.organizationId || !context.projectId) {
|
|
4782
4825
|
throw new Error(
|
|
4783
4826
|
"Organization ID and Project ID are required. Run 'tl login' and 'tl init'."
|
|
@@ -4804,8 +4847,11 @@ async function registerImage(context, name, dockerfile, snapshotId, snapshotUri,
|
|
|
4804
4847
|
name,
|
|
4805
4848
|
dockerfile,
|
|
4806
4849
|
snapshotId,
|
|
4850
|
+
snapshotSandboxId,
|
|
4807
4851
|
snapshotUri,
|
|
4808
|
-
|
|
4852
|
+
snapshotSizeBytes,
|
|
4853
|
+
rootfsDiskBytes,
|
|
4854
|
+
public: isPublic
|
|
4809
4855
|
})
|
|
4810
4856
|
});
|
|
4811
4857
|
if (!response.ok) {
|
|
@@ -4856,6 +4902,16 @@ async function createSandboxImage(source, options = {}, deps = {}) {
|
|
|
4856
4902
|
`Snapshot ${snapshot.snapshotId} is missing snapshotUri and cannot be registered as a sandbox image.`
|
|
4857
4903
|
);
|
|
4858
4904
|
}
|
|
4905
|
+
if (snapshot.sizeBytes == null) {
|
|
4906
|
+
throw new Error(
|
|
4907
|
+
`Snapshot ${snapshot.snapshotId} is missing sizeBytes and cannot be registered as a sandbox image.`
|
|
4908
|
+
);
|
|
4909
|
+
}
|
|
4910
|
+
if (snapshot.rootfsDiskBytes == null) {
|
|
4911
|
+
throw new Error(
|
|
4912
|
+
`Snapshot ${snapshot.snapshotId} is missing rootfsDiskBytes and cannot be registered as a sandbox image.`
|
|
4913
|
+
);
|
|
4914
|
+
}
|
|
4859
4915
|
emit({
|
|
4860
4916
|
type: "status",
|
|
4861
4917
|
message: `Registering image '${plan.registeredName}'...`
|
|
@@ -4865,7 +4921,10 @@ async function createSandboxImage(source, options = {}, deps = {}) {
|
|
|
4865
4921
|
plan.registeredName,
|
|
4866
4922
|
plan.dockerfileText,
|
|
4867
4923
|
snapshot.snapshotId,
|
|
4924
|
+
snapshot.sandboxId,
|
|
4868
4925
|
snapshot.snapshotUri,
|
|
4926
|
+
snapshot.sizeBytes,
|
|
4927
|
+
snapshot.rootfsDiskBytes,
|
|
4869
4928
|
options.isPublic ?? false
|
|
4870
4929
|
);
|
|
4871
4930
|
emit({
|