fix(gpu,sdk): governed terminate + content-aware upload skip + export/CLI flag fixes - #654
Merged
Merged
Conversation
…/CLI flag fixes
gpu.terminate: terminate through the governed server-side path (DELETE
/gpu/instances/{id}) whenever no explicit api_key is passed. The platform
decrypts the org's stored provider key (which never leaves the API), kills
the pod, verifies it is gone, and only then marks it terminated. The old
client-side path could not see a platform-stored key and failed with
"No API key found for provider 'runpod'", and — worse — it PATCHed the
backend status to "terminated" even when the provider kill failed, stranding
a billing pod as falsely-dead. The BYO-key fallback now marks terminated
only when the provider kill actually succeeded.
datasets.upload_folder: skip_existing now compares content (sha256), not
just path. A pure path match silently dropped modified files, so a dataset
update printed "Uploaded 0 file(s)" and reported success without sending the
changed bytes. Changed files are re-uploaded; unchanged ones are skipped.
sdk: re-export update_dataset at the package top level (parity with
set_dataset_card) so `from openrunner import update_dataset` works.
cli download-artifact / artifact get: accept --output/-o as an alias for the
download dir and add --project/-p to scope the lookup. Previously only
--root/-r existed, so `--project`/`--output` errored — and when masked by a
`|| true` in a launch script that left an idle pod running.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
upload_folder now skips only when path AND sha256 match. Update test_upload_folder_all_skipped to supply the matching sha256, and add coverage for changed content and missing-remote-sha (both re-upload rather than silently skip). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
terminate() now routes through the governed DELETE when no explicit api_key is passed, and never marks a row terminated unless the kill is confirmed. Rewrite the terminate facade tests accordingly: governed path (confirmed / not-confirmed / delete-failed), BYO-key client path, and assert no false-"terminated" PATCH when the provider kill fails. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Four independent SDK/CLI fixes surfaced during a live GPU session.
1.
gpu.terminate— governed server-side kill (cost-safety)openrunner gpu terminateresolved the provider key client-side, so a platform-stored (governed) key never reached it →No API key found for provider 'runpod', and the pod had to be killed by hand in the RunPod console. Worse, the old code PATCHed the backend status toterminatedregardless of whether the provider kill succeeded — stranding a billing pod as falsely-dead (every instance readterminatedwhile one was still alive).Now: when no explicit
api_keyis passed, terminate routes through the governedDELETE /gpu/instances/{id}— the API decrypts the org's stored key (never leaves the server), kills the pod, verifies it's gone, and only then marks itterminated. The API already implemented this; the SDK just wasn't calling it. The BYO-key fallback marksterminatedonly on a confirmed kill.2.
upload_folder(skip_existing=)— compare content, not pathskip_existingcompared only the file path against the remote manifest, so a modified file was silently skipped: a dataset update printedUploaded 0 file(s)and reported success while sending nothing. Now it comparessha256— changed files re-upload, unchanged ones skip.3.
update_datasetnot exported at top levelset_dataset_cardwas re-exported butupdate_datasetwas not, forcingfrom openrunner.datasets import update_dataset. Added to the package top-level imports.4.
download-artifactflagsOnly
--root/-rexisted;--project/--outputerrored (and when masked by|| truein a launch script, left an idle pod). Added--output/-o(alias for the download dir) and--project/-p(scope the lookup) to bothartifact getand thedownload-artifactalias.Test
py_compileclean on all four files; click option aliases verified withCliRunner(-o/--output/-r/--rootall map toroot,-p/--projectparsed). Governed-terminate path verified live:api_client.terminate_instance+get_instanceconfirm status before returning.🤖 Generated with Claude Code