Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
b362382
Create size-labeler.yml
rnetser Dec 18, 2024
3c6a875
Delete .github/workflows/size-labeler.yml
rnetser Dec 18, 2024
ccb63af
Merge branch 'main' of github.com:rnetser/opendatahub-tests
rnetser Dec 24, 2024
da0c898
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 25, 2024
94a82ec
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 26, 2024
c0c82dd
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 27, 2024
5feb447
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 30, 2024
19b9c56
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 31, 2024
e22ac1a
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 31, 2024
56ab9c5
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 31, 2024
5a17f03
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 31, 2024
ef5fe65
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Dec 31, 2024
1875a44
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 1, 2025
840d442
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 2, 2025
c0d4436
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 2, 2025
ba7971a
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 3, 2025
fd73a94
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 7, 2025
bde0493
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 8, 2025
d3cd799
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 9, 2025
710befa
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 12, 2025
a662364
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 16, 2025
579c283
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 16, 2025
927cbb0
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 19, 2025
99e242e
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 22, 2025
5b83bab
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 24, 2025
4b5b007
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 27, 2025
b8e5dee
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 30, 2025
0039df0
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Jan 30, 2025
17938d6
model mesh - add auth tests
rnetser Feb 2, 2025
44a3120
xx
rnetser Feb 2, 2025
a418727
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 3, 2025
d291c32
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 4, 2025
b6650d8
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 5, 2025
8b9f838
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 7, 2025
d53a04c
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 10, 2025
db89111
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 10, 2025
773d81a
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 12, 2025
01be6e9
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 13, 2025
71df8d5
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 16, 2025
8896bd7
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 18, 2025
0eeb162
Merge branch 'main' of https://github.com/opendatahub-io/opendatahub-…
rnetser Feb 18, 2025
38e8a69
ci: on main upstream xxxxxxxxxxx
rnetser Feb 19, 2025
875f597
ci: reabsingxxxxxxxxxxxxxx
rnetser Feb 20, 2025
c90abf6
ci: reabsingxxxxxxxxxxxxxx
rnetser Feb 20, 2025
4a26346
ci: Merge branch 'main' of https://github.com/opendatahub-io/opendata…
rnetser Feb 24, 2025
8302ed1
ci: Merge branch 'main' of https://github.com/opendatahub-io/opendata…
rnetser Feb 25, 2025
ff1b155
ci: rebase on main
rnetser Mar 6, 2025
a04a3c4
ci: merge main branch
rnetser Mar 11, 2025
d1cb99b
ci: merge branch main
rnetser Mar 12, 2025
87faa7b
ci: merge branch main
rnetser Mar 17, 2025
dc8490d
ci: merge branch main
rnetser Mar 17, 2025
5856788
ci: merge main branch
rnetser Mar 18, 2025
a865aa8
ci: merge main branch
rnetser Mar 18, 2025
e8be67d
ci: merge main branch
rnetser Mar 18, 2025
e8c8b38
ci: merge main branch
rnetser Mar 20, 2025
667cb70
ci: merge main branch
rnetser Mar 20, 2025
a122d95
ci: merge main branch
rnetser Mar 20, 2025
defca5d
ci: merge main branch
rnetser Mar 21, 2025
d8879ae
ci: merge with main
rnetser Mar 24, 2025
a0477ca
ci: merge with main
rnetser Mar 24, 2025
0b37eb7
ci: merge with main
rnetser Mar 24, 2025
79b9288
ci: merge with main
rnetser Mar 24, 2025
3b9d6a1
ci: merge with main
rnetser Mar 25, 2025
a91c002
ci: merge with main
rnetser Mar 26, 2025
ba7a2a4
ci: merge main branch
rnetser Mar 27, 2025
7fd9c92
ci: merge main branch
rnetser Mar 27, 2025
96c2146
ci: merge main branch
rnetser Mar 31, 2025
dcdfc7a
ci: merge main branch
rnetser Mar 31, 2025
beaa1e5
ci: merge main branch
rnetser Apr 2, 2025
3c35249
ci: merge main branch
rnetser Apr 6, 2025
d40269a
ci: merge main branch
rnetser Apr 7, 2025
1abe771
ci: merge main branch
rnetser Apr 8, 2025
25786e7
ci: merge main branch
rnetser Apr 9, 2025
4a66e91
fix: server metrics delete pvc
rnetser Apr 9, 2025
b715e3f
fix: split to tests
rnetser Apr 9, 2025
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
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ markers =
rawdeployment: Mark tests which are raw deployment tests
minio: Mark tests which are using MinIO storage
tls: Mark tests which are testing TLS
metrics: Mark tests which are testing metrics

addopts =
-s
Expand Down
89 changes: 0 additions & 89 deletions tests/model_serving/model_server/authentication/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
from utilities.infra import (
create_isvc_view_role,
get_pods_by_isvc_label,
s3_endpoint_secret,
create_inference_token,
)
from utilities.constants import (
KServeDeploymentType,
ModelFormat,
ModelStoragePath,
Protocols,
ModelInferenceRuntime,
RuntimeTemplates,
Expand Down Expand Up @@ -327,72 +325,6 @@ def http_s3_caikit_raw_inference_service_2(
yield isvc


# Unprivileged user tests


@pytest.fixture(scope="class")
def unprivileged_s3_caikit_serving_runtime(
admin_client: DynamicClient,
unprivileged_client: DynamicClient,
unprivileged_model_namespace: Namespace,
) -> Generator[ServingRuntime, Any, Any]:
with ServingRuntimeFromTemplate(
client=admin_client,
unprivileged_client=unprivileged_client,
name=f"{Protocols.HTTP}-{ModelInferenceRuntime.CAIKIT_TGIS_RUNTIME}",
namespace=unprivileged_model_namespace.name,
template_name=RuntimeTemplates.CAIKIT_TGIS_SERVING,
multi_model=False,
enable_http=True,
enable_grpc=False,
) as model_runtime:
yield model_runtime


@pytest.fixture(scope="class")
def unprivileged_models_endpoint_s3_secret(
unprivileged_client: DynamicClient,
unprivileged_model_namespace: Namespace,
aws_access_key_id: str,
aws_secret_access_key: str,
models_s3_bucket_name: str,
models_s3_bucket_region: str,
models_s3_bucket_endpoint: str,
) -> Generator[Secret, Any, Any]:
with s3_endpoint_secret(
admin_client=unprivileged_client,
name="models-bucket-secret",
namespace=unprivileged_model_namespace.name,
aws_access_key=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
aws_s3_region=models_s3_bucket_region,
aws_s3_bucket=models_s3_bucket_name,
aws_s3_endpoint=models_s3_bucket_endpoint,
) as secret:
yield secret


@pytest.fixture(scope="class")
def unprivileged_s3_caikit_serverless_inference_service(
request: FixtureRequest,
unprivileged_client: DynamicClient,
unprivileged_model_namespace: Namespace,
unprivileged_s3_caikit_serving_runtime: ServingRuntime,
unprivileged_models_endpoint_s3_secret: Secret,
) -> Generator[InferenceService, Any, Any]:
with create_isvc(
client=unprivileged_client,
name=f"{Protocols.HTTP}-{ModelFormat.CAIKIT}",
namespace=unprivileged_model_namespace.name,
runtime=unprivileged_s3_caikit_serving_runtime.name,
model_format=unprivileged_s3_caikit_serving_runtime.instance.spec.supportedModelFormats[0].name,
deployment_mode=KServeDeploymentType.SERVERLESS,
storage_key=unprivileged_models_endpoint_s3_secret.name,
storage_path=request.param["model-dir"],
) as isvc:
yield isvc


@pytest.fixture(scope="class")
def http_s3_caikit_tgis_serving_runtime(
request: FixtureRequest,
Expand All @@ -411,27 +343,6 @@ def http_s3_caikit_tgis_serving_runtime(
yield model_runtime


@pytest.fixture(scope="class")
def unprivileged_s3_caikit_raw_inference_service(
request: FixtureRequest,
unprivileged_client: DynamicClient,
unprivileged_model_namespace: Namespace,
unprivileged_s3_caikit_serving_runtime: ServingRuntime,
unprivileged_models_endpoint_s3_secret: Secret,
) -> Generator[InferenceService, Any, Any]:
with create_isvc(
client=unprivileged_client,
name=f"{Protocols.HTTP}-{ModelFormat.CAIKIT}-raw",
namespace=unprivileged_model_namespace.name,
runtime=unprivileged_s3_caikit_serving_runtime.name,
model_format=unprivileged_s3_caikit_serving_runtime.instance.spec.supportedModelFormats[0].name,
deployment_mode=KServeDeploymentType.RAW_DEPLOYMENT,
storage_key=unprivileged_models_endpoint_s3_secret.name,
storage_path=ModelStoragePath.FLAN_T5_SMALL_CAIKIT,
) as isvc:
yield isvc


@pytest.fixture()
def patched_remove_authentication_model_mesh_runtime(
admin_client: DynamicClient,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import pytest

from tests.model_serving.model_server.utils import (
run_inference_multiple_times,
verify_inference_response,
)
from utilities.constants import ModelFormat, ModelStoragePath, Protocols
from utilities.inference_utils import Inference
from utilities.manifests.caikit_tgis import CAIKIT_TGIS_INFERENCE_CONFIG
from utilities.monitoring import validate_metrics_value


@pytest.mark.parametrize(
Expand Down Expand Up @@ -63,26 +61,3 @@ def test_non_admin_deploy_raw_and_query_model(
model_name=ModelFormat.CAIKIT,
use_default_query=True,
)

def test_raw_metrics(
self,
unprivileged_s3_caikit_raw_inference_service,
prometheus,
user_workload_monitoring_config_map,
):
"""Verify number of total model requests in OpenShift monitoring system (UserWorkloadMonitoring) metrics"""
total_runs = 5

run_inference_multiple_times(
isvc=unprivileged_s3_caikit_raw_inference_service,
inference_config=CAIKIT_TGIS_INFERENCE_CONFIG,
inference_type=Inference.ALL_TOKENS,
protocol=Protocols.HTTP,
model_name=ModelFormat.CAIKIT,
iterations=total_runs,
)
validate_metrics_value(
prometheus=prometheus,
metrics_query="tgi_request_count",
expected_value=str(total_runs + 1),
)
95 changes: 93 additions & 2 deletions tests/model_serving/model_server/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
from ocp_utilities.monitoring import Prometheus
from pytest_testconfig import config as py_config

from utilities.constants import StorageClassName
from utilities.constants import (
KServeDeploymentType,
ModelFormat,
ModelInferenceRuntime,
ModelStoragePath,
Protocols,
RuntimeTemplates,
StorageClassName,
)
from utilities.constants import (
ModelAndFormat,
Expand Down Expand Up @@ -444,6 +445,8 @@ def prometheus(admin_client: DynamicClient) -> Prometheus:
def user_workload_monitoring_config_map(
admin_client: DynamicClient, cluster_monitoring_config: ConfigMap
) -> Generator[ConfigMap, None, None]:
uwm_namespace = "openshift-user-workload-monitoring"

data = {
"config.yaml": yaml.dump({
"prometheus": {
Expand All @@ -457,11 +460,15 @@ def user_workload_monitoring_config_map(
with update_configmap_data(
client=admin_client,
name="user-workload-monitoring-config",
namespace="openshift-user-workload-monitoring",
namespace=uwm_namespace,
data=data,
) as cm:
yield cm

# UWM PVCs are not deleted once the configmap is deleted; forcefully deleting the PVCs to avoid having left-overs
for pvc in PersistentVolumeClaim.get(dyn_client=admin_client, namespace=uwm_namespace):
pvc.clean_up()


@pytest.fixture(scope="class")
def http_s3_ovms_external_route_model_mesh_serving_runtime(
Expand Down Expand Up @@ -515,3 +522,87 @@ def http_s3_openvino_second_model_mesh_inference_service(
model_version=request.param["model-version"],
) as isvc:
yield isvc


@pytest.fixture(scope="class")
def unprivileged_s3_caikit_raw_inference_service(
request: FixtureRequest,
unprivileged_client: DynamicClient,
unprivileged_model_namespace: Namespace,
unprivileged_s3_caikit_serving_runtime: ServingRuntime,
unprivileged_models_endpoint_s3_secret: Secret,
) -> Generator[InferenceService, Any, Any]:
with create_isvc(
client=unprivileged_client,
name=f"{Protocols.HTTP}-{ModelFormat.CAIKIT}-raw",
namespace=unprivileged_model_namespace.name,
runtime=unprivileged_s3_caikit_serving_runtime.name,
model_format=unprivileged_s3_caikit_serving_runtime.instance.spec.supportedModelFormats[0].name,
deployment_mode=KServeDeploymentType.RAW_DEPLOYMENT,
storage_key=unprivileged_models_endpoint_s3_secret.name,
storage_path=ModelStoragePath.FLAN_T5_SMALL_CAIKIT,
) as isvc:
yield isvc


@pytest.fixture(scope="class")
def unprivileged_s3_caikit_serving_runtime(
admin_client: DynamicClient,
unprivileged_client: DynamicClient,
unprivileged_model_namespace: Namespace,
) -> Generator[ServingRuntime, Any, Any]:
with ServingRuntimeFromTemplate(
client=admin_client,
unprivileged_client=unprivileged_client,
name=f"{Protocols.HTTP}-{ModelInferenceRuntime.CAIKIT_TGIS_RUNTIME}",
namespace=unprivileged_model_namespace.name,
template_name=RuntimeTemplates.CAIKIT_TGIS_SERVING,
multi_model=False,
enable_http=True,
enable_grpc=False,
) as model_runtime:
yield model_runtime


@pytest.fixture(scope="class")
def unprivileged_models_endpoint_s3_secret(
unprivileged_client: DynamicClient,
unprivileged_model_namespace: Namespace,
aws_access_key_id: str,
aws_secret_access_key: str,
models_s3_bucket_name: str,
models_s3_bucket_region: str,
models_s3_bucket_endpoint: str,
) -> Generator[Secret, Any, Any]:
with s3_endpoint_secret(
admin_client=unprivileged_client,
name="models-bucket-secret",
namespace=unprivileged_model_namespace.name,
aws_access_key=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
aws_s3_region=models_s3_bucket_region,
aws_s3_bucket=models_s3_bucket_name,
aws_s3_endpoint=models_s3_bucket_endpoint,
) as secret:
yield secret


@pytest.fixture(scope="class")
def unprivileged_s3_caikit_serverless_inference_service(
request: FixtureRequest,
unprivileged_client: DynamicClient,
unprivileged_model_namespace: Namespace,
unprivileged_s3_caikit_serving_runtime: ServingRuntime,
unprivileged_models_endpoint_s3_secret: Secret,
) -> Generator[InferenceService, Any, Any]:
with create_isvc(
client=unprivileged_client,
name=f"{Protocols.HTTP}-{ModelFormat.CAIKIT}",
namespace=unprivileged_model_namespace.name,
runtime=unprivileged_s3_caikit_serving_runtime.name,
model_format=unprivileged_s3_caikit_serving_runtime.instance.spec.supportedModelFormats[0].name,
deployment_mode=KServeDeploymentType.SERVERLESS,
storage_key=unprivileged_models_endpoint_s3_secret.name,
storage_path=request.param["model-dir"],
) as isvc:
yield isvc
18 changes: 0 additions & 18 deletions tests/model_serving/model_server/metrics/conftest.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
pytestmark = [
pytest.mark.serverless,
pytest.mark.usefixtures("valid_aws_config", "user_workload_monitoring_config_map"),
pytest.mark.metrics,
]


Expand Down Expand Up @@ -46,8 +47,7 @@
class TestModelMetrics:
@pytest.mark.smoke
@pytest.mark.polarion("ODS-2555")
@pytest.mark.dependency(name="test_model_metrics_num_success_requests")
def test_model_metrics_num_success_requests(self, s3_models_inference_service, deleted_metrics, prometheus):
def test_model_metrics_num_success_requests(self, s3_models_inference_service, prometheus):
"""Verify number of successful model requests in OpenShift monitoring system (UserWorkloadMonitoring) metrics"""
verify_inference_response(
inference_service=s3_models_inference_service,
Expand All @@ -65,10 +65,6 @@ def test_model_metrics_num_success_requests(self, s3_models_inference_service, d

@pytest.mark.smoke
@pytest.mark.polarion("ODS-2555")
@pytest.mark.dependency(
name="test_model_metrics_num_total_requests",
depends=["test_model_metrics_num_success_requests"],
)
def test_model_metrics_num_total_requests(self, s3_models_inference_service, prometheus):
"""Verify number of total model requests in OpenShift monitoring system (UserWorkloadMonitoring) metrics"""
total_runs = 5
Expand All @@ -90,7 +86,6 @@ def test_model_metrics_num_total_requests(self, s3_models_inference_service, pro

@pytest.mark.smoke
@pytest.mark.polarion("ODS-2555")
@pytest.mark.dependency(depends=["test_model_metrics_num_total_requests"])
def test_model_metrics_cpu_utilization(self, s3_models_inference_service, prometheus):
"""Verify CPU utilization data in OpenShift monitoring system (UserWorkloadMonitoring) metrics"""
assert get_metrics_value(
Expand Down
Loading