From 24a58084baa709b35cbcedf3da6f82c8856d88e4 Mon Sep 17 00:00:00 2001 From: Prashant Dhote Date: Wed, 30 Apr 2025 14:00:13 +0530 Subject: [PATCH 1/3] Skip deployment validation for local deployment when endpoint is invoked --- .../azure/ai/ml/operations/_online_endpoint_operations.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py index 6dce4283258b..6d8b5cd44004 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py @@ -333,9 +333,7 @@ def invoke( :rtype: str """ params_override = params_override or [] - # Until this bug is resolved https://msdata.visualstudio.com/Vienna/_workitems/edit/1446538 - if deployment_name: - self._validate_deployment_name(endpoint_name, deployment_name) + import pdb; pdb.set_trace() with open(request_file, "rb") as f: # type: ignore[arg-type] data = json.loads(f.read()) @@ -343,6 +341,9 @@ def invoke( return self._local_endpoint_helper.invoke( endpoint_name=endpoint_name, data=data, deployment_name=deployment_name ) + # Until this bug is resolved https://msdata.visualstudio.com/Vienna/_workitems/edit/1446538 + if deployment_name: + self._validate_deployment_name(endpoint_name, deployment_name) endpoint = self._online_operation.get( resource_group_name=self._resource_group_name, workspace_name=self._workspace_name, From 26da064e64c9ee9df726f52bf317186851cd9b3d Mon Sep 17 00:00:00 2001 From: Prashant Dhote Date: Mon, 5 May 2025 15:04:19 +0530 Subject: [PATCH 2/3] remove debug --- .../azure/ai/ml/operations/_online_endpoint_operations.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py index 6d8b5cd44004..37c098c0a0c6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py @@ -333,7 +333,6 @@ def invoke( :rtype: str """ params_override = params_override or [] - import pdb; pdb.set_trace() with open(request_file, "rb") as f: # type: ignore[arg-type] data = json.loads(f.read()) From d3c7354f756f907a1ff4c150c07d7e11f234f228 Mon Sep 17 00:00:00 2001 From: Prashant Dhote Date: Wed, 7 May 2025 15:14:07 +0530 Subject: [PATCH 3/3] unskip test_local_endpoint_mir_e2e test --- .../e2etests/test_local_endpoint.py | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/sdk/ml/azure-ai-ml/tests/local_endpoint/e2etests/test_local_endpoint.py b/sdk/ml/azure-ai-ml/tests/local_endpoint/e2etests/test_local_endpoint.py index 10f672287bc6..bb354606bc0d 100644 --- a/sdk/ml/azure-ai-ml/tests/local_endpoint/e2etests/test_local_endpoint.py +++ b/sdk/ml/azure-ai-ml/tests/local_endpoint/e2etests/test_local_endpoint.py @@ -24,12 +24,12 @@ def endpoint_mir_yaml() -> str: @pytest.fixture def deployment_create_yaml() -> str: - return "./tests/test_configs/deployments/online/online_deployment_2.yaml" + return "./tests/test_configs/deployments/online/online_deployment_1.yaml" @pytest.fixture def deployment_update_file() -> str: - return "./tests/test_configs/deployments/online/online_deployment_2.yaml" + return "./tests/test_configs/deployments/online/online_deployment_1.yaml" @pytest.fixture @@ -44,10 +44,6 @@ def request_file() -> str: @pytest.mark.e2etest @pytest.mark.local_endpoint_local_assets -@pytest.mark.skipif( - platform.python_implementation() == "PyPy" or sys.platform.startswith("darwin"), - reason="Skipping for PyPy and macOS as docker installation is not supported and skipped in dev_requirement.txt", -) def test_local_endpoint_mir_e2e( endpoint_mir_yaml: str, mir_endpoint_name: str, @@ -73,7 +69,6 @@ def test_local_endpoint_mir_e2e( @pytest.mark.e2etest @pytest.mark.local_endpoint_local_assets -@pytest.mark.skip() def test_local_deployment_mir_e2e( deployment_create_yaml: str, deployment_update_file: str, @@ -288,20 +283,20 @@ def run_local_endpoint_tests_e2e_create( deployment.name = deployment_name client.online_deployments.begin_create_or_update(deployment=deployment, no_wait=False, local=True) - get_obj = client.online_deployments.get(endpoint_name=endpoint_name, name=deployment_name, local=True) - assert get_obj.name == deployment_name - assert get_obj.endpoint_name == endpoint_name + get_deployment = client.online_deployments.get(endpoint_name=endpoint_name, name=deployment_name, local=True) + assert get_deployment.name == deployment_name + assert get_deployment.endpoint_name == endpoint_name - get_obj = client.online_endpoints.get(name=endpoint_name, local=True) - assert get_obj.name == endpoint_name - assert get_obj.scoring_uri is not None - assert get_obj.scoring_uri != "" + get_endpoint = client.online_endpoints.get(name=endpoint_name, local=True) + assert get_endpoint.name == endpoint_name + assert get_endpoint.scoring_uri is not None + assert get_endpoint.scoring_uri != "" data = client.online_endpoints.invoke(endpoint_name=endpoint_name, request_file=request_file, local=True) assert type(data) is str if is_sklearn: - assert "5215" in data - assert "3726" in data + assert "11055" in data + assert "4503" in data logs = client.online_deployments.get_logs( endpoint_name=endpoint_name, name=deployment_name, lines=10, local=True @@ -320,7 +315,7 @@ def run_local_endpoint_tests_e2e_create( deployment.name = deployment_name client.online_deployments.begin_create_or_update(deployment=deployment, no_wait=False, local=True) - client.online_deployments.delete(name=deployment_name, endpoint_name=endpoint_name, local=True) + client.online_deployments.begin_delete(name=deployment_name, endpoint_name=endpoint_name, local=True) deployments = client.online_deployments.list(endpoint_name=endpoint_name, local=True) assert deployments is not None assert endpoint_name not in [dep.endpoint_name for dep in deployments]