Skip to content

Skip deployment validation for local deployment when endpoint is invoked #40811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,16 @@ 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)

with open(request_file, "rb") as f: # type: ignore[arg-type]
data = json.loads(f.read())
if local:
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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]
Expand Down
Loading