You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -37,17 +37,17 @@ In this article, learn how to create and manage Azure ML environments using the
37
37
38
38
### Clone examples repository
39
39
40
-
To run the training examples, first clone the examples repository. For the CLI examples,change into the `cli` directory. For the SDK examples, change into the `SDK` directory:
40
+
To run the training examples, first clone the examples repository. For the CLI examples,change into the `cli` directory. For the SDK examples, change into the `SDK` directory:
Note that `--depth 1` clones only the latest commit to the repository which reduces time to complete the operation.
44
+
Note that `--depth 1` clones only the latest commit to the repository, which reduces time to complete the operation.
45
45
46
46
## Curated environments
47
47
48
48
There are two types of environments in Azure ML: curated and custom environments. Curated environments are predefined environments containing popular ML frameworks and tooling. Custom environments are user-defined and can be created via `az ml environment create`.
49
49
50
-
Curated environments are provided by Azure ML and are available in your workspace by default. Azure ML routinely updates these environments with the latest framework version releases and maintains them for bug fixes and security patches. They are backed by cached Docker images, which reduces job preparation cost and model deployment time.
50
+
Curated environments are provided by Azure ML and are available in your workspace by default. Azure ML routinely updates these environments with the latest framework version releases and maintains them for bug fixes and security patches. They're backed by cached Docker images, which reduce job preparation cost and model deployment time.
51
51
52
52
You can use these curated environments out of the box for training or deployment by referencing a specific environment using the `azureml:<curated-environment-name>:<version>` or `azureml:<curated-environment-name>@latest` syntax. You can also use them as reference for your own custom environments by modifying the Dockerfiles that back these curated environments.
53
53
@@ -69,7 +69,7 @@ For the YAML reference documentation for Azure ML environments, see [CLI (v2) en
69
69
70
70
To define an environment from a Docker image, provide the image URI of the image hosted in a registry such as Docker Hub or Azure Container Registry.
71
71
72
-
# [Azure CLI](#tabs/cli)
72
+
# [Azure CLI](#tab/cli)
73
73
74
74
The following example is a YAML specification file for an environment defined from a Docker image. An image from the official PyTorch repository on Docker Hub is specified via the `image` property in the YAML file.
75
75
@@ -81,7 +81,7 @@ To create the environment:
81
81
az ml environment create --file assets/environment/docker-image.yml
82
82
```
83
83
84
-
# [Python SDK](#tabs/sdk)
84
+
# [Python SDK](#tab/sdk)
85
85
86
86
The following example creates an environment from a Docker image. An image from the official PyTorch repository on Docker Hub is specified via the `image` property.
Instead of defining an environment from a prebuilt image, you can also define one from a Docker [build context](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context). To do so, specify the directory that will serve as the build context. This directory should contain a Dockerfile and any other files needed to build the image.
107
107
108
-
# [Azure CLI](#tabs/cli)
108
+
# [Azure CLI](#tab/cli)
109
109
110
110
The following example is a YAML specification file for an environment defined from a build context. The local path to the build context folder is specified in the `build.path` field, and the relative path to the Dockerfile within that build context folder is specified in the `build.dockerfile_path` field. If `build.dockerfile_path` is omitted in the YAML file, Azure ML will look for a Dockerfile named `Dockerfile` at the root of the build context.
111
111
@@ -119,7 +119,7 @@ To create the environment:
119
119
az ml environment create --file assets/environment/docker-context.yml
120
120
```
121
121
122
-
# [Python SDK](#tabs/sdk)
122
+
# [Python SDK](#tab/sdk)
123
123
124
124
In the following example, the local path to the build context folder is specified in the `path' parameter. Azure ML will look for a Dockerfile named `Dockerfile` at the root of the build context.
125
125
@@ -140,9 +140,9 @@ Azure ML will start building the image from the build context when the environme
140
140
141
141
You can define an environment using a standard conda YAML configuration file that includes the dependencies for the conda environment. See [Creating an environment manually](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-file-manually) for information on this standard format.
142
142
143
-
You must also specify a base Docker image for this environment. Azure ML will build the conda environment on top of the Docker image provided. If you install some Python dependencies in your Docker image, those packages will not exist in the execution environment thus causing runtime failures. By default, Azure ML will build a Conda environment with dependencies you specified, and will execute the job in that environment instead of using any Python libraries that you installed on the base image.
143
+
You must also specify a base Docker image for this environment. Azure ML will build the conda environment on top of the Docker image provided. If you install some Python dependencies in your Docker image, those packages won't exist in the execution environment thus causing runtime failures. By default, Azure ML will build a Conda environment with dependencies you specified, and will execute the job in that environment instead of using any Python libraries that you installed on the base image.
144
144
145
-
## [Azure CLI](#tabs/cli)
145
+
## [Azure CLI](#tab/cli)
146
146
147
147
The following example is a YAML specification file for an environment defined from a conda specification. Here the relative path to the conda file from the Azure ML environment YAML file is specified via the `conda_file` property. You can alternatively define the conda specification inline using the `conda_file` property, rather than defining it in a separate file.
148
148
@@ -154,7 +154,7 @@ To create the environment:
154
154
az ml environment create --file assets/environment/docker-image-plus-conda.yml
155
155
```
156
156
157
-
## [Python SDK](#tabs/sdk)
157
+
## [Python SDK](#tab/sdk)
158
158
159
159
The relative path to the conda file is specified using the `conda_file` parameter.
160
160
@@ -180,13 +180,13 @@ The SDK and CLI (v2) also allow you to manage the lifecycle of your Azure ML env
180
180
181
181
List all the environments in your workspace:
182
182
183
-
# [Azure CLI](#tabs/cli)
183
+
# [Azure CLI](#tab/cli)
184
184
185
185
```cli
186
186
az ml environment list
187
187
```
188
188
189
-
# [Python SDK](#tabs/sdk)
189
+
# [Python SDK](#tab/sdk)
190
190
191
191
```python
192
192
envs = ml_client.environments.list()
@@ -198,13 +198,13 @@ for env in envs:
198
198
199
199
List all the environment versions under a given name:
200
200
201
-
# [Azure CLI](#tabs/cli)
201
+
# [Azure CLI](#tab/cli)
202
202
203
203
```cli
204
204
az ml environment list --name docker-image-example
You can restore an archived environment to no longer hide it from list queries.
293
293
294
-
If an entire environment container is archived, you can restore that archived container. You cannot restore only a specific environment version if the entire environment container is archived - you will need to restore the entire container.
294
+
If an entire environment container is archived, you can restore that archived container. You can't restore only a specific environment version if the entire environment container is archived - you'll need to restore the entire container.
295
295
296
296
Restore an environment container:
297
297
298
-
# [Azure CLI](#tabs/cli)
298
+
# [Azure CLI](#tab/cli)
299
299
300
300
```cli
301
301
az ml environment restore --name docker-image-example
To use an environment for a training job, specify the `environment` field of the job YAML configuration. You can either reference an existing registered Azure ML environment via `environment: azureml:<environment-name>:<environment-version>` or `environment: azureml:<environment-name>@latest` (to reference the latest version of an environment), or define an environment specification inline. If defining an environment inline, do not specify the `name` and `version` fields, as these environments are treated as "unregistered" environments and are not tracked in your environment asset registry.
334
+
To use an environment for a training job, specify the `environment` field of the job YAML configuration. You can either reference an existing registered Azure ML environment via `environment: azureml:<environment-name>:<environment-version>` or `environment: azureml:<environment-name>@latest` (to reference the latest version of an environment), or define an environment specification inline. If defining an environment inline, don't specify the `name` and `version` fields, as these environments are treated as "unregistered" environments and aren't tracked in your environment asset registry.
335
335
336
-
# [Python SDK](#tabs/sdk)
336
+
# [Python SDK](#tab/sdk)
337
337
338
338
To use an environment for a training job, specify the `environment` property of the [command](/python/api/azure-ai-ml/azure.ai.ml#azure-ai-ml-command).
339
339
@@ -348,13 +348,13 @@ For more information on how to use environments in jobs, see [Train models](how-
348
348
349
349
## Use environments for model deployments
350
350
351
-
# [Azure CLI](#tabs/cli)
351
+
# [Azure CLI](#tab/cli)
352
352
353
353
You can also use environments for your model deployments for both online and batch scoring. To do so, specify the `environment` field in the deployment YAML configuration.
354
354
355
355
For more information on how to use environments in deployments, see [Deploy and score a machine learning model by using a managed online endpoint](how-to-deploy-managed-online-endpoints.md).
356
356
357
-
# [Python SDK](#tabs/sdk)
357
+
# [Python SDK](#tab/sdk)
358
358
359
359
You can also use environments for your model deployments. For more information, see [Deploy and score a machine learning model](how-to-deploy-managed-online-endpoint-sdk-v2.md).
0 commit comments