Skip to content

Commit de71923

Browse files
V2arKclaude
andcommitted
[SDK] Upgrade platform API client to 4.31.0, drop hardware cost
platform 4.31.0 removed cost_per_hr from HardwareInstanceResponse (#4499), so the pinned 4.28.0 client failed every get_hardware_instances call with a pydantic ValidationError. Move to the published 4.31.0 client and stop rendering the Cost row, which no longer has a source. Build the hardware fixture from the real HardwareInstanceResponse instead of SimpleNamespace; the fake declared cost_per_hr itself, so the suite stayed green against a client that had dropped it. Signed-off-by: Honglin Cao <hocao@nvidia.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 33f3962 commit de71923

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎centml/cli/cluster.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ def get(type, id):
237237
("Status", ready_status),
238238
("Created at", deployment.created_at.strftime("%Y-%m-%d %H:%M:%S")),
239239
("Hardware", f"{hw.name} ({hw.num_gpu}x {hw.gpu_type})"),
240-
("Cost", f"{hw.cost_per_hr / 100} credits/hr"),
241240
]
242241
if depl_type != DeploymentType.JOB:
243242
detail_rows.insert(2, ("Endpoint", deployment.endpoint_url))

‎requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ pyjwt>=2.8.0
55
cryptography==50.0.0
66
websockets>=16.0
77
pyte>=0.8.0
8-
platform-api-python-client==4.28.0
8+
platform-api-python-client==4.31.0
99
click>=8.4.1
1010
typing-extensions>=4.5

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name='centml',
14-
version='0.7.0',
14+
version='0.7.1',
1515
packages=find_packages(exclude=["tests", "tests.*"]),
1616
python_requires=">=3.10",
1717
long_description=open('README.md').read(),

‎tests/test_cli_cluster.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from click.testing import CliRunner
77

88
from centml.cli.cluster import _get_ready_status, _get_service_status, _get_status_error_messages
9-
from centml.sdk import DeploymentStatus, DeploymentType, RolloutStatus, ServiceStatus
9+
from centml.sdk import DeploymentStatus, DeploymentType, HardwareInstanceResponse, RolloutStatus, ServiceStatus
1010

1111

1212
def test_service_status_uses_legacy_service_status_when_present():
@@ -157,7 +157,9 @@ def test_get_job_routes_to_job_api_and_displays_job_config():
157157
from centml.cli.cluster import get
158158

159159
deployment = _deployment(status=DeploymentStatus.ACTIVE)
160-
hardware = SimpleNamespace(id=2, name="h100", num_gpu=8, gpu_type="H100", cost_per_hr=1200)
160+
hardware = HardwareInstanceResponse(
161+
id=2, name="h100", gpu_type="H100", num_gpu=8, cpu=96, memory=1024, cluster_id=1
162+
)
161163
runner = CliRunner()
162164

163165
with _patch_cluster_client() as client:
@@ -177,3 +179,5 @@ def test_get_job_routes_to_job_api_and_displays_job_config():
177179
assert "registry.example.com/job:latest" in result.output
178180
assert "Completions" in result.output
179181
assert "Parallelism" in result.output
182+
assert "h100 (8x H100)" in result.output
183+
assert "credits/hr" not in result.output

0 commit comments

Comments
 (0)