|
9 | 9 | from pathlib import Path
|
10 | 10 | from typing import Any, Dict, Optional, Union
|
11 | 11 |
|
12 |
| -from azure.ai.ml._restclient.v2022_05_01.models import BatchDeploymentData |
13 |
| -from azure.ai.ml._restclient.v2022_05_01.models import BatchDeploymentDetails as RestBatchDeployment |
14 |
| -from azure.ai.ml._restclient.v2022_05_01.models import BatchOutputAction |
15 |
| -from azure.ai.ml._restclient.v2022_05_01.models import CodeConfiguration as RestCodeConfiguration |
16 |
| -from azure.ai.ml._restclient.v2022_05_01.models import IdAssetReference |
| 12 | +from azure.ai.ml._restclient.v2024_01_01_preview.models import BatchDeployment as BatchDeploymentData |
| 13 | +from azure.ai.ml._restclient.v2024_01_01_preview.models import BatchDeploymentProperties as RestBatchDeployment |
| 14 | +from azure.ai.ml._restclient.v2024_01_01_preview.models import BatchOutputAction |
| 15 | +from azure.ai.ml._restclient.v2024_01_01_preview.models import CodeConfiguration as RestCodeConfiguration |
| 16 | +from azure.ai.ml._restclient.v2024_01_01_preview.models import IdAssetReference |
17 | 17 | from azure.ai.ml._schema._deployment.batch.batch_deployment import BatchDeploymentSchema
|
18 | 18 | from azure.ai.ml._utils._arm_id_utils import _parse_endpoint_name_from_deployment_id
|
19 | 19 | from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY
|
@@ -253,6 +253,24 @@ def _from_rest_object( # pylint: disable=arguments-renamed
|
253 | 253 | cls, deployment: BatchDeploymentData
|
254 | 254 | ) -> BatchDeploymentData:
|
255 | 255 | modelId = deployment.properties.model.asset_id if deployment.properties.model else None
|
| 256 | + |
| 257 | + if hasattr(deployment.properties, "deployment_configuration"): |
| 258 | + settings = deployment.properties.deployment_configuration.settings |
| 259 | + deployment_comp_settings = { |
| 260 | + "deployment_configuration_type": deployment.properties.deployment_configuration.deployment_configuration_type, # pylint: disable=line-too-long |
| 261 | + "componentDeployment.Settings.continue_on_step_failure": settings.get( |
| 262 | + "ComponentDeployment.Settings.continue_on_step_failure", None |
| 263 | + ), |
| 264 | + "default_datastore": settings.get("default_datastore", None), |
| 265 | + "default_compute": settings.get("default_compute", None), |
| 266 | + } |
| 267 | + properties = {} |
| 268 | + if deployment.properties.properties: |
| 269 | + properties.update(deployment.properties.properties) |
| 270 | + properties.update(deployment_comp_settings) |
| 271 | + else: |
| 272 | + properties = deployment.properties.properties |
| 273 | + |
256 | 274 | code_configuration = (
|
257 | 275 | CodeConfiguration._from_rest_code_configuration(deployment.properties.code_configuration)
|
258 | 276 | if deployment.properties.code_configuration
|
@@ -280,7 +298,7 @@ def _from_rest_object( # pylint: disable=arguments-renamed
|
280 | 298 | environment_variables=deployment.properties.environment_variables,
|
281 | 299 | max_concurrency_per_instance=deployment.properties.max_concurrency_per_instance,
|
282 | 300 | endpoint_name=_parse_endpoint_name_from_deployment_id(deployment.id),
|
283 |
| - properties=deployment.properties.properties, |
| 301 | + properties=properties, |
284 | 302 | creation_context=SystemData._from_rest_object(deployment.system_data),
|
285 | 303 | provisioning_state=deployment.properties.provisioning_state,
|
286 | 304 | )
|
|
0 commit comments