Skip to content

Conversation

@deanq
Copy link
Member

@deanq deanq commented Aug 15, 2025

Changes

Core Features

  • Datacenter locking: All ServerlessResource instances default to DataCenter.EU_RO_1
  • Automatic location mapping: datacenter field automatically syncs to locations field for API compatibility
  • Datacenter validation: Prevents mismatched datacenters between endpoints and network volumes
  • User override capability: Users can specify different datacenters via datacenter or locations parameters

NetworkVolume Simplification

  • Required naming: name field is now required instead of auto-generated
  • Simplified logic: Removed complexity around tracking name origins and auto-generation
  • Larger default size: Increased from 50GB to 100GB for better usability

Volume Management Changes

  • Removed auto-creation: Endpoints no longer automatically create default network volumes
  • Explicit volume handling: Users must explicitly provide volumes when needed
  • Validation: Ensures volume and endpoint datacenters match when volumes are specified

API Improvements

  • Public exports: DataCenter enum now available in public API
  • Container disk size: Increased default from 10GB to 64GB

Test Plan

  • All endpoints default to EU_RO_1 datacenter
  • Datacenter validation prevents mismatched configurations
  • No automatic volume creation when none specified
  • Existing volume deployment still works correctly
  • GraphQL API calls succeed without field errors
  • User can override datacenter when needed

Breaking Changes

  • NetworkVolume.name is now required (was optional with auto-generation)
  • Endpoints no longer auto-create network volumes (must be explicitly provided)
  • PodTemplate.containerDiskInGb default increased from 10GB to 64GB

Migration Guide

# Before: name was optional
volume = NetworkVolume(size=50)

# After: name is required
volume = NetworkVolume(name="my-volume", size=50)

# Before: endpoints auto-created volumes
endpoint = ServerlessResource(name="my-endpoint")
# Volume was created automatically

# After: volumes must be explicit (if needed)
volume = NetworkVolume(name="my-volume")
endpoint = ServerlessResource(name="my-endpoint", networkVolume=volume)

deanq added 7 commits August 14, 2025 22:43
- Make name field required instead of optional with default factory
- Remove auto-generation complexity and user_provided_name tracking
- Simplify resource_id logic since name is always present
- Increase default size from 50GB to 100GB

This simplifies the NetworkVolume API by requiring explicit naming
and removes the complexity around tracking name origins.
- Add datacenter field to ServerlessResource with EU_RO_1 default
- Automatically sync datacenter to locations field for API compatibility
- Add validation to ensure network volume datacenter matches endpoint
- Remove automatic network volume creation for simpler logic
- Add datacenter to _input_only to prevent GraphQL field errors

This ensures all endpoints are locked to EU_RO_1 datacenter by default
while allowing user override and preventing datacenter mismatches.
- Remove test_deploy_without_name_always_creates_new
- Remove test_resource_id_fallback_for_unnamed_volumes

These tests are no longer valid since name is now required.
Keeps tests for named volume behavior which still apply.
… tests

- Add tests for datacenter defaults to EU_RO_1
- Add tests for datacenter override capability
- Add tests for locations field sync from datacenter
- Add tests for datacenter validation between endpoint and volume
- Replace default volume creation test with no-volume behavior test
- Update deployment test to verify locations field is set

Tests now cover the new datacenter locking mechanism and validation
while removing tests for the removed auto-volume creation behavior.
- Add DataCenter to public exports in __init__.py
- Add DataCenter to core resources exports

This allows users to import and use DataCenter enum for
specifying datacenters when creating endpoints and volumes.
Updates PodTemplate containerDiskInGb default to provide more
reasonable disk space for container workloads.
@deanq deanq requested a review from pandyamarut August 15, 2025 05:53
Copy link
Contributor

@pandyamarut pandyamarut left a comment

Choose a reason for hiding this comment

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

/LGTM

@deanq deanq merged commit fc0c928 into main Aug 15, 2025
7 checks passed
@deanq deanq deleted the deanq/volume-defaults branch August 15, 2025 18:34
pandyamarut pushed a commit that referenced this pull request Sep 9, 2025
…es and containers), locking endpoints to EU-RO-1 (#82)

* refactor: require name field for NetworkVolume and simplify API

- Make name field required instead of optional with default factory
- Remove auto-generation complexity and user_provided_name tracking
- Simplify resource_id logic since name is always present
- Increase default size from 50GB to 100GB

This simplifies the NetworkVolume API by requiring explicit naming
and removes the complexity around tracking name origins.

* feat: add datacenter locking and validation for endpoints

- Add datacenter field to ServerlessResource with EU_RO_1 default
- Automatically sync datacenter to locations field for API compatibility
- Add validation to ensure network volume datacenter matches endpoint
- Remove automatic network volume creation for simpler logic
- Add datacenter to _input_only to prevent GraphQL field errors

This ensures all endpoints are locked to EU_RO_1 datacenter by default
while allowing user override and preventing datacenter mismatches.

* test: remove tests for unnamed NetworkVolume behavior

- Remove test_deploy_without_name_always_creates_new
- Remove test_resource_id_fallback_for_unnamed_volumes

These tests are no longer valid since name is now required.
Keeps tests for named volume behavior which still apply.

* test: add datacenter validation tests and remove auto-volume creation tests

- Add tests for datacenter defaults to EU_RO_1
- Add tests for datacenter override capability
- Add tests for locations field sync from datacenter
- Add tests for datacenter validation between endpoint and volume
- Replace default volume creation test with no-volume behavior test
- Update deployment test to verify locations field is set

Tests now cover the new datacenter locking mechanism and validation
while removing tests for the removed auto-volume creation behavior.

* feat: export DataCenter enum for public API

- Add DataCenter to public exports in __init__.py
- Add DataCenter to core resources exports

This allows users to import and use DataCenter enum for
specifying datacenters when creating endpoints and volumes.

* feat: increase default container disk size from 10GB to 64GB

Updates PodTemplate containerDiskInGb default to provide more
reasonable disk space for container workloads.

* fix: deleted
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.

3 participants