feat: implement pod snapshot method#339
feat: implement pod snapshot method#339shrutiyam-glitch wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
✅ Deploy Preview for agent-sandbox canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shrutiyam-glitch The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @shrutiyam-glitch. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
clients/python/agentic-sandbox-client/k8s_agent_sandbox/gke_extensions/podsnapshot_client.py
Show resolved
Hide resolved
clients/python/agentic-sandbox-client/k8s_agent_sandbox/gke_extensions/podsnapshot_client.py
Show resolved
Hide resolved
clients/python/agentic-sandbox-client/k8s_agent_sandbox/gke_extensions/podsnapshot_client.py
Show resolved
Hide resolved
clients/python/agentic-sandbox-client/k8s_agent_sandbox/gke_extensions/podsnapshot_client.py
Outdated
Show resolved
Hide resolved
clients/python/agentic-sandbox-client/k8s_agent_sandbox/gke_extensions/podsnapshot_client.py
Outdated
Show resolved
Hide resolved
clients/python/agentic-sandbox-client/k8s_agent_sandbox/gke_extensions/podsnapshot_client.py
Show resolved
Hide resolved
|
/lgtm |
|
@SHRUTI6991: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
6dacc55 to
fd7a2c0
Compare
Depends on: #338 #337
This PR completes the Pod Snapshot extension for the Python SDK by implementing the
snapshot()method and the underlying logic to monitor snapshot completion.Core Logic Implementation:
snapshot()method creates aPodSnapshotManualTriggerresource for the target pod, using a unique hash suffix to avoid name collisions._wait_for_snapshot_to_be_completed, which uses the Kubernetes watch API to block until the snapshot controller marks the trigger asComplete. It specifically looks for the Triggered condition with aTruestatus andCompletereason.snapshot_uidfrom the resource status and returns a structuredSnapshotResponse, providing the user with the unique identifier needed for future restores.__exit__method to ensure that allPodSnapshotManualTriggerresources created during the session are automatically deleted, maintaining a clean namespace.Testing Done:
Integration Test: Added
test_podsnapshot_extension.pywhich verifies the full E2E flow:-- Starts a sandbox with a counter application.
-- Creates two sequential snapshots (test-snapshot-10 at 10 seconds and test-snapshot-20 at 20 seconds).
Unit tests are added
Follow-up PR:
Restore example, is_restored() check added in the following PR (#249)
List_snapshots, delete_snapshots and restoring from dedicated snapshot will be added in the following PRs.
Output: