Skip to content

fix: align datacenter enum with valid real-world targets#336

Open
KAJdev wants to merge 2 commits into
mainfrom
zeke/ae-3084-prevent-no-primary-mount-point-error-when-workers-are
Open

fix: align datacenter enum with valid real-world targets#336
KAJdev wants to merge 2 commits into
mainfrom
zeke/ae-3084-prevent-no-primary-mount-point-error-when-workers-are

Conversation

@KAJdev
Copy link
Copy Markdown
Contributor

@KAJdev KAJdev commented May 12, 2026

removes data centers from the DataCenter enum that dont have both storage and s3 support. This should prevent the uncaught "no primary storage mount" error during worker initialization.

Also moves the DataCenter enum out of network_volume.py into datacenter.py.

@KAJdev KAJdev requested a review from deanq May 12, 2026 18:17
@promptless
Copy link
Copy Markdown

promptless Bot commented May 12, 2026

Promptless prepared a documentation update related to this change.

Triggered by runpod/flash PR #336

Updated datacenter reference tables and code examples to reflect the removal of four datacenters that lack storage + S3 support (US-GA-2, US-MD-1, US-NC-1, EUR-IS-1).

Review: Update Flash datacenter documentation

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR narrows the DataCenter enum to supported storage/S3 locations, moves it into a dedicated resource module, and updates related imports/tests.

Changes:

  • Adds core/resources/datacenter.py for DataCenter and CPU_DATACENTERS.
  • Updates resource imports to use the new datacenter module.
  • Refreshes tests to use supported datacenter values and validate new endpoint defaults.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/runpod_flash/core/resources/datacenter.py Defines the moved/pruned datacenter enum and CPU datacenter set.
src/runpod_flash/core/resources/network_volume.py Imports DataCenter from the new module.
src/runpod_flash/core/resources/serverless.py Imports datacenter symbols from the new module.
src/runpod_flash/core/resources/__init__.py Re-exports datacenter symbols from the new module.
src/runpod_flash/endpoint.py Adds default datacenter selection for non-CPU endpoint configs.
tests/unit/test_endpoint.py Updates datacenter imports/values and endpoint default tests.
tests/unit/test_p2_gaps.py Updates datacenter import path.
tests/unit/runtime/test_resource_provisioner.py Updates expected supported datacenter values.
tests/unit/resources/test_serverless.py Updates serverless datacenter tests to supported values.
tests/unit/resources/test_network_volume.py Updates datacenter import path.
tests/unit/cli/commands/build_utils/test_manifest.py Updates manifest fixture imports and datacenter values.
Comments suppressed due to low confidence (1)

src/runpod_flash/endpoint.py:420

  • Using a truthiness check here treats explicit falsy values (for example datacenter="" or datacenter=[]) the same as an omitted datacenter and silently replaces them with all datacenters. Those inputs would otherwise be rejected or preserved by downstream validation, so this can mask bad configuration instead of surfacing an error; check specifically for None when applying the default.
        if not self._is_cpu and not self.is_client and not self.datacenter:
            self.datacenter = DataCenter.all()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +419 to +420
if not self._is_cpu and not self.is_client and not self.datacenter:
self.datacenter = DataCenter.all()
class DataCenter(str, Enum):
"""Enum representing available RunPod data centers.

NOTE: these are only datacenters with storage support, and s3 API support.
field_serializer,
model_validator,
)
from .datacenter import DataCenter
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.

2 participants