Skip to content

Commit 9fe8c0e

Browse files
test: add REST and gRPC test suite for Seldon MLServer runtime (#328)
* test: add REST and gRPC test cases for Sklearn framework with MLServer runtime deployment Signed-off-by: Snomaan6846 <syedali@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test: add REST and gRPC test cases for XGBoost framework with MLServer runtime deployment Signed-off-by: Snomaan6846 <syedali@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test: add REST and gRPC test cases for LightGBM framework with MLServer runtime deployment Signed-off-by: Snomaan6846 <syedali@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test: add REST and gRPC test cases for CatBoost framework with MLServer runtime deployment Signed-off-by: Snomaan6846 <syedali@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test: add REST and gRPC test cases for MLFlow framework with MLServer runtime deployment Signed-off-by: Snomaan6846 <syedali@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * downgrade: Seldon MLServer from 1.7.1 to 1.6.1 due to HuggingFace runtime incompatibility Signed-off-by: Snomaan6846 <syedali@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * test: add REST and gRPC test cases for HuggingFace framework with MLServer runtime deployment Signed-off-by: Snomaan6846 <syedali@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test(mlserver): remove unnecessary sleep before inferencing Signed-off-by: Snomaan6846 <syedali@redhat.com> --------- Signed-off-by: Snomaan6846 <syedali@redhat.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 092df55 commit 9fe8c0e

File tree

37 files changed

+2655
-0
lines changed

37 files changed

+2655
-0
lines changed

conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ def pytest_addoption(parser: Parser) -> None:
106106
default=os.environ.get("VLLM_RUNTIME_IMAGE"),
107107
help="Specify the runtime image to use for the tests",
108108
)
109+
runtime_group.addoption(
110+
"--mlserver-runtime-image",
111+
default=os.environ.get("MLSERVER_RUNTIME_IMAGE"),
112+
help="Specify the runtime image to use for the tests",
113+
)
109114

110115
# Upgrade options
111116
upgrade_group.addoption(

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ def vllm_runtime_image(pytestconfig: pytest.Config) -> str | None:
221221
return runtime_image
222222

223223

224+
@pytest.fixture(scope="session")
225+
def mlserver_runtime_image(pytestconfig: pytest.Config) -> str | None:
226+
runtime_image = pytestconfig.option.mlserver_runtime_image
227+
if not runtime_image:
228+
return None
229+
return runtime_image
230+
231+
224232
@pytest.fixture(scope="session")
225233
def use_unprivileged_client(pytestconfig: pytest.Config) -> bool:
226234
_use_unprivileged_client = py_config.get("use_unprivileged_client")

tests/model_serving/model_runtime/mlserver/__init__.py

Whitespace-only changes.

tests/model_serving/model_runtime/mlserver/basic_model_deployment/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"modelName": "catboost",
3+
"modelVersion": "v0.1.0",
4+
"outputs": [
5+
{
6+
"contents": {
7+
"int64Contents": [
8+
"0"
9+
]
10+
},
11+
"datatype": "INT64",
12+
"name": "predict",
13+
"parameters": {
14+
"content_type": {
15+
"stringParam": "np"
16+
}
17+
},
18+
"shape": [
19+
"1",
20+
"1"
21+
]
22+
}
23+
]
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"id": "catboost",
3+
"model_name": "catboost",
4+
"model_version": "v0.1.0",
5+
"outputs": [
6+
{
7+
"data": [
8+
0
9+
],
10+
"datatype": "INT64",
11+
"name": "predict",
12+
"parameters": {
13+
"content_type": "np"
14+
},
15+
"shape": [
16+
1,
17+
1
18+
]
19+
}
20+
],
21+
"parameters": {}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"modelName": "catboost",
3+
"modelVersion": "v0.1.0",
4+
"outputs": [
5+
{
6+
"contents": {
7+
"int64Contents": [
8+
"0"
9+
]
10+
},
11+
"datatype": "INT64",
12+
"name": "predict",
13+
"parameters": {
14+
"content_type": {
15+
"stringParam": "np"
16+
}
17+
},
18+
"shape": [
19+
"1",
20+
"1"
21+
]
22+
}
23+
]
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"id": "catboost",
3+
"model_name": "catboost",
4+
"model_version": "v0.1.0",
5+
"outputs": [
6+
{
7+
"data": [
8+
0
9+
],
10+
"datatype": "INT64",
11+
"name": "predict",
12+
"parameters": {
13+
"content_type": "np"
14+
},
15+
"shape": [
16+
1,
17+
1
18+
]
19+
}
20+
],
21+
"parameters": {}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"modelName": "lightgbm-iris",
3+
"modelVersion": "v0.1.0",
4+
"outputs": [
5+
{
6+
"contents": {
7+
"fp64Contents": [
8+
1.5461848371087045e-05,
9+
0.00019280402569017216,
10+
0.9997917341259387
11+
]
12+
},
13+
"datatype": "FP64",
14+
"name": "predict",
15+
"parameters": {
16+
"content_type": {
17+
"stringParam": "np"
18+
}
19+
},
20+
"shape": [
21+
"1",
22+
"3"
23+
]
24+
}
25+
]
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"id": "lightgbm-iris",
3+
"model_name": "lightgbm-iris",
4+
"model_version": "v0.1.0",
5+
"outputs": [
6+
{
7+
"data": [
8+
1.5461848371087045e-05,
9+
0.00019280402569017216,
10+
0.9997917341259387
11+
],
12+
"datatype": "FP64",
13+
"name": "predict",
14+
"parameters": {
15+
"content_type": "np"
16+
},
17+
"shape": [
18+
1,
19+
3
20+
]
21+
}
22+
],
23+
"parameters": {}
24+
}

0 commit comments

Comments
 (0)