Skip to content

Commit

Permalink
[Batch component deployment]Assign default_compute value (Azure#27865)
Browse files Browse the repository at this point in the history
  • Loading branch information
nancy-mejia authored Dec 9, 2022
1 parent c1a1f94 commit f5644b3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from azure.ai.ml._utils.utils import is_private_preview_enabled, camel_to_snake
from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY
from azure.ai.ml.constants._deployment import BatchDeploymentOutputAction
from azure.ai.ml.constants._job.pipeline import PipelineConstants
from azure.ai.ml.entities._assets import Environment, Model
from azure.ai.ml.entities._deployment.deployment_settings import BatchRetrySettings
from azure.ai.ml.entities._job.resource_configuration import ResourceConfiguration
Expand Down Expand Up @@ -218,6 +219,9 @@ def _to_rest_object(self, location: str) -> BatchDeploymentData: # pylint: disa
)

if is_private_preview_enabled() and self.job_definition:
if not self.job_definition.settings:
self.job_definition.settings = {}
self.job_definition.settings[PipelineConstants.DEFAULT_COMPUTE] = self.compute
non_flat_data = {}
non_flat_data["ComponentDeployment"] = self.job_definition._to_dict()
flat_data = flatten(non_flat_data, ".")
Expand Down

0 comments on commit f5644b3

Please sign in to comment.