example: Add agent-sandbox suspend/resume example with pod snapshots - #5213
Open
vicentefb wants to merge 8 commits into
Open
example: Add agent-sandbox suspend/resume example with pod snapshots #5213vicentefb wants to merge 8 commits into
vicentefb wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit d1c0729. Configure here.
andrewsykim
reviewed
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why are these changes needed?
Follow-up to the existing Agent Sandbox sample (ray-operator/config/samples/agent-sandbox/, docs: Sandboxed Code Execution with Ray and Agent Sandbox (https://docs.ray.io/en/latest/cluster/kubernetes/examples/rayjob-agent-sandbox.html)).
This sample shows how to suspend sandboxes at the turn boundary and resuming them before the next turn, using GKE Pod Snapshots (https://docs.cloud.google.com/kubernetes-engine/docs/concepts/pod-snapshots) through the Agent Sandbox Python SDK's snapshot extension (k8s_agent_sandbox.gke_extensions.snapshots).
Related issue number
Labels
doc-updates-requiredlabel.breaking-changelabel.Checks
Manual test instructions
Tested end-to-end on a GKE Standard cluster (1.36.3, --enable-pod-snapshots, gVisor node pool), with agent-sandbox v1.0.0 and k8s-agent-sandbox==1.0.0. Full setup steps are in the companion docs page ray-project/ray#65779
Measured: warm-pool claim 0.2–0.6s, suspend (snapshot + upload + pod termination) ~5–6s, resume (pod recreate + memory restore) ~4.3s; /tmp state written before suspension was read back successfully after every resume, with restored_from_snapshot=True.