restore#

SandboxRuntime.restore(checkpoint_path: str, cpu: float | None = None, memory: str | int | float | None = None, ttl_seconds: int | None = None, timeout_seconds: float = 30.0, **kwargs) → str[source]#

Restore a sandbox instance from a previously saved checkpoint.

The restored sandbox preserves the full execution state, network mode, mounts, Linux capabilities, and process environment of the checkpointed sandbox. Cgroup resource allocations (cpu, memory) and lifecycle limits (ttl_seconds, timeout_seconds) can optionally be overridden.

Parameters:
  • checkpoint_path (str) – Path to the checkpoint directory.

  • cpu (float | None) – CPU allocation override.

  • memory (str | int | float | None) – Memory allocation override.

  • ttl_seconds (int | None) – Optional time-to-live for the restored sandbox.

  • timeout_seconds (float) – Timeout for the restore operation.

  • **kwargs – Backend-specific arguments.

Returns:

A unique string identifier for the restored sandbox.

Return type:

str