From e814822fd559eda59adb80e5d8859ba071ecc9ed Mon Sep 17 00:00:00 2001 From: Ruth Netser Date: Thu, 9 Jan 2025 14:39:28 +0200 Subject: [PATCH] Fix arg name calling `create_isvc` and add raw deployment external route url extraction (#90) * Create size-labeler.yml * Delete .github/workflows/size-labeler.yml * typo and url --- tests/model_serving/model_server/conftest.py | 2 +- utilities/inference_utils.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/model_serving/model_server/conftest.py b/tests/model_serving/model_server/conftest.py index 4d65869..7bcac77 100644 --- a/tests/model_serving/model_server/conftest.py +++ b/tests/model_serving/model_server/conftest.py @@ -118,7 +118,7 @@ def s3_models_inference_service( } if (external_route := request.param.get("external-route")) is not None: - isvc_kwargs["enable_auth"] = external_route + isvc_kwargs["external_route"] = external_route if (enable_auth := request.param.get("enable-auth")) is not None: isvc_kwargs["enable_auth"] = enable_auth diff --git a/utilities/inference_utils.py b/utilities/inference_utils.py index dde045f..2ba08b9 100644 --- a/utilities/inference_utils.py +++ b/utilities/inference_utils.py @@ -46,8 +46,16 @@ def __init__(self, inference_service: InferenceService, runtime: str): def get_inference_url(self) -> str: # TODO: add ModelMesh support if self.visibility_exposed: - if url := self.inference_service.instance.status.components.predictor.url: + if self.deployment_mode == KServeDeploymentType.SERVERLESS and ( + url := self.inference_service.instance.status.components.predictor.url + ): return urlparse(url).netloc + + elif self.deployment_mode == KServeDeploymentType.RAW_DEPLOYMENT and ( + url := self.inference_service.instance.status.url + ): + return urlparse(url).netloc + else: raise ValueError(f"{self.inference_service.name}: No url found in InferenceService status")