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: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

### Installation

This client uses Platform API `4.37.1`. CServe deployments have been retired;
the CServe SDK helpers and CLI deployment option are no longer available.
This client uses Platform API `4.41.0`.

To install without cloning, run the following command:
```bash
Expand Down
1 change: 1 addition & 0 deletions centml/cli/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
DeploymentType.COMPUTE_V2: "compute",
DeploymentType.RAG: "rag",
DeploymentType.JOB: "job",
DeploymentType.DYNAMO: "dynamo",
}
# use latest type to for user requests
depl_name_to_type_map = {
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ pyjwt>=2.8.0
cryptography==50.0.0
websockets>=16.0
pyte>=0.8.0
platform-api-python-client==4.37.1
platform-api-python-client==4.41.0
click>=8.4.1
typing-extensions>=4.5
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='centml',
version='0.7.2',
version='0.7.3',
packages=find_packages(exclude=["tests", "tests.*"]),
python_requires=">=3.10",
long_description=open('README.md').read(),
Expand Down
45 changes: 45 additions & 0 deletions tests/test_cli_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from types import SimpleNamespace
from unittest.mock import MagicMock, patch

import pytest
from click.testing import CliRunner

from centml.cli.cluster import _get_ready_status, _get_service_status, _get_status_error_messages
Expand Down Expand Up @@ -153,6 +154,50 @@ def test_ls_accepts_job_type_and_displays_jobs():
assert "job" in result.output


@pytest.mark.parametrize("command,args", [("get", ["cserve", "123"]), ("ls", ["cserve"])])
def test_retired_cserve_type_is_rejected(command, args):
from centml.cli import cluster

with _patch_cluster_client() as client:
result = CliRunner().invoke(getattr(cluster, command), args)

assert result.exit_code == 2
assert "Invalid value for" in result.output
client.get.assert_not_called()
client.get_cserve.assert_not_called()


def test_ls_displays_dynamo_deployments():
from centml.cli.cluster import ls

with _patch_cluster_client() as client:
client.get.return_value = [_deployment(type=DeploymentType.DYNAMO, name="test-dynamo")]
result = CliRunner().invoke(ls)

assert result.exit_code == 0
assert "test-dynamo" in result.output
assert "dynamo" in result.output


@pytest.mark.parametrize(
"deployment_type", ["ccl_compute", "ccl_inference", "ccl_job", "ccl_dynamo", "future_type", "cserve_v3"]
)
def test_ls_hides_unsupported_deployment_types(deployment_type):
from centml.cli.cluster import ls

with _patch_cluster_client() as client:
client.get.return_value = [
_deployment(type=DeploymentType(deployment_type), name="hidden-deployment"),
_deployment(type=DeploymentType.DYNAMO, name="visible-dynamo"),
]
result = CliRunner().invoke(ls)

assert result.exit_code == 0
assert "hidden-deployment" not in result.output
assert deployment_type not in result.output
assert "visible-dynamo" in result.output


def test_get_job_routes_to_job_api_and_displays_job_config():
from centml.cli.cluster import get

Expand Down
Loading