restore#

ray.experimental.sandbox.restore(checkpoint_path: str | CheckpointPath, cpu: float | None = None, memory: str | int | float | None = None, ttl_seconds: int | None = None, timeout_seconds: float = 30.0, resources: Dict[str, float] | None = None, **kwargs) → ActorHandle[source]#

Restore a remote sandbox environment from a checkpoint managed by a Ray actor.

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.

A checkpoint lives on the node that took it, so the restored actor is scheduled there, with the checkpointed sandbox’s CPU and memory unless overridden.

Parameters:
  • checkpoint_path (str | CheckpointPath) – Path to the checkpoint bundle directory, or a CheckpointPath instance returned by Sandbox.checkpoint() or SandboxRuntime.checkpoint().

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

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

  • ttl_seconds (int | None) – Optional time-to-live in seconds.

  • timeout_seconds (float) – Timeout in seconds for restore.

  • resources (Dict[str, float] | None) – Custom logical resource requirements for the Ray actor.

  • **kwargs – Additional options.

Returns:

A Sandbox actor handle.

Return type:

ActorHandle

PublicAPI (alpha): This API is in alpha and may change before becoming stable.