Skip to content

Commit 4a5b1c9

Browse files
authored
Merge branch 'main' into trustyai-upgrade
2 parents 2c9f9f2 + 015c19b commit 4a5b1c9

File tree

11 files changed

+107
-12
lines changed

11 files changed

+107
-12
lines changed

.github/workflows/add-remove-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- uses: actions/checkout@v4
3838

3939
- name: Install uv
40-
uses: astral-sh/setup-uv@v5
40+
uses: astral-sh/setup-uv@v6
4141

4242
- name: Run add remove labels
4343
env:

.github/workflows/add-welcome-comment-set-assignee.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616

1717
- name: Install uv
18-
uses: astral-sh/setup-uv@v5
18+
uses: astral-sh/setup-uv@v6
1919

2020
- name: Run add welcome comment
2121
env:

.github/workflows/on-review-add-label.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- uses: actions/checkout@v4
8181

8282
- name: Install uv
83-
uses: astral-sh/setup-uv@v5
83+
uses: astral-sh/setup-uv@v6
8484
- name: 'Run add-remove-labels action'
8585
env:
8686
GITHUB_TOKEN: ${{ secrets.OPENDATAHUB_TESTS_BOT_PAT }}

.github/workflows/size-labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616

1717
- name: Install uv
18-
uses: astral-sh/setup-uv@v5
18+
uses: astral-sh/setup-uv@v6
1919

2020
- name: Run size labeler
2121
env:

.github/workflows/tox-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313

1414
- name: Install uv
15-
uses: astral-sh/setup-uv@v5
15+
uses: astral-sh/setup-uv@v6
1616

1717
- name: Install tox-uv
1818
run: |

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ dependencies = [
6666
"openshift-python-wrapper>=11.0.38",
6767
"semver>=3.0.4",
6868
"pytest-order>=1.3.0",
69-
"marshmallow==3.26.1", # this version is needed for pytest-jira
69+
"marshmallow==3.26.1,<4", # this version is needed for pytest-jira
7070
]
7171

7272
[project.urls]

tests/model_serving/model_server/authentication/test_model_mesh_authentication.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
class TestModelMeshAuthentication:
2626
"""Model Mesh Authentication is based on the created Service; cross-model authentication is not blocked"""
2727

28-
@pytest.mark.ocp_interop
2928
@pytest.mark.dependency(name="test_model_mesh_model_authentication_openvino_inference_with_tensorflow")
3029
def test_model_mesh_model_authentication_openvino_inference_with_tensorflow(
3130
self,

tests/model_serving/model_server/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,18 @@ def ovms_kserve_inference_service(
368368
if env_vars := request.param.get("env-vars"):
369369
isvc_kwargs["model_env_variables"] = env_vars
370370

371-
if min_replicas := request.param.get("min-replicas"):
371+
if (min_replicas := request.param.get("min-replicas")) is not None:
372372
isvc_kwargs["min_replicas"] = min_replicas
373+
if min_replicas == 0:
374+
isvc_kwargs["wait_for_predictor_pods"] = False
373375

374376
if max_replicas := request.param.get("max-replicas"):
375377
isvc_kwargs["max_replicas"] = max_replicas
376378

377379
if scale_metric := request.param.get("scale-metric"):
378380
isvc_kwargs["scale_metric"] = scale_metric
379381

380-
if scale_target := request.param.get("scale-target"):
382+
if (scale_target := request.param.get("scale-target")) is not None:
381383
isvc_kwargs["scale_target"] = scale_target
382384

383385
with create_isvc(**isvc_kwargs) as isvc:

tests/model_serving/model_server/model_mesh/test_model_mesh_multi_models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
from utilities.inference_utils import Inference
1111
from utilities.manifests.openvino import OPENVINO_INFERENCE_CONFIG
1212

13-
pytestmark = [pytest.mark.modelmesh, pytest.mark.sanity]
13+
pytestmark = [pytest.mark.modelmesh, pytest.mark.sanity, pytest.mark.ocp_interop]
1414

1515

1616
@pytest.mark.parametrize(
17-
"model_namespace, http_s3_openvino_model_mesh_inference_service, "
17+
"model_namespace, http_s3_ovms_model_mesh_serving_runtime, http_s3_openvino_model_mesh_inference_service, "
1818
"http_s3_openvino_second_model_mesh_inference_service",
1919
[
2020
pytest.param(
2121
{"name": "model-mesh-multi-model", "modelmesh-enabled": True},
22+
{"enable_external_route": True},
2223
{"model-path": ModelStoragePath.OPENVINO_EXAMPLE_MODEL},
2324
{
2425
"model-path": ModelStoragePath.OPENVINO_VEHICLE_DETECTION,
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import pytest
2+
from ocp_resources.deployment import Deployment
3+
4+
from tests.model_serving.model_server.serverless.constants import (
5+
ONNX_SERVERLESS_INFERENCE_SERVICE_CONFIG,
6+
)
7+
from tests.model_serving.model_server.serverless.utils import verify_no_inference_pods
8+
from tests.model_serving.model_server.utils import verify_inference_response
9+
from utilities.constants import (
10+
Protocols,
11+
RunTimeConfigs,
12+
)
13+
from utilities.exceptions import DeploymentValidationError
14+
from utilities.general import create_isvc_label_selector_str
15+
from utilities.inference_utils import Inference
16+
from utilities.manifests.onnx import ONNX_INFERENCE_CONFIG
17+
18+
pytestmark = [
19+
pytest.mark.serverless,
20+
pytest.mark.sanity,
21+
pytest.mark.usefixtures("valid_aws_config"),
22+
]
23+
24+
25+
@pytest.mark.serverless
26+
@pytest.mark.parametrize(
27+
"model_namespace, ovms_kserve_serving_runtime, ovms_kserve_inference_service",
28+
[
29+
pytest.param(
30+
{"name": "serverless-initial-scale-zero"},
31+
RunTimeConfigs.ONNX_OPSET13_RUNTIME_CONFIG,
32+
{
33+
**ONNX_SERVERLESS_INFERENCE_SERVICE_CONFIG,
34+
"min-replicas": 0,
35+
},
36+
)
37+
],
38+
indirect=True,
39+
)
40+
class TestServerlessInitialScaleZero:
41+
@pytest.mark.dependency(name="test_no_serverless_pods_created_for_zero_initial_scale")
42+
def test_no_serverless_pods_created_for_zero_initial_scale(self, admin_client, ovms_kserve_inference_service):
43+
"""Verify no pods are created when inference service initial scale is zero, i.e. zero min-replicas requested."""
44+
verify_no_inference_pods(client=admin_client, isvc=ovms_kserve_inference_service)
45+
46+
@pytest.mark.dependency(name="test_no_serverless_replicas_created_for_zero_initial_scale")
47+
def test_no_serverless_replicas_created_for_zero_initial_scale(
48+
self, admin_client, ovms_kserve_inference_service, ovms_kserve_serving_runtime
49+
):
50+
"""Verify replica count is zero when inference service initial scale is zero"""
51+
labels = [
52+
"serving.knative.dev/configurationGeneration=1",
53+
create_isvc_label_selector_str(
54+
isvc=ovms_kserve_inference_service,
55+
resource_type="deployment",
56+
runtime_name=ovms_kserve_serving_runtime.name,
57+
),
58+
]
59+
60+
deployments = list(
61+
Deployment.get(
62+
label_selector=",".join(labels), client=admin_client, namespace=ovms_kserve_inference_service.namespace
63+
)
64+
)
65+
66+
if not deployments:
67+
raise DeploymentValidationError(
68+
f"Inference Service {ovms_kserve_inference_service.name} new deployment not found"
69+
)
70+
71+
if deployments[0].instance.spec.replicas == 0:
72+
deployments[0].wait_for_replicas(deployed=False)
73+
return
74+
75+
raise DeploymentValidationError(
76+
f"Inference Service {ovms_kserve_inference_service.name} deployment should have 0 replicas when created"
77+
)
78+
79+
@pytest.mark.dependency(
80+
depends=[
81+
"test_no_serverless_pods_created_for_zero_initial_scale",
82+
"test_no_serverless_replicas_created_for_zero_initial_scale",
83+
]
84+
)
85+
def test_serverless_inference_after_zero_initial_scale(self, ovms_kserve_inference_service):
86+
"""Verify model can be queried after being created with an initial scale of zero."""
87+
verify_inference_response(
88+
inference_service=ovms_kserve_inference_service,
89+
inference_config=ONNX_INFERENCE_CONFIG,
90+
inference_type=Inference.INFER,
91+
protocol=Protocols.HTTPS,
92+
use_default_query=True,
93+
)

0 commit comments

Comments
 (0)