feat: add datacenter selection example and update volume examples#44
feat: add datacenter selection example and update volume examples#44
Conversation
There was a problem hiding this comment.
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 setdatacenterfor 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 |
There was a problem hiding this comment.
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.
| pip install -r requirements.txt | |
| pip install -r ../../requirements.txt |
| @@ -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. | |||
There was a problem hiding this comment.
Comment has a sentence starting mid-line after a period; capitalize the first word for readability/grammar.
| # (see CPU_DATACENTERS). selecting an unsupported DC raises an error. | |
| # (see CPU_DATACENTERS). Selecting an unsupported DC raises an error. |
The flash SDK no longer hardcodes EU-RO-1 as the only datacenter.
Endpoint(datacenter=...)accepts a single DC, a list, orNone(all DCs). Network volumes takedataCenterIdto 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 setdatacenteron the volumes anddatacenteron the endpoints, since the default is nowNoneinstead ofEU-RO-1.Companion PR: runpod/flash#266