From 7a58d3ad0b9a226cd4643bb845cb0b6b91884270 Mon Sep 17 00:00:00 2001 From: Banibrata De Date: Wed, 21 Sep 2022 17:32:55 +0000 Subject: [PATCH 1/2] remve batch validations --- .../_deployment/batch/batch_deployment.py | 1 - .../unittests/test_batch_deployment_schema.py | 17 +++++++++++++++ .../batch/batch_deployment_registry.yaml | 21 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 sdk/ml/azure-ai-ml/tests/test_configs/deployments/batch/batch_deployment_registry.yaml diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_deployment.py index 0658975a6237..8637683363b6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_deployment.py @@ -58,5 +58,4 @@ class BatchDeploymentSchema(DeploymentSchema): def make(self, data: Any, **kwargs: Any) -> Any: from azure.ai.ml.entities import BatchDeployment - exit_if_registry_assets(data=data, caller="BatchDeployment") return BatchDeployment(base_path=self.context[BASE_PATH_CONTEXT_KEY], **data) diff --git a/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_deployment_schema.py b/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_deployment_schema.py index b46d0dbb5f4f..ee1cff8c7d8b 100644 --- a/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_deployment_schema.py +++ b/sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_batch_deployment_schema.py @@ -34,3 +34,20 @@ def test_serialize_batch_deployment(self) -> None: assert batch_deployment_entity.mini_batch_size == 5 assert batch_deployment_entity.max_concurrency_per_instance == 5 assert batch_deployment_entity.resources.instance_count == 2 + + def test_registry_assets_batch_deployment(self) -> None: + test_path = "./tests/test_configs/deployments/batch/batch_deployment_registry.yaml" + batch_deployment_entity = load_batch_deployment_entity_from_yaml(test_path) + assert batch_deployment_entity + assert batch_deployment_entity.model == "azureml://registries/testFeed/models/model_version_e2e/versions/1" + assert ( + batch_deployment_entity.environment + == "azureml://registries/testfeed/environments/4c99f460-20cd-4821-8745-202aa7555604/versions/93435847-704b-4280-83f3-f735d8b5eff7" + ) + assert batch_deployment_entity.compute == "cpu-cluster" + assert batch_deployment_entity.output_action == BatchDeploymentOutputAction.APPEND_ROW + assert batch_deployment_entity.output_file_name == "append_row.txt" + assert batch_deployment_entity.error_threshold == 10 + assert batch_deployment_entity.mini_batch_size == 5 + assert batch_deployment_entity.max_concurrency_per_instance == 5 + assert batch_deployment_entity.resources.instance_count == 2 diff --git a/sdk/ml/azure-ai-ml/tests/test_configs/deployments/batch/batch_deployment_registry.yaml b/sdk/ml/azure-ai-ml/tests/test_configs/deployments/batch/batch_deployment_registry.yaml new file mode 100644 index 000000000000..3fc9e3ccf4f2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/tests/test_configs/deployments/batch/batch_deployment_registry.yaml @@ -0,0 +1,21 @@ +name: blue +endpoint_name: myBatchEndpoint +model: azureml://registries/testFeed/models/model_version_e2e/versions/1 +code_configuration: + code: ../endpoint_scoring + scoring_script: ./main.py +environment: azureml://registries/testfeed/environments/4c99f460-20cd-4821-8745-202aa7555604/versions/93435847-704b-4280-83f3-f735d8b5eff7 +retry_settings: #optional + max_retries: 3 + timeout: 30 +mini_batch_size: 5 +logging_level: info #optional, default is info +error_threshold: 10 #optional, default is -1 +output_action: append_row #optional, Allowed Values: append_row, summary_only +output_file_name: append_row.txt #optional +max_concurrency_per_instance: 5 +compute: "azureml:cpu-cluster" +resources: + instance_count: 2 +environment_variables: + AZUREML_BE: bla From 1d8e7ebe734f74b4836d16edfac9004c2e1ea032 Mon Sep 17 00:00:00 2001 From: Banibrata De Date: Thu, 22 Sep 2022 09:52:48 +0000 Subject: [PATCH 2/2] remove --- .../azure/ai/ml/_schema/_deployment/batch/batch_deployment.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_deployment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_deployment.py index 8637683363b6..41438bf53bc2 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_deployment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/batch_deployment.py @@ -10,7 +10,6 @@ from marshmallow import fields, post_load from azure.ai.ml._schema._deployment.deployment import DeploymentSchema -from azure.ai.ml._schema._utils.utils import exit_if_registry_assets from azure.ai.ml._schema.core.fields import ComputeField, NestedField, StringTransformedEnum from azure.ai.ml._schema.job_resource_configuration import JobResourceConfigurationSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY