Skip to content

fix: combo fix for internal components I #26718

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

1 change: 1 addition & 0 deletions sdk/ml/azure-ai-ml/azure/ai/ml/_internal/_schema/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ScopeSchema(InternalBaseNodeSchema):
class HDInsightSchema(InternalBaseNodeSchema):
type = StringTransformedEnum(allowed_values=[NodeType.HDI], casing_transform=lambda x: x)

compute_name = fields.Str()
queue = fields.Str()
driver_memory = fields.Str()
driver_cores = fields.Int()
Expand Down
11 changes: 11 additions & 0 deletions sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def __init__(self, **kwargs):
kwargs.pop("type", None)
super(HDInsight, self).__init__(type=NodeType.HDI, **kwargs)
self._init = True
self._compute_name: str = kwargs.pop("compute_name", None)
self._queue: str = kwargs.pop("queue", None)
self._driver_memory: str = kwargs.pop("driver_memory", None)
self._driver_cores: int = kwargs.pop("driver_cores", None)
Expand All @@ -186,6 +187,15 @@ def __init__(self, **kwargs):
self._hdinsight_spark_job_name: str = kwargs.pop("hdinsight_spark_job_name", None)
self._init = False

@property
def compute_name(self) -> str:
"""Name of the compute to be used."""
return self._compute_name

@compute_name.setter
def compute_name(self, value: str):
self._compute_name = value

@property
def queue(self) -> str:
"""The name of the YARN queue to which submitted."""
Expand Down Expand Up @@ -267,6 +277,7 @@ def hdinsight_spark_job_name(self, value: str):
@classmethod
def _picked_fields_from_dict_to_rest_object(cls) -> List[str]:
return [
"compute_name",
"queue",
"driver_cores",
"executor_memory",
Expand Down
1 change: 1 addition & 0 deletions sdk/ml/azure-ai-ml/tests/internal/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"input_path": Input(type=AssetTypes.MLTABLE, path="mltable_imdb_reviews_train@latest"),
},
{
"compute_name": "cpu-cluster", # runsettings.hdinsight.compute_name
"queue": "default", # runsettings.hdinsight.queue
"driver_memory": "1g", # runsettings.hdinsight.driver_memory
"driver_cores": 2, # runsettings.hdinsight.driver_cores
Expand Down