Checkpoints
Checkpoints capture the state of an existing runtime so it can be restored into
a new runtime later. The CLI command group is currently named snapshot; the
SDKs and REST API use the checkpoint terminology.
Create a Checkpoint
Section titled “Create a Checkpoint”runta snapshot create worker worker-checkpointcheckpoint = runtime.checkpoints.create(name="worker-checkpoint")const checkpoint = await runtime.checkpoints.create("full", "worker-checkpoint");curl -sS -X POST "$RUNTA_ENDPOINT/v1/runtimes/worker/checkpoints" \ -H "Authorization: Bearer $RUNTA_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "kind": "full", "name": "worker-checkpoint" }'The current public REST API supports full checkpoints.
List and Inspect
Section titled “List and Inspect”runta snapshot lsrunta snapshot ls --allfor checkpoint in runta.checkpoints.list(include_system=True): print(checkpoint.id, checkpoint.display_name, checkpoint.state)for (const checkpoint of await runta.checkpoints.list({ includeSystem: true })) { console.log(checkpoint.id, checkpoint.display_name, checkpoint.state);}Use --all or include_system=True only when you also need
system-managed idle checkpoints.
Restore
Section titled “Restore”Restoring a checkpoint creates a new runtime.
runta snapshot restore worker-checkpoint worker-restoredrunta snapshot restore worker-checkpoint web-restored --publish 8080/httpsrestored = runta.runtimes.create( "worker-restored", checkpoint_id=checkpoint.id,)const restored = await runtime.restore(checkpoint.id, { name: "worker-restored",});You can restore the same checkpoint more than once to fork multiple runtimes from the same captured state.
Delete
Section titled “Delete”runta snapshot rm worker-checkpointrunta.checkpoints.delete(checkpoint.id)await runta.checkpoints.delete(checkpoint.id);