tensorlake 0.5.9 → 0.5.11

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.
@@ -8,6 +8,7 @@ declare enum SandboxStatus {
8
8
  }
9
9
  declare enum SnapshotStatus {
10
10
  IN_PROGRESS = "in_progress",
11
+ LOCAL_READY = "local_ready",
11
12
  COMPLETED = "completed",
12
13
  FAILED = "failed"
13
14
  }
@@ -31,6 +32,7 @@ type SnapshotType = "memory" | "filesystem";
31
32
  * this checkpoint cold-boot from the snapshot tarball.
32
33
  */
33
34
  type CheckpointType = "memory" | "filesystem";
35
+ type SnapshotWaitCondition = "local_ready" | "completed";
34
36
  declare enum ProcessStatus {
35
37
  RUNNING = "running",
36
38
  EXITED = "exited",
@@ -132,6 +134,7 @@ interface SnapshotInfo {
132
134
  snapshotType?: SnapshotType;
133
135
  error?: string;
134
136
  snapshotUri?: string;
137
+ snapshotFormatVersion?: string;
135
138
  sizeBytes?: number;
136
139
  rootfsDiskBytes?: number;
137
140
  createdAt?: Date;
@@ -147,6 +150,8 @@ interface SnapshotOptions {
147
150
  interface SnapshotAndWaitOptions extends SnapshotOptions {
148
151
  timeout?: number;
149
152
  pollInterval?: number;
153
+ /** Defaults to `"local_ready"`, which is enough to resume from a snapshot. */
154
+ waitUntil?: SnapshotWaitCondition;
150
155
  }
151
156
  interface CreatePoolOptions {
152
157
  /** Sandbox image name, such as `tensorlake/ubuntu-minimal` or a registered Sandbox Image. */
@@ -303,6 +308,8 @@ interface SuspendResumeOptions {
303
308
  }
304
309
  interface CheckpointOptions extends SuspendResumeOptions {
305
310
  checkpointType?: CheckpointType;
311
+ /** Defaults to `"local_ready"`, which is enough to resume from a checkpoint. */
312
+ waitUntil?: SnapshotWaitCondition;
306
313
  }
307
314
  interface ConnectOptions {
308
315
  sandboxId: string;
@@ -375,6 +382,7 @@ interface CreateSandboxImageOptions {
375
382
  cpus?: number;
376
383
  memoryMb?: number;
377
384
  diskMb?: number;
385
+ builderDiskMb?: number;
378
386
  isPublic?: boolean;
379
387
  contextDir?: string;
380
388
  /**
@@ -411,6 +419,7 @@ interface BuildSandbox {
411
419
  getStderr(pid: number): Promise<OutputResponse>;
412
420
  getProcess(pid: number): Promise<ProcessInfo>;
413
421
  writeFile(path: string, content: Uint8Array): Promise<void>;
422
+ readFile(path: string): Promise<Uint8Array>;
414
423
  terminate(): Promise<void>;
415
424
  }
416
425
  interface BuildClient {
@@ -420,17 +429,11 @@ interface BuildClient {
420
429
  memoryMb?: number;
421
430
  diskMb?: number;
422
431
  }): Promise<BuildSandbox>;
423
- snapshotAndWait(sandboxId: string, options?: {
424
- timeout?: number;
425
- pollInterval?: number;
426
- snapshotType?: SnapshotType;
427
- }): Promise<SnapshotInfo>;
428
432
  close(): void;
429
433
  }
430
434
  interface CreateSandboxImageDeps {
431
435
  emit?: (event: Record<string, unknown>) => void;
432
436
  createClient?: (context: BuildContext) => BuildClient;
433
- registerImage?: (context: BuildContext, name: string, dockerfile: string, snapshotId: string, snapshotSandboxId: string, snapshotUri: string, snapshotSizeBytes: number, rootfsDiskBytes: number, isPublic: boolean) => Promise<Record<string, unknown>>;
434
437
  sleep?: (ms: number) => Promise<void>;
435
438
  }
436
439
  declare function defaultRegisteredName(dockerfilePath: string): string;
@@ -440,7 +443,8 @@ declare function logicalDockerfileLines(dockerfileText: string): Array<{
440
443
  }>;
441
444
  declare function loadDockerfilePlan(dockerfilePath: string, registeredName?: string): Promise<DockerfileBuildPlan>;
442
445
  declare function loadImagePlan(image: Image, options?: Pick<CreateSandboxImageOptions, "registeredName" | "contextDir">): DockerfileBuildPlan;
446
+ declare function registerImage(context: BuildContext, name: string, dockerfile: string, snapshotId: string, snapshotSandboxId: string, snapshotUri: string, snapshotSizeBytes: number, rootfsDiskBytes: number, isPublic: boolean, snapshotFormatVersion?: string): Promise<Record<string, unknown>>;
443
447
  declare function createSandboxImage(source: SandboxImageSource, options?: CreateSandboxImageOptions, deps?: CreateSandboxImageDeps): Promise<Record<string, unknown>>;
444
448
  declare function runCreateSandboxImageCli(argv?: string[]): Promise<void>;
445
449
 
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, type SandboxInfo as e, SandboxStatus 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 };
450
+ export { dockerfileContent 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, type SnapshotWaitCondition as Y, StdinMode as Z, createSandboxImage as _, type CreateAndConnectOptions as a, type BuildContext as a0, defaultRegisteredName as a1, loadDockerfilePlan as a2, loadImagePlan as a3, logicalDockerfileLines as a4, registerImage as a5, runCreateSandboxImageCli as a6, type SandboxClientOptions as b, type ConnectOptions as c, type SnapshotInfo as d, type SandboxInfo as e, SandboxStatus 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 };
@@ -8,6 +8,7 @@ declare enum SandboxStatus {
8
8
  }
9
9
  declare enum SnapshotStatus {
10
10
  IN_PROGRESS = "in_progress",
11
+ LOCAL_READY = "local_ready",
11
12
  COMPLETED = "completed",
12
13
  FAILED = "failed"
13
14
  }
@@ -31,6 +32,7 @@ type SnapshotType = "memory" | "filesystem";
31
32
  * this checkpoint cold-boot from the snapshot tarball.
32
33
  */
33
34
  type CheckpointType = "memory" | "filesystem";
35
+ type SnapshotWaitCondition = "local_ready" | "completed";
34
36
  declare enum ProcessStatus {
35
37
  RUNNING = "running",
36
38
  EXITED = "exited",
@@ -132,6 +134,7 @@ interface SnapshotInfo {
132
134
  snapshotType?: SnapshotType;
133
135
  error?: string;
134
136
  snapshotUri?: string;
137
+ snapshotFormatVersion?: string;
135
138
  sizeBytes?: number;
136
139
  rootfsDiskBytes?: number;
137
140
  createdAt?: Date;
@@ -147,6 +150,8 @@ interface SnapshotOptions {
147
150
  interface SnapshotAndWaitOptions extends SnapshotOptions {
148
151
  timeout?: number;
149
152
  pollInterval?: number;
153
+ /** Defaults to `"local_ready"`, which is enough to resume from a snapshot. */
154
+ waitUntil?: SnapshotWaitCondition;
150
155
  }
151
156
  interface CreatePoolOptions {
152
157
  /** Sandbox image name, such as `tensorlake/ubuntu-minimal` or a registered Sandbox Image. */
@@ -303,6 +308,8 @@ interface SuspendResumeOptions {
303
308
  }
304
309
  interface CheckpointOptions extends SuspendResumeOptions {
305
310
  checkpointType?: CheckpointType;
311
+ /** Defaults to `"local_ready"`, which is enough to resume from a checkpoint. */
312
+ waitUntil?: SnapshotWaitCondition;
306
313
  }
307
314
  interface ConnectOptions {
308
315
  sandboxId: string;
@@ -375,6 +382,7 @@ interface CreateSandboxImageOptions {
375
382
  cpus?: number;
376
383
  memoryMb?: number;
377
384
  diskMb?: number;
385
+ builderDiskMb?: number;
378
386
  isPublic?: boolean;
379
387
  contextDir?: string;
380
388
  /**
@@ -411,6 +419,7 @@ interface BuildSandbox {
411
419
  getStderr(pid: number): Promise<OutputResponse>;
412
420
  getProcess(pid: number): Promise<ProcessInfo>;
413
421
  writeFile(path: string, content: Uint8Array): Promise<void>;
422
+ readFile(path: string): Promise<Uint8Array>;
414
423
  terminate(): Promise<void>;
415
424
  }
416
425
  interface BuildClient {
@@ -420,17 +429,11 @@ interface BuildClient {
420
429
  memoryMb?: number;
421
430
  diskMb?: number;
422
431
  }): Promise<BuildSandbox>;
423
- snapshotAndWait(sandboxId: string, options?: {
424
- timeout?: number;
425
- pollInterval?: number;
426
- snapshotType?: SnapshotType;
427
- }): Promise<SnapshotInfo>;
428
432
  close(): void;
429
433
  }
430
434
  interface CreateSandboxImageDeps {
431
435
  emit?: (event: Record<string, unknown>) => void;
432
436
  createClient?: (context: BuildContext) => BuildClient;
433
- registerImage?: (context: BuildContext, name: string, dockerfile: string, snapshotId: string, snapshotSandboxId: string, snapshotUri: string, snapshotSizeBytes: number, rootfsDiskBytes: number, isPublic: boolean) => Promise<Record<string, unknown>>;
434
437
  sleep?: (ms: number) => Promise<void>;
435
438
  }
436
439
  declare function defaultRegisteredName(dockerfilePath: string): string;
@@ -440,7 +443,8 @@ declare function logicalDockerfileLines(dockerfileText: string): Array<{
440
443
  }>;
441
444
  declare function loadDockerfilePlan(dockerfilePath: string, registeredName?: string): Promise<DockerfileBuildPlan>;
442
445
  declare function loadImagePlan(image: Image, options?: Pick<CreateSandboxImageOptions, "registeredName" | "contextDir">): DockerfileBuildPlan;
446
+ declare function registerImage(context: BuildContext, name: string, dockerfile: string, snapshotId: string, snapshotSandboxId: string, snapshotUri: string, snapshotSizeBytes: number, rootfsDiskBytes: number, isPublic: boolean, snapshotFormatVersion?: string): Promise<Record<string, unknown>>;
443
447
  declare function createSandboxImage(source: SandboxImageSource, options?: CreateSandboxImageOptions, deps?: CreateSandboxImageDeps): Promise<Record<string, unknown>>;
444
448
  declare function runCreateSandboxImageCli(argv?: string[]): Promise<void>;
445
449
 
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, type SandboxInfo as e, SandboxStatus 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 };
450
+ export { dockerfileContent 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, type SnapshotWaitCondition as Y, StdinMode as Z, createSandboxImage as _, type CreateAndConnectOptions as a, type BuildContext as a0, defaultRegisteredName as a1, loadDockerfilePlan as a2, loadImagePlan as a3, logicalDockerfileLines as a4, registerImage as a5, runCreateSandboxImageCli as a6, type SandboxClientOptions as b, type ConnectOptions as c, type SnapshotInfo as d, type SandboxInfo as e, SandboxStatus 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 };