Skip to content

Commit f6fa3fe

Browse files
authored
[ML] Clean up for Custom Applications on Compute Instances (Azure#28621)
* Bug fix for no_public_ip * Updated compute unit test * Made CustomApplications models public * Updated Compute Instance constructor * Added missing SetupScripts class to __init__.py * Added experimental to Setup Scripts docstring
1 parent 69621e8 commit f6fa3fe

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
from ._compute._aml_compute_node_info import AmlComputeNodeInfo
2626
from ._compute._image_metadata import ImageMetadata
2727
from ._compute._schedule import ComputePowerAction, ComputeSchedules, ComputeStartStopSchedule, ScheduleState
28-
from ._compute._custom_applications import CustomApplications
28+
from ._compute._custom_applications import CustomApplications, ImageSettings, EndpointsSettings, VolumeSettings
29+
from ._compute._setup_scripts import SetupScripts, ScriptReference
2930
from ._compute._usage import Usage, UsageName
3031
from ._compute._vm_size import VmSize
3132
from ._compute.aml_compute import AmlCompute, AmlComputeSshSettings
@@ -240,6 +241,11 @@
240241
"AmlComputeNodeInfo",
241242
"ImageMetadata",
242243
"CustomApplications",
244+
"ImageSettings",
245+
"EndpointsSettings",
246+
"VolumeSettings",
247+
"SetupScripts",
248+
"ScriptReference",
243249
"SystemCreatedAcrAccount",
244250
"SystemCreatedStorageAccount",
245251
"ValidationResult",

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute_instance.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,22 @@ class ComputeInstance(Compute):
132132
:type schedules: Optional[ComputeSchedules], optional
133133
:param identity: The identity configuration, identities that are associated with the compute cluster.
134134
:type identity: IdentityConfiguration, optional
135-
:param idle_time_before_shutdown: Deprecated. Use :param: `idle_time_before_shutdown_minutes` instead.
135+
:param idle_time_before_shutdown: Deprecated. Use the `idle_time_before_shutdown_minutes` parameter instead.
136136
Stops compute instance after user defined period of inactivity.
137-
Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days.
137+
Time is defined in ISO8601 format. Minimum is 15 minutes, maximum is 3 days.
138138
:type idle_time_before_shutdown: Optional[str], optional
139139
:param idle_time_before_shutdown_minutes: Stops compute instance after a user defined period of
140-
inactivity in minutes. Minimum is 15 min, maximum is 3 days.
140+
inactivity in minutes. Minimum is 15 minutes, maximum is 3 days.
141141
:type idle_time_before_shutdown_minutes: Optional[int], optional
142142
:param enable_node_public_ip: Enable or disable node public IP address provisioning. Possible values are:
143143
True - Indicates that the compute nodes will have public IPs provisioned.
144144
False - Indicates that the compute nodes will have a private endpoint and no public IPs.
145145
Default Value: True.
146146
:type enable_node_public_ip: Optional[bool], optional
147-
:param setup_scripts: Details of customized scripts to execute for setting up the cluster.
147+
:param setup_scripts: Experimental. Details of customized scripts to execute for setting up the cluster.
148148
:type setup_scripts: Optional[SetupScripts], optional
149-
:param custom_applications: Describes available applications and their endpoints on this ComputeInstance.
149+
:param custom_applications: Experimental. List of custom applications and their endpoints
150+
for the compute instance.
150151
:type custom_applications: Optional[List[CustomApplications]], optional
151152
"""
152153

@@ -166,14 +167,14 @@ def __init__(
166167
idle_time_before_shutdown_minutes: Optional[int] = None,
167168
setup_scripts: Optional[SetupScripts] = None,
168169
enable_node_public_ip: bool = True,
170+
custom_applications: Optional[List[CustomApplications]] = None,
169171
**kwargs,
170172
):
171173
kwargs[TYPE] = ComputeType.COMPUTEINSTANCE
172174
self._state = kwargs.pop("state", None)
173175
self._last_operation = kwargs.pop("last_operation", None)
174176
self._os_image_metadata = kwargs.pop("os_image_metadata", None)
175177
self._services = kwargs.pop("services", None)
176-
self.custom_applications = kwargs.pop("custom_applications", None)
177178
super().__init__(
178179
name=name,
179180
location=kwargs.pop("location", None),
@@ -192,6 +193,7 @@ def __init__(
192193
self.idle_time_before_shutdown_minutes = idle_time_before_shutdown_minutes
193194
self.setup_scripts = setup_scripts
194195
self.enable_node_public_ip = enable_node_public_ip
196+
self.custom_applications = custom_applications
195197
self.subnet = None
196198

197199
@property

0 commit comments

Comments
 (0)