Repository navigation
fix(apps): accept datacenter ids outside the built-in list - #690
Merged
Merged
Conversation
The SDK's DataCenter enum is a hardcoded snapshot and goes stale as new datacenters come online. Rejecting ids outside it left users unable to name the datacenter their workers can actually run in. The backend validates datacenter ids, so the SDK now passes unrecognized ids through unchanged and logs a warning once per id. - normalize_datacenter keeps known values and string variants as before; unrecognized non-empty ids pass through with a warning; blank and non-string values still raise InvalidResourceError - placement keeps unrecognized pins as candidates (stock is only queried for built-in datacenters) and no longer crashes on an existing volume in an unrecognized datacenter - network volume pins accept unrecognized ids; the datacenter catalog still decides network volume support
KAJdev
approved these changes
Nov 6, 2026
Reword the warning for an unrecognized datacenter id to say it does not look valid but will be used anyway, and link the data center list in the API reference so users can check the id.
Promptless documentation updates
|
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.
Summary
runpod.appsresources now accept datacenter ids that are not in the SDK's built-inDataCenterenum. Unrecognized ids are passed to the API unchanged, with a warning logged once per id.Why
The
DataCenterenum is a hardcoded snapshot and goes stale whenever new datacenters come online. Todaynormalize_datacenter()raisesInvalidResourceErrorfor anything outside it, so a user whose workers can only run in a datacenter the SDK does not list has no way to name it. Without an explicit datacenter the SDK falls back to its built-in default lists, and on such an account the endpoint is created but workers are never scheduled (jobs stayIN_QUEUE). The backend validates datacenter ids anyway, so the client-side check only blocks valid configurations.An explicit
datacenter=already bypasses the CPU/GPU default location lists in the deploy and dev payloads, so accepting the id is enough for it to reachlocations. The default lists are unchanged.Changes
spec.normalize_datacenter: known values and string variants (case, underscores, whitespace) normalize exactly as before. Unrecognized non-empty ids pass through (whitespace-stripped) with a single warning per id. Blank and non-string values still raiseInvalidResourceError.datacenter.py: addsdatacenter_id()(lenient normalization) andDataCenter.is_known().placement.candidates: unrecognized pins stay candidates. Stock is only queried for built-in datacenters, so the SDK cannot rule them out; the backend decides.placement.solve_placement: an existing network volume in an unrecognized datacenter no longer raises a bareValueError. It resolves normally when resources are pinned there; otherwise it surfaces the usualPlacementError.volume.VolumeResolver: network volume datacenter pins accept unrecognized ids. Network volume support is still checked against the live datacenter catalog.Rollout note
Workers re-run
ResourceSpec.validatewhen they import the user module, and they use the SDK version baked into the worker image. Until a release containing this change reaches the worker images, workers running an older SDK still reject an unrecognized datacenter id at import time, even though the client accepted it and the endpoint was created with it. Adding this version to the endpoint's dependencies does not help, becauserunpodis already imported on the worker before dependencies are installed.Until then, pin the datacenter on the client only:
Test plan
Noneand non-string values are rejectedlocationscontains the unrecognized id for GPU, cpu3 and cpu5 resourcesmake quality-check: 2773 passed, 94.35% coverage