Skip to content

Commit f552cdf

Browse files
authored
Merge pull request #52 from DataCrunch-io/fin-03-default
Change default datacenter from FIN-01 to FIN-03
2 parents 2ebf842 + b8dcdb2 commit f552cdf

File tree

10 files changed

+28
-19
lines changed

10 files changed

+28
-19
lines changed

.readthedocs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ sphinx:
3232
python:
3333
install:
3434
- requirements: docs/requirements.txt
35+
- method: pip
36+
path: .
37+

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111

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

34+
### Added
35+
36+
- Added constants for `FIN-02` and `FIN-03`.
37+
3338
## [1.15.0] - 2025-10-23
3439

3540
### Added

datacrunch/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def __init__(self):
5858

5959
class Locations:
6060
FIN_01: str = 'FIN-01'
61+
FIN_02: str = 'FIN-02'
62+
FIN_03: str = 'FIN-03'
6163
ICE_01: str = 'ICE-01'
6264

6365
def __init__(self):

datacrunch/instances/instances.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Instance:
3232
gpu_memory: GPU memory configuration details.
3333
ip: IP address assigned to the instance.
3434
os_volume_id: ID of the operating system volume.
35-
location: Datacenter location code (default: Locations.FIN_01).
35+
location: Datacenter location code (default: Locations.FIN_03).
3636
image: Image ID or type used for the instance.
3737
startup_script_id: ID of the startup script to run.
3838
is_spot: Whether the instance is a spot instance.
@@ -57,7 +57,7 @@ class Instance:
5757
ip: Optional[str] = None
5858
# Can be None if instance is still not provisioned
5959
os_volume_id: Optional[str] = None
60-
location: str = Locations.FIN_01
60+
location: str = Locations.FIN_03
6161
image: Optional[str] = None
6262
startup_script_id: Optional[str] = None
6363
is_spot: bool = False
@@ -118,7 +118,7 @@ def create(
118118
hostname: str,
119119
description: str,
120120
ssh_key_ids: list = [],
121-
location: str = Locations.FIN_01,
121+
location: str = Locations.FIN_03,
122122
startup_script_id: Optional[str] = None,
123123
volumes: Optional[List[Dict]] = None,
124124
existing_volumes: Optional[List[str]] = None,
@@ -141,7 +141,7 @@ def create(
141141
hostname: Network hostname for the instance.
142142
description: Human-readable description of the instance.
143143
ssh_key_ids: List of SSH key IDs to associate with the instance.
144-
location: Datacenter location code (default: Locations.FIN_01).
144+
location: Datacenter location code (default: Locations.FIN_03).
145145
startup_script_id: Optional ID of startup script to run.
146146
volumes: Optional list of volume configurations to create.
147147
existing_volumes: Optional list of existing volume IDs to attach.

datacrunch/volumes/volumes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(
1818
is_os_volume: bool,
1919
created_at: str,
2020
target: str = None,
21-
location: str = Locations.FIN_01,
21+
location: str = Locations.FIN_03,
2222
instance_id: str = None,
2323
ssh_key_ids: List[str] = [],
2424
deleted_at: str = None,
@@ -41,7 +41,7 @@ def __init__(
4141
:type created_at: str
4242
:param target: target device e.g. vda
4343
:type target: str, optional
44-
:param location: datacenter location, defaults to "FIN-01"
44+
:param location: datacenter location, defaults to "FIN-03"
4545
:type location: str, optional
4646
:param instance_id: the instance id the volume is attached to, None if detached
4747
:type instance_id: str
@@ -250,7 +250,7 @@ def create(
250250
name: str,
251251
size: int,
252252
instance_id: str = None,
253-
location: str = Locations.FIN_01,
253+
location: str = Locations.FIN_03,
254254
) -> Volume:
255255
"""Create new volume
256256
@@ -262,7 +262,7 @@ def create(
262262
:type size: int
263263
:param instance_id: Instance id to be attached to, defaults to None
264264
:type instance_id: str, optional
265-
:param location: datacenter location, defaults to "FIN-01"
265+
:param location: datacenter location, defaults to "FIN-03"
266266
:type location: str, optional
267267
:return: the new volume object
268268
:rtype: Volume

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
sphinx>=7.0.0
22
recommonmark>=0.7.1
3-
datacrunch>=1.8.3

docs/source/conf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313
# documentation root, use os.path.abspath to make it absolute, like shown here.
1414
#
1515
import datetime
16+
from importlib.metadata import version as pkg_version, PackageNotFoundError
1617
from recommonmark.parser import CommonMarkParser
17-
from datacrunch import __version__
1818
import os
1919
import sys
2020

21-
sys.path.insert(0, os.path.abspath('../../'))
22-
2321
# -- Project information -----------------------------------------------------
2422
current_year = datetime.datetime.now().year
2523

2624
project = 'DataCrunch Python SDK'
2725
copyright = f'{current_year}, DataCrunch.io'
2826
author = 'DataCrunch.io'
2927

30-
# The short X.Y version
31-
version = __version__
32-
# The full version, including alpha/beta/rc tags
33-
release = __version__
28+
try:
29+
release = pkg_version('datacrunch')
30+
except PackageNotFoundError:
31+
release = '0.0.0+dev'
32+
33+
version = release
3434

3535

3636
# -- General configuration ---------------------------------------------------

examples/simple_create_instance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
instance = datacrunch.instances.create(
1919
instance_type='1V100.6V',
2020
image='ubuntu-22.04-cuda-12.0-docker',
21-
location=Locations.FIN_01,
21+
location=Locations.FIN_03,
2222
ssh_key_ids=ssh_keys_ids,
2323
hostname='example',
2424
description='example instance',

tests/integration_tests/test_instances.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_create_instance(self, datacrunch_client: DataCrunchClient):
1616
# create instance
1717
instance = datacrunch_client.instances.create(
1818
hostname='test-instance',
19-
location=Locations.FIN_01,
19+
location=Locations.FIN_03,
2020
instance_type='CPU.4V',
2121
description='test instance',
2222
image='ubuntu-18.04',

tests/unit_tests/volumes/test_volumes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_initialize_a_volume(self):
9595
assert volume.name == HDD_VOL_NAME
9696
assert volume.size == HDD_VOL_SIZE
9797
assert volume.type == HDD
98-
assert volume.location == Locations.FIN_01
98+
assert volume.location == Locations.FIN_03
9999
assert not volume.is_os_volume
100100
assert volume.created_at == HDD_VOL_CREATED_AT
101101
assert volume.target is None

0 commit comments

Comments
 (0)