Skip to content
Merged
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 @@ -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
Expand Down Expand Up @@ -58,5 +57,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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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