Skip to content

Commit eca273f

Browse files
[Verda] Rename datacrunch to verda (#205)
1 parent 4480da3 commit eca273f

11 files changed

Lines changed: 82 additions & 72 deletions

File tree

.github/workflows/catalogs.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ jobs:
7070
path: azure.csv
7171
retention-days: 1
7272

73-
catalog-datacrunch:
74-
name: Collect DataCrunch catalog
73+
catalog-verda:
74+
name: Collect Verda catalog
7575
runs-on: ubuntu-latest
7676
steps:
7777
- uses: actions/checkout@v4
@@ -81,17 +81,22 @@ jobs:
8181
- name: Install dependencies
8282
run: |
8383
pip install pip -U
84-
pip install -e '.[datacrunch]'
84+
pip install -e '.[verda]'
8585
- name: Collect catalog
8686
working-directory: src
8787
env:
88-
DATACRUNCH_CLIENT_ID: ${{ secrets.DATACRUNCH_CLIENT_ID }}
89-
DATACRUNCH_CLIENT_SECRET: ${{ secrets.DATACRUNCH_CLIENT_SECRET }}
90-
run: python -m gpuhunt datacrunch --output ../datacrunch.csv
88+
VERDA_CLIENT_ID: ${{ secrets.VERDA_CLIENT_ID }}
89+
VERDA_CLIENT_SECRET: ${{ secrets.VERDA_CLIENT_SECRET }}
90+
run: |
91+
python -m gpuhunt verda --output ../verda.csv
92+
# Copy for backward compatibility
93+
cp ../verda.csv ../datacrunch.csv
9194
- uses: actions/upload-artifact@v4
9295
with:
93-
name: catalogs-datacrunch
94-
path: datacrunch.csv
96+
name: catalogs-verda
97+
path: |
98+
verda.csv
99+
datacrunch.csv
95100
retention-days: 1
96101

97102
catalog-gcp:
@@ -252,7 +257,7 @@ jobs:
252257
needs:
253258
- catalog-aws
254259
- catalog-azure
255-
- catalog-datacrunch
260+
- catalog-verda
256261
- catalog-gcp
257262
- catalog-lambdalabs
258263
- catalog-nebius

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ jobs:
4747
run: |
4848
IGNORE=
4949
if [[ "${{ matrix.python-version }}" == "3.9" ]]; then
50-
IGNORE="--ignore src/gpuhunt/providers/nebius.py"
50+
IGNORE="--ignore src/gpuhunt/providers/nebius.py --ignore src/gpuhunt/providers/verda.py"
5151
fi
5252
pytest --doctest-modules src/gpuhunt $IGNORE
5353
- name: Run pytest
5454
run: |
55-
pytest src/tests
55+
IGNORE=
56+
if [[ "${{ matrix.python-version }}" == "3.9" ]]; then
57+
IGNORE="--ignore src/tests/providers/test_verda.py"
58+
fi
59+
pytest src/tests $IGNORE

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ print(*items, sep="\n")
6060
* Azure
6161
* CloudRift
6262
* Cudo Compute
63-
* DataCrunch
63+
* Verda
6464
* GCP
6565
* LambdaLabs
6666
* Nebius

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ oci = [
5252
"oci",
5353
"pydantic>=1.10.10,<2.0.0",
5454
]
55-
datacrunch = [
56-
"datacrunch"
55+
verda = [
56+
'verda',
5757
]
58-
all = ["gpuhunt[aws,azure,datacrunch,gcp,maybe_nebius,oci]"]
58+
maybe_verda = [
59+
'verda; python_version>="3.10"',
60+
]
61+
all = ["gpuhunt[aws,azure,maybe_verda,gcp,maybe_nebius,oci]"]
5962
dev = [
6063
"pre-commit",
6164
"pytest~=7.0",

src/gpuhunt/__main__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def main():
1515
"azure",
1616
"cloudrift",
1717
"cudo",
18-
"datacrunch",
18+
"verda",
1919
"digitalocean",
2020
"gcp",
2121
"hotaisle",
@@ -49,12 +49,10 @@ def main():
4949
from gpuhunt.providers.cloudrift import CloudRiftProvider
5050

5151
provider = CloudRiftProvider()
52-
elif args.provider == "datacrunch":
53-
from gpuhunt.providers.datacrunch import DataCrunchProvider
52+
elif args.provider == "verda":
53+
from gpuhunt.providers.verda import VerdaProvider
5454

55-
provider = DataCrunchProvider(
56-
os.getenv("DATACRUNCH_CLIENT_ID"), os.getenv("DATACRUNCH_CLIENT_SECRET")
57-
)
55+
provider = VerdaProvider(os.getenv("VERDA_CLIENT_ID"), os.getenv("VERDA_CLIENT_SECRET"))
5856
elif args.provider == "digitalocean":
5957
from gpuhunt.providers.digitalocean import DigitalOceanProvider
6058

src/gpuhunt/_internal/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
OFFLINE_PROVIDERS = [
2525
"aws",
2626
"azure",
27-
"datacrunch",
27+
"verda",
2828
"gcp",
2929
"lambdalabs",
3030
"nebius",
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from collections.abc import Iterable
66
from typing import Optional
77

8-
from datacrunch import DataCrunchClient
9-
from datacrunch.instance_types.instance_types import InstanceType
8+
from verda import VerdaClient
9+
from verda.instance_types import InstanceType
1010

1111
from gpuhunt import QueryFilter, RawCatalogItem
1212
from gpuhunt.providers import AbstractProvider
@@ -19,11 +19,11 @@
1919
]
2020

2121

22-
class DataCrunchProvider(AbstractProvider):
23-
NAME = "datacrunch"
22+
class VerdaProvider(AbstractProvider):
23+
NAME = "verda"
2424

2525
def __init__(self, client_id: str, client_secret: str) -> None:
26-
self.datacrunch_client = DataCrunchClient(client_id, client_secret)
26+
self.verda_client = VerdaClient(client_id, client_secret)
2727

2828
def get(
2929
self, query_filter: Optional[QueryFilter] = None, balance_resources: bool = True
@@ -38,10 +38,10 @@ def get(
3838
return sorted(instances, key=lambda x: x.price)
3939

4040
def _get_instance_types(self) -> list[InstanceType]:
41-
return self.datacrunch_client.instance_types.get()
41+
return self.verda_client.instance_types.get()
4242

4343
def _get_locations(self) -> list[dict]:
44-
return self.datacrunch_client.locations.get()
44+
return self.verda_client.locations.get()
4545

4646
@classmethod
4747
def filter(cls, offers: list[RawCatalogItem]) -> list[RawCatalogItem]:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
import pytest
66

7-
from gpuhunt.providers.datacrunch import ALL_AMD_GPUS, GPU_MAP
7+
from gpuhunt.providers.verda import ALL_AMD_GPUS, GPU_MAP
88

99

1010
@pytest.fixture
1111
def data_rows(catalog_dir: Path) -> list[dict]:
12-
file = catalog_dir / "datacrunch.csv"
12+
file = catalog_dir / "verda.csv"
1313
reader = csv.DictReader(file.open())
1414
return list(reader)
1515

src/tests/_internal/test_constraints.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def item() -> CatalogItem:
2727

2828
@pytest.fixture
2929
def cpu_items() -> list[CatalogItem]:
30-
datacrunch = CatalogItem(
30+
verda = CatalogItem(
3131
instance_name="CPU.120V.480G",
3232
location="ICE-01",
3333
price=3.0,
@@ -38,7 +38,7 @@ def cpu_items() -> list[CatalogItem]:
3838
gpu_name=None,
3939
gpu_memory=None,
4040
spot=False,
41-
provider="datacrunch",
41+
provider="verda",
4242
disk_size=None,
4343
)
4444
aws = CatalogItem(
@@ -55,7 +55,7 @@ def cpu_items() -> list[CatalogItem]:
5555
provider="aws",
5656
disk_size=None,
5757
)
58-
return [datacrunch, aws]
58+
return [verda, aws]
5959

6060

6161
class TestMatches:
@@ -154,19 +154,19 @@ def test_ti_gpu(self):
154154
assert matches(item, QueryFilter(gpu_name=["RTX3060TI"]))
155155

156156
def test_provider(self, cpu_items):
157-
assert matches(cpu_items[0], QueryFilter(provider=["datacrunch"]))
158-
assert matches(cpu_items[0], QueryFilter(provider=["DataCrunch"]))
157+
assert matches(cpu_items[0], QueryFilter(provider=["verda"]))
158+
assert matches(cpu_items[0], QueryFilter(provider=["verda"]))
159159
assert not matches(cpu_items[0], QueryFilter(provider=["aws"]))
160160

161161
assert matches(cpu_items[1], QueryFilter(provider=["aws"]))
162162
assert matches(cpu_items[1], QueryFilter(provider=["AWS"]))
163-
assert not matches(cpu_items[1], QueryFilter(provider=["datacrunch"]))
163+
assert not matches(cpu_items[1], QueryFilter(provider=["verda"]))
164164

165165
def test_provider_with_filter_setattr(self, cpu_items):
166166
q = QueryFilter()
167-
q.provider = ["datacrunch"]
167+
q.provider = ["verda"]
168168
assert matches(cpu_items[0], q)
169-
q.provider = ["DataCrunch"]
169+
q.provider = ["verda"]
170170
assert matches(cpu_items[0], q)
171171
q.provider = ["aws"]
172172
assert not matches(cpu_items[0], q)

src/tests/providers/test_providers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def providers():
1414
"""List of all provider classes"""
1515
members = []
1616
for module_info in pkgutil.walk_packages(gpuhunt.providers.__path__):
17-
if sys.version_info < (3, 10) and module_info.name == "nebius":
17+
if sys.version_info < (3, 10) and module_info.name in ["nebius", "verda"]:
1818
continue
1919
module = importlib.import_module(
2020
f".{module_info.name}",
@@ -48,7 +48,7 @@ def test_all_providers_have_a_names(providers):
4848
def test_catalog_providers(providers):
4949
CATALOG_PROVIDERS = OFFLINE_PROVIDERS + ONLINE_PROVIDERS
5050
if sys.version_info < (3, 10):
51-
CATALOG_PROVIDERS = [p for p in CATALOG_PROVIDERS if p != "nebius"]
51+
CATALOG_PROVIDERS = [p for p in CATALOG_PROVIDERS if p not in ["nebius", "verda"]]
5252
names = [p.NAME for p in providers]
5353
assert set(CATALOG_PROVIDERS) == set(names)
5454
assert len(CATALOG_PROVIDERS) == len(names)

0 commit comments

Comments
 (0)