Skip to content

fix(runpod): migrate one-shot jobs from retired REST v1 to v2 - #283

Merged
ProfSynapse merged 1 commit into
mainfrom
fix/runpod-rest-v1-shutdown-282
Nov 17, 2026
Merged

ProfSynapse merged 1 commit into
mainfrom
fix/runpod-rest-v1-shutdown-282

Conversation

@ProfSynapse

Copy link
Copy Markdown
Owner

Fixes #282.

RunPod's current overview says REST v1 is no longer available. Migrate the one-shot launcher to https://api.runpod.io/v2, including nested create fields, explicit entrypoint/CMD, CUDA constraints under gpu, and the top-level cost response field. Explicitly preserve v1's default 20 GB /workspace persistent mount. The removed download-speed filter is now a deprecated compatibility flag with a warning.

Cleanup uses DELETE /v2/pods/{id}, no request body, empty HTTP 204 response. Exhausted termination attempts now raise an error so the launcher cannot silently succeed or create another host while the previous pod may still be billing. Retain GraphQL uptime polling. Update manual sweep guidance and keep all three skill copies identical. Add 13 offline contract/lifecycle tests.

Official documentation checked November 17, 2026:

SDK audit: requirements-cloud.txt specifies runpod>=1.7.0, not an exact pin. Minimum-version source and installed 1.12.0 use GraphQL for pod create/get/terminate, so no SDK requirement or backend change is needed for the REST v1 shutdown.

Validation:

  • Main checkout tests-only CPython 3.12 venv initially stopped at ModuleNotFoundError: No module named 'jsonschema'. Supplied jsonschema and dependencies in a temporary worktree-only target directory, without modifying the shared venv.
  • With that temporary dependency directory on PYTHONPATH: python -m pytest tests/cloud/test_runpod_backend.py tests/cloud/test_runpod_run_job.py --basetemp=.test-tmp-282 -o cache_dir=.pytest-cache-282 -q
  • Actual final output: 57 passed in 2.59s.
  • Generated create body with CUDA constraints validates against official v2 OpenAPI JSON Schema.
  • python3 .skills/scripts/sync_skill_trees.py --check: Skill trees are in sync.
  • git diff --check: passed.
  • Authenticated read-only GET skipped: no RUNPOD_API_KEY in main checkout .env. No real pods created, started, terminated, or paid resources used.

Live test left for Joseph (not performed here):

  1. Export credentials privately; review a --dry-run spec using the launcher, a full reviewed commit SHA, and pinned image.
  2. Run those arguments with --probe-only --max-hosts 1 --timeout-min 5 and without --dry-run. This is a paid single-pod boot/cleanup check.
  3. Record the pod ID; confirm termination, then verify that exact ID is removed in the console/API (GET by ID should return 404). If interrupted or cleanup fails, immediately use the documented v2 DELETE sweep and confirm 204/removal. Offline tests do not prove live GPU boot/create/terminate behavior.

🤖 Generated with Claude Code

@ProfSynapse
ProfSynapse merged commit 69c31a2 into main Nov 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RunPod REST API v1 shuts down Nov 15: update runpod_run_job.py

1 participant