Repository navigation
Conversation
…d datacenter selection
Resolve conflicts in two files: - runpod/__init__.py: keep the branch's lazy PEP-562 import surface and add main's serverless startup gate (run_import_checks). main's eager import block is dropped as redundant -- every name it exported is already resolvable through _LAZY_ATTRS. - README.md: keep the branch's apps-SDK rewrite (Installation, Example, Contributing) and append main's new sections (Serverless Worker, Worker Fitness Checks, Network-Volume Warm Cache, REST API v2, Pods, Directory). Dropped main's duplicate "Community and Contributing" and redundant Python-3.10 note already covered by the new intro.
runpod-Henrik
approved these changes
Oct 22, 2026
runpod-Henrik
left a comment
Contributor
There was a problem hiding this comment.
Re-reviewed from d5abe4b1 to abb210e6: still approve. Most of the 148-commit compare is main (the apps SDK and others); this PR's own change since my review is the shared-storage and lifecycle work, the failure-ownership hardening, and the naming fixes. The ownership work is the part I'd have worried about most, and it's covered: a failed create whose problem body carries sandboxId now becomes SandboxCreationError with the id kept and the sandbox terminated, and only a sandbox_starting 409 is retried, so container_exited and sandbox_terminated fail straight away.
Checked:
- Tests. The sandbox suite went from 23 to 63 tests and all pass locally, as does the whole unit suite (1,599). Putting back status-only 409 retries fails three of the new tests, and dropping the id capture on a failed create fails four, so both behaviours are pinned. CI is green on 3.10 to 3.14, and the branch merges cleanly with current main.
- Dev, end to end (22 Oct, 11:52 PDT,
v2-rest.runpod.dev). Sync and async: create,exec(exit_code0,duration_msandtruncatedfilled in),check=Trueonexit 3raisingSandboxExecutionErrorwithexit_code3,extend,update, and context exit leaving both sandboxesTERMINATED/USER_REQUESTED. The first command came back 3 to 4 s after the create call. - My earlier points.
AsyncioSandboxLogStreamnow matchesAsyncioSandbox,vcpu_countis a float as the spec says, and the aiohttp_retry_connectionoverride is asserted in the tests. Thanks.
Two things against the current REST contract, neither blocking:
- The wire still uses the names rphttp2 has deprecated. Create sends
imageName,cpuFlavorId,vcpuCountandmemoryInGb, andSandboxInfo.imageis read from the response'simageName. The REST API now marks all of those deprecated in favour ofimageandcpu: {id, vcpuCount}(memory is derived from the flavor). They work today, but the plan for the deprecateddataCenterIdwas "move the probe and the SDK, then remove", and the same will apply here: once the aliases go, create becomes a 4xx (rphttp2 rejects unknown fields) andinfo.imagequietly turnsNone. Since the public parameter is alreadyimage, switching the wire toimageand readingimage(falling back toimageName) is a small change now.cpuneeds bothidandvcpuCount, so sending it when only one ofcpu_flavor_id/vcpu_countis given needs a decision; keeping the aliases for that case until the server fills in the missing half is fine, as long as it's deliberate. - Creating with neither
imagenortemplate_idis refused client-side ("Supply exactly one of image or template_id"), but the API now accepts it and runs the default sandbox image. Allowing "at most one" would match the server.
| await asyncio.wait_for(queued.wait(), 2) | ||
| task.cancel() | ||
| with pytest.raises(asyncio.CancelledError): | ||
| await task |
This branch has not been deployed
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.
SandboxandAsyncioSandboxshare lifecycle and execution behavior. Owned contexts terminate remote compute on exit; handles returned byget()orlist()close only their local connections. Interrupted creation and failed provisioning preserve cleanup ownership and recoverable sandbox IDs.Configure
RUNPOD_API_BASE_URLfor an authorized sandbox-enabled environment and supplyRUNPOD_API_KEY. Creation and execution options require the API contracts in rphttp2#326 and rphttp2#315.exec()retains partial output on failure, acceptstimeout_seconds, and supports detached commands withbackground=True. A detached acknowledgement confirms startup, not completion. Foreground execution remains subject to the backend's current four-second cap.logs()streams container or system logs with resumable event IDs. Quiet container log delivery depends on CON-1557 / runpod/host#2820.Linear: CON-1523, CON-1524, CON-1525, CON-1526
General README onboarding is tracked in #610.