@@ -11,8 +11,8 @@ ms.custom:
11
11
ms.topic : how-to
12
12
ms.author : sgilley
13
13
author : sdgilley
14
- ms.reviewer : vijetaj
15
- ms.date : 10/23/2023
14
+ ms.reviewer : bijuv
15
+ ms.date : 10/02/2024
16
16
---
17
17
18
18
# Model training on serverless compute
@@ -102,7 +102,7 @@ When you [view your usage and quota in the Azure portal](how-to-manage-quotas.md
102
102
)
103
103
job = command(
104
104
command = " echo 'hello world'" ,
105
- environment = " AzureML- sklearn-1.0-ubuntu20.04-py38-cpu@ latest" ,
105
+ environment = " azureml://registries/azureml/environments/ sklearn-1.5/labels/ latest" ,
106
106
identity = UserIdentityConfiguration(),
107
107
)
108
108
# submit the command job
@@ -111,15 +111,25 @@ When you [view your usage and quota in the Azure portal](how-to-manage-quotas.md
111
111
112
112
# [Azure CLI](#tab/cli)
113
113
114
+ Create a file named hello.yaml with the following content:
115
+
114
116
```yml
115
117
$ schema: https:// azuremlschemas.azureedge.net/ latest/ commandJob.schema.json
116
118
command: echo " hello world"
117
119
environment:
118
- image: azureml:AzureML - sklearn - 1.0 - ubuntu20.04 - py38 - cpu @ latest
120
+ image: library / python: latest
119
121
identity:
120
122
type : user_identity
121
123
```
122
124
125
+ Submit the job with the following command:
126
+
127
+ ```bash
128
+ az ml job create -- file hello.yaml -- resource- group my- resource- group -- workspace- name my- workspace
129
+ ```
130
+
131
+ The rest of the CLI examples show variations of the hello.yaml file . Run each of them in the same way.
132
+
123
133
-- -
124
134
125
135
* ** User- assigned managed identity** : When you have a workspace configured with [user- assigned managed identity](how- to- identity- based- service- authentication.md# workspace), you can use that identity with the serverless job for storage access. To access secrets, see [Use authentication credential secrets in Azure Machine Learning jobs](how-to-use-secrets-in-runs.md).
@@ -143,7 +153,7 @@ When you [view your usage and quota in the Azure portal](how-to-manage-quotas.md
143
153
)
144
154
job = command(
145
155
command = " echo 'hello world'" ,
146
- environment = " AzureML- sklearn-1.0-ubuntu20.04-py38-cpu@ latest" ,
156
+ environment = " azureml://registries/azureml/environments/ sklearn-1.5/labels/ latest" ,
147
157
identity = ManagedIdentityConfiguration(),
148
158
)
149
159
# submit the command job
@@ -157,7 +167,7 @@ When you [view your usage and quota in the Azure portal](how-to-manage-quotas.md
157
167
$ schema: https:// azuremlschemas.azureedge.net/ latest/ commandJob.schema.json
158
168
command: echo " hello world"
159
169
environment:
160
- image: azureml:AzureML - sklearn - 1.0 - ubuntu20.04 - py38 - cpu @ latest
170
+ image: library / python: latest
161
171
identity:
162
172
type : managed
163
173
````
@@ -189,7 +199,7 @@ ml_client = MLClient(
189
199
)
190
200
job = command(
191
201
command = " echo 'hello world'" ,
192
- environment = " AzureML- sklearn-1.0-ubuntu20.04-py38-cpu@ latest" ,
202
+ environment = " azureml://registries/azureml/environments/ sklearn-1.5/labels/ latest" ,
193
203
)
194
204
# submit the command job
195
205
ml_client.create_or_update(job)
@@ -235,7 +245,7 @@ You can override these defaults. If you want to specify the VM type or number o
235
245
)
236
246
job = command(
237
247
command = " echo 'hello world'" ,
238
- environment = " AzureML- sklearn-1.0-ubuntu20.04-py38-cpu@ latest" ,
248
+ environment = " azureml://registries/azureml/environments/ sklearn-1.5/labels/ latest" ,
239
249
resources = JobResourceConfiguration(instance_type = " Standard_NC24" , instance_count = 4 )
240
250
)
241
251
# submit the command job
@@ -274,7 +284,7 @@ You can override these defaults. If you want to specify the VM type or number o
274
284
)
275
285
job = command(
276
286
command = " echo 'hello world'" ,
277
- environment = " AzureML- sklearn-1.0-ubuntu20.04-py38-cpu@ latest" ,
287
+ environment = " azureml://registries/azureml/environments/ sklearn-1.5/labels/ latest" ,
278
288
queue_settings = {
279
289
" job_tier" : " spot"
280
290
}
@@ -315,7 +325,7 @@ ml_client = MLClient(
315
325
)
316
326
job = command(
317
327
command = " echo 'hello world'" ,
318
- environment = " AzureML- sklearn-1.0-ubuntu20.04-py38-cpu@ latest" ,
328
+ environment = " azureml://registries/azureml/environments/ sklearn-1.5/labels/ latest" ,
319
329
identity = UserIdentityConfiguration(),
320
330
queue_settings = {
321
331
" job_tier" : " Standard"
@@ -331,7 +341,7 @@ ml_client.create_or_update(job)
331
341
$ schema: https:// azuremlschemas.azureedge.net/ latest/ commandJob.schema.json
332
342
command: echo " hello world"
333
343
environment:
334
- image: azureml:AzureML - sklearn - 1.0 - ubuntu20.04 - py38 - cpu @ latest
344
+ image: library / python: latest
335
345
queue_settings:
336
346
job_tier: Standard # Possible Values are Standard, Spot. Default is Standard.
337
347
identity:
0 commit comments