nodus.warm_pool
View MarkdownBounded, cooperative reuse of already-running, same-trust Sandboxes.
No create, wake, replacement or expired-lease recovery is performed. Claims use the API’s resourceVersion compare-and-swap, so workers need not share a filesystem.
WarmPool
Section titled “WarmPool”class WarmPool(name: str, members: list[str], *, project: str, image_digest: str, reset: list[str], ready: list[str], max_jobs: int, max_cost_usd: str, expires_at: str, command_timeout: int = 300, client: Client | None = None) -> NoneA fixed image pool with durable claims, explicit reset and no cold fallback.
Members must already be Running, Ready, capped and have idleTimeout=0s. Every worker uses the same name, project, members and commands. Registration runs readiness once; every successful job runs reset then readiness before return. A failed or interrupted operation leaves its member quarantined (claimed), never automatically reclaimed. Retained idle GPU time is billed normally. Sandbox write access is the trust boundary; claims coordinate cooperating callers, they do not revoke an owner’s ordinary exec or patch permissions.
WarmPool.register
Section titled “WarmPool.register”register() -> NoneAdmit the supplied existing members; never provision or replace compute.
Safe to retry: an uncertain or failed registration remains quarantined. Finish image setup and filesystem mounts before registering.
WarmPool.run
Section titled “WarmPool.run”run(command: list[str]) -> _ProcessClaim once, run, reset and check readiness; return the completed Process.
No ready slot raises immediately. Output stays on the returned Process. On failure/cancellation, retained state is quarantined until an operator deletes that exact Sandbox; it cannot silently serve another request.
main() -> NoneCLI integration: python -m nodus.warm_pool CONFIG.json register|run [argv…].