Skip to content

feat: add datacenter selection example and update volume examples#44

Open
KAJdev wants to merge 2 commits intomainfrom
zeke/ae-2422-datacenter-examples
Open

feat: add datacenter selection example and update volume examples#44
KAJdev wants to merge 2 commits intomainfrom
zeke/ae-2422-datacenter-examples

Conversation

@KAJdev
Copy link
Contributor

@KAJdev KAJdev commented Mar 11, 2026

The flash SDK no longer hardcodes EU-RO-1 as the only datacenter. Endpoint(datacenter=...) accepts a single DC, a list, or None (all DCs). Network volumes take dataCenterId to specify which DC they live in.

Adds 04_scaling_performance/02_datacenters/ with a GPU worker showing single-DC and multi-DC pinning, and a CPU worker showing how CPU DC restrictions work.

Updates the network volume example (05_data_workflows/01_network_volumes/) to explicitly set datacenter on the volumes and datacenter on the endpoints, since the default is now None instead of EU-RO-1.

Companion PR: runpod/flash#266

Copy link
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

Adds new documentation/examples demonstrating datacenter pinning for endpoints, and updates the network volume example to explicitly set datacenter on both the NetworkVolume and Endpoint now that the SDK default is no longer EU-RO-1.

Changes:

  • Add a new 04_scaling_performance/02_datacenters/ example (GPU single-DC + multi-DC, and CPU with CPU-supported DC restriction).
  • Update the 05_data_workflows/01_network_volumes/ GPU/CPU workers to explicitly set datacenter for the shared volume and the endpoints.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
05_data_workflows/01_network_volumes/gpu_worker.py Pins the network volume and GPU endpoint to a specific datacenter.
05_data_workflows/01_network_volumes/cpu_worker.py Pins the shared network volume and CPU endpoint to the same datacenter as the GPU worker.
04_scaling_performance/02_datacenters/gpu_worker.py New example showing single-DC and multi-DC GPU endpoint pinning.
04_scaling_performance/02_datacenters/cpu_worker.py New example showing CPU endpoint pinning to a CPU-supported datacenter.
04_scaling_performance/02_datacenters/README.md New docs describing datacenter selection and the included examples.

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

You can also share your feedback on Copilot code review. Take the survey.

## Quick Start

```bash
pip install -r requirements.txt
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The Quick Start instructs pip install -r requirements.txt, but this example directory does not include a requirements.txt. Update the instructions to reference the repo-level setup (as other examples do) or add the missing requirements file so the commands work as written.

Suggested change
pip install -r requirements.txt
pip install -r ../../requirements.txt

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,29 @@
# cpu worker pinned to a cpu-supported datacenter.
# cpu endpoints are only available in a subset of datacenters
# (see CPU_DATACENTERS). selecting an unsupported DC raises an error.
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

Comment has a sentence starting mid-line after a period; capitalize the first word for readability/grammar.

Suggested change
# (see CPU_DATACENTERS). selecting an unsupported DC raises an error.
# (see CPU_DATACENTERS). Selecting an unsupported DC raises an error.

Copilot uses AI. Check for mistakes.
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