Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ sphinx:
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Changed default datacenter location to `FIN-03`
- Migrated to `uv`
- Removed `datacrunch.__version__.VERSION`. Use standard [importlib.metadata.version()](https://docs.python.org/3/library/importlib.metadata.html#importlib.metadata.version) instead:
```python
Expand All @@ -30,6 +31,10 @@ If you are working on the library itself, do a fresh clone or upgrade your local
uv run python examples/simple_create_instance.py
```

### Added

- Added constants for `FIN-02` and `FIN-03`.

## [1.15.0] - 2025-10-23

### Added
Expand Down
2 changes: 2 additions & 0 deletions datacrunch/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def __init__(self):

class Locations:
FIN_01: str = 'FIN-01'
FIN_02: str = 'FIN-02'
FIN_03: str = 'FIN-03'
ICE_01: str = 'ICE-01'

def __init__(self):
Expand Down
8 changes: 4 additions & 4 deletions datacrunch/instances/instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Instance:
gpu_memory: GPU memory configuration details.
ip: IP address assigned to the instance.
os_volume_id: ID of the operating system volume.
location: Datacenter location code (default: Locations.FIN_01).
location: Datacenter location code (default: Locations.FIN_03).
image: Image ID or type used for the instance.
startup_script_id: ID of the startup script to run.
is_spot: Whether the instance is a spot instance.
Expand All @@ -57,7 +57,7 @@ class Instance:
ip: Optional[str] = None
# Can be None if instance is still not provisioned
os_volume_id: Optional[str] = None
location: str = Locations.FIN_01
location: str = Locations.FIN_03
image: Optional[str] = None
startup_script_id: Optional[str] = None
is_spot: bool = False
Expand Down Expand Up @@ -118,7 +118,7 @@ def create(
hostname: str,
description: str,
ssh_key_ids: list = [],
location: str = Locations.FIN_01,
location: str = Locations.FIN_03,
startup_script_id: Optional[str] = None,
volumes: Optional[List[Dict]] = None,
existing_volumes: Optional[List[str]] = None,
Expand All @@ -141,7 +141,7 @@ def create(
hostname: Network hostname for the instance.
description: Human-readable description of the instance.
ssh_key_ids: List of SSH key IDs to associate with the instance.
location: Datacenter location code (default: Locations.FIN_01).
location: Datacenter location code (default: Locations.FIN_03).
startup_script_id: Optional ID of startup script to run.
volumes: Optional list of volume configurations to create.
existing_volumes: Optional list of existing volume IDs to attach.
Expand Down
8 changes: 4 additions & 4 deletions datacrunch/volumes/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(
is_os_volume: bool,
created_at: str,
target: str = None,
location: str = Locations.FIN_01,
location: str = Locations.FIN_03,
instance_id: str = None,
ssh_key_ids: List[str] = [],
deleted_at: str = None,
Expand All @@ -41,7 +41,7 @@ def __init__(
:type created_at: str
:param target: target device e.g. vda
:type target: str, optional
:param location: datacenter location, defaults to "FIN-01"
:param location: datacenter location, defaults to "FIN-03"
:type location: str, optional
:param instance_id: the instance id the volume is attached to, None if detached
:type instance_id: str
Expand Down Expand Up @@ -250,7 +250,7 @@ def create(
name: str,
size: int,
instance_id: str = None,
location: str = Locations.FIN_01,
location: str = Locations.FIN_03,
) -> Volume:
"""Create new volume

Expand All @@ -262,7 +262,7 @@ def create(
:type size: int
:param instance_id: Instance id to be attached to, defaults to None
:type instance_id: str, optional
:param location: datacenter location, defaults to "FIN-01"
:param location: datacenter location, defaults to "FIN-03"
:type location: str, optional
:return: the new volume object
:rtype: Volume
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
sphinx>=7.0.0
recommonmark>=0.7.1
datacrunch>=1.8.3
14 changes: 7 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import datetime
from importlib.metadata import version as pkg_version, PackageNotFoundError
from recommonmark.parser import CommonMarkParser
from datacrunch import __version__
import os
import sys

sys.path.insert(0, os.path.abspath('../../'))

# -- Project information -----------------------------------------------------
current_year = datetime.datetime.now().year

project = 'DataCrunch Python SDK'
copyright = f'{current_year}, DataCrunch.io'
author = 'DataCrunch.io'

# The short X.Y version
version = __version__
# The full version, including alpha/beta/rc tags
release = __version__
try:
release = pkg_version('datacrunch')
except PackageNotFoundError:
release = '0.0.0+dev'

version = release


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_create_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
instance = datacrunch.instances.create(
instance_type='1V100.6V',
image='ubuntu-22.04-cuda-12.0-docker',
location=Locations.FIN_01,
location=Locations.FIN_03,
ssh_key_ids=ssh_keys_ids,
hostname='example',
description='example instance',
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/test_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_create_instance(self, datacrunch_client: DataCrunchClient):
# create instance
instance = datacrunch_client.instances.create(
hostname='test-instance',
location=Locations.FIN_01,
location=Locations.FIN_03,
instance_type='CPU.4V',
description='test instance',
image='ubuntu-18.04',
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/volumes/test_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_initialize_a_volume(self):
assert volume.name == HDD_VOL_NAME
assert volume.size == HDD_VOL_SIZE
assert volume.type == HDD
assert volume.location == Locations.FIN_01
assert volume.location == Locations.FIN_03
assert not volume.is_os_volume
assert volume.created_at == HDD_VOL_CREATED_AT
assert volume.target is None
Expand Down