Skip to content

Commit 6d5bb9a

Browse files
Merge pull request #217276 from Blackmist/image-versions
Image versions
2 parents 7bf49a9 + a91fa2a commit 6d5bb9a

7 files changed

+16
-98
lines changed

articles/machine-learning/how-to-access-resources-from-endpoints-managed-identities.md

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,7 @@ The following Python endpoint object:
341341
* Assigns the name by which you want to refer to the endpoint to the variable `endpoint_name.
342342
* Specifies the type of authorization to use to access the endpoint `auth-mode="key"`.
343343

344-
```python
345-
endpoint = ManagedOnlineEndpoint(name=endpoint_name, auth_mode="key")
346-
```
344+
[!notebook-python[] (~/azureml-examples-main/sdk/python/endpoints/online/managed/managed-identities/online-endpoints-managed-identity-sai.ipynb?name=2-define-endpoint-configuration)]
347345

348346
This deployment object:
349347

@@ -354,27 +352,7 @@ This deployment object:
354352
* Includes environment variables needed for the system-assigned managed identity to access storage.
355353

356354

357-
```python
358-
deployment = ManagedOnlineDeployment(
359-
name="blue",
360-
endpoint_name=endpoint_name,
361-
model=Model(path="../../model-1/model/"),
362-
code_configuration=CodeConfiguration(
363-
code="../../model-1/onlinescoring/", scoring_script="score_managedidentity.py"
364-
),
365-
environment=Environment(
366-
conda_file="../../model-1/environment/conda.yml",
367-
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210727.v1",
368-
),
369-
instance_type="Standard_DS2_v2",
370-
instance_count=1,
371-
environment_variables={
372-
"STORAGE_ACCOUNT_NAME": storage_account_name,
373-
"STORAGE_CONTAINER_NAME": storage_container_name,
374-
"FILE_NAME": file_name,
375-
},
376-
)
377-
```
355+
[!notebook-python[] (~/azureml-examples-main/sdk/python/endpoints/online/managed/managed-identities/online-endpoints-managed-identity-sai.ipynb?name=2-define-deployment-configuration)]
378356

379357
# [User-assigned (Python)](#tab/user-identity-python)
380358

@@ -392,29 +370,7 @@ This deployment object:
392370
* Adds a placeholder environment variable for `UAI_CLIENT_ID`, which will be added after creating one and before actually deploying this configuration.
393371

394372

395-
```python
396-
deployment = ManagedOnlineDeployment(
397-
name="blue",
398-
endpoint_name=endpoint_name,
399-
model=Model(path="../../model-1/model/"),
400-
code_configuration=CodeConfiguration(
401-
code="../../model-1/onlinescoring/", scoring_script="score_managedidentity.py"
402-
),
403-
environment=Environment(
404-
conda_file="../../model-1/environment/conda.yml",
405-
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210727.v1",
406-
),
407-
instance_type="Standard_DS2_v2",
408-
instance_count=1,
409-
environment_variables={
410-
"STORAGE_ACCOUNT_NAME": storage_account_name,
411-
"STORAGE_CONTAINER_NAME": storage_container_name,
412-
"FILE_NAME": file_name,
413-
# We will update this after creating an identity
414-
"UAI_CLIENT_ID": "uai_client_id_place_holder",
415-
},
416-
)
417-
```
373+
[!notebook-python[] (~/azureml-examples-main/sdk/python/endpoints/online/managed/managed-identities/online-endpoints-managed-identity-uai.ipynb?name=2-define-deployment-configuration)]
418374

419375
---
420376

articles/machine-learning/how-to-configure-auto-train.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def automl_classification(
421421
automl_output=Input(type="mlflow_model")
422422
),
423423
command="ls ${{inputs.automl_output}}",
424-
environment="AzureML-sklearn-0.24-ubuntu18.04-py37-cpu:1"
424+
environment="AzureML-sklearn-0.24-ubuntu18.04-py37-cpu:latest"
425425
)
426426
show_output = command_func(automl_output=classification_node.outputs.best_model)
427427

articles/machine-learning/how-to-debug-managed-online-endpoints-visual-studio-code.md

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -175,26 +175,7 @@ ml_client = MLClient(
175175

176176
To debug online endpoints locally in VS Code, set the `vscode-debug` and `local` flags when creating or updating an Azure Machine Learning online deployment. The following code mirrors a deployment example from the examples repo:
177177

178-
```python
179-
deployment = ManagedOnlineDeployment(
180-
name="blue",
181-
endpoint_name=endpoint_name,
182-
model=Model(path="../model-1/model/sklearn_regression_model.pkl"),
183-
code_configuration=CodeConfiguration(
184-
code="../model-1/onlinescoring", scoring_script="score.py"
185-
),
186-
environment=Environment(
187-
conda_file="../model-1/environment/conda.yml",
188-
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210727.v1",
189-
),
190-
instance_type="Standard_DS2_v2",
191-
instance_count=1,
192-
)
193-
194-
deployment = ml_client.online_deployments.begin_create_or_update(
195-
deployment, local=True, vscode_debug=True
196-
)
197-
```
178+
[!notebook-python[] (~/azureml-examples-main/sdk/python/endpoints/online/managed/debug-online-endpoints-locally-in-visual-studio-code.ipynb?name=launch-container-4)]
198179

199180
> [!IMPORTANT]
200181
> On Windows Subsystem for Linux (WSL), you'll need to update your PATH environment variable to include the path to the VS Code executable or use WSL interop. For more information, see [Windows interoperability with Linux](/windows/wsl/interop).
@@ -391,26 +372,7 @@ To apply changes to your code:
391372
392373
For more extensive changes involving updates to your environment and endpoint configuration, use your `MLClient`'s `online_deployments.update` module/method. Doing so will trigger a full image rebuild with your changes.
393374
394-
```python
395-
new_deployment = ManagedOnlineDeployment(
396-
name="green",
397-
endpoint_name=endpoint_name,
398-
model=Model(path="../model-2/model/sklearn_regression_model.pkl"),
399-
code_configuration=CodeConfiguration(
400-
code="../model-2/onlinescoring", scoring_script="score.py"
401-
),
402-
environment=Environment(
403-
conda_file="../model-2/environment/conda.yml",
404-
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210727.v1",
405-
),
406-
instance_type="Standard_DS2_v2",
407-
instance_count=2,
408-
)
409-
410-
deployment = ml_client.online_deployments.begin_create_or_update(
411-
new_deployment, local=True, vscode_debug=True
412-
)
413-
```
375+
[!notebook-python[] (~/azureml-examples-main/sdk/python/endpoints/online/managed/debug-online-endpoints-locally-in-visual-studio-code.ipynb?name=edit-endpoint-1)]
414376
415377
Once the updated image is built and your development container launches, use the VS Code debugger to test and troubleshoot your updated endpoint.
416378

articles/machine-learning/how-to-deploy-automl-endpoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Next, we'll create the managed online endpoints and deployments.
251251
model = Model(path="./src/model.pkl")
252252
env = Environment(
253253
conda_file="./src/conda_env_v_1_0_0.yml",
254-
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210727.v1",
254+
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:latest",
255255
)
256256

257257
blue_deployment = ManagedOnlineDeployment(

articles/machine-learning/how-to-deploy-managed-online-endpoints.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ In this article, we first define names of online endpoint and deployment for deb
238238
model = Model(path="../model-1/model/sklearn_regression_model.pkl")
239239
env = Environment(
240240
conda_file="../model-1/environment/conda.yml",
241-
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210727.v1",
241+
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:latest",
242242
)
243243

244244
blue_deployment = ManagedOnlineDeployment(
@@ -520,7 +520,7 @@ This deployment might take up to 15 minutes, depending on whether the underlying
520520
model = Model(path="../model-1/model/sklearn_regression_model.pkl")
521521
env = Environment(
522522
conda_file="../model-1/environment/conda.yml",
523-
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210727.v1",
523+
image="mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:latest",
524524
)
525525

526526
blue_deployment = ManagedOnlineDeployment(

articles/machine-learning/how-to-read-write-data-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ job = command(
130130
code="./src", # local path where the code is stored
131131
command="ls ${{inputs.input_data}}",
132132
inputs=my_job_inputs,
133-
environment="AzureML-sklearn-0.24-ubuntu18.04-py37-cpu:9",
133+
environment="AzureML-sklearn-0.24-ubuntu18.04-py37-cpu:latest",
134134
compute="cpu-cluster",
135135
)
136136

articles/machine-learning/v1/how-to-train-tensorflow.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ To define the Azure ML [Environment](../concept-environments.md) that encapsulat
136136

137137
#### Use a curated environment
138138

139-
Azure ML provides prebuilt, curated environments if you don't want to define your own environment. Azure ML has several CPU and GPU curated environments for TensorFlow corresponding to different versions of TensorFlow. For more info, see [Azure ML Curated Environments](../resource-curated-environments.md).
139+
Azure ML provides prebuilt, curated environments if you don't want to define your own environment. Azure ML has several CPU and GPU curated environments for TensorFlow corresponding to different versions of TensorFlow. You can use the latest version of this environment using the `@latest` directive. For more info, see [Azure ML Curated Environments](../resource-curated-environments.md).
140140

141-
If you want to use a curated environment, you can run the following command instead:
141+
If you want to use a curated environment, the code will be similar to the following example:
142142

143143
```python
144-
curated_env_name = 'AzureML-TensorFlow-2.2-GPU'
144+
curated_env_name = 'AzureML-tensorflow-2.7-ubuntu20.04-py38-cuda11-gpu'
145145
tf_env = Environment.get(workspace=ws, name=curated_env_name)
146146
```
147147

@@ -156,14 +156,14 @@ Make sure the curated environment includes all the dependencies required by your
156156

157157
```python
158158

159-
tf_env = Environment.from_conda_specification(name='tensorflow-2.2-gpu', file_path='./conda_dependencies.yml')
159+
tf_env = Environment.from_conda_specification(name='AzureML-tensorflow-2.7-ubuntu20.04-py38-cuda11-gpu', file_path='./conda_dependencies.yml')
160160
```
161161

162162
If you had instead modified the curated environment object directly, you can clone that environment with a new name:
163163

164164
```python
165165

166-
tf_env = tf_env.clone(new_name='tensorflow-2.2-gpu')
166+
tf_env = tf_env.clone(new_name='my-AzureML-tensorflow-2.7-ubuntu20.04-py38-cuda11-gpu')
167167
```
168168

169169
#### Create a custom environment
@@ -187,7 +187,7 @@ Create an Azure ML environment from this conda environment specification. The en
187187
By default if no base image is specified, Azure ML will use a CPU image `azureml.core.environment.DEFAULT_CPU_IMAGE` as the base image. Since this example runs training on a GPU cluster, you'll need to specify a GPU base image that has the necessary GPU drivers and dependencies. Azure ML maintains a set of base images published on Microsoft Container Registry (MCR) that you can use, see the [Azure/AzureML-Containers GitHub repo](https://github.com/Azure/AzureML-Containers) for more information.
188188

189189
```python
190-
tf_env = Environment.from_conda_specification(name='tensorflow-2.2-gpu', file_path='./conda_dependencies.yml')
190+
tf_env = Environment.from_conda_specification(name='AzureML-tensorflow-2.7-ubuntu20.04-py38-cuda11-gpu', file_path='./conda_dependencies.yml')
191191
192192
# Specify a GPU base image
193193
tf_env.docker.enabled = True

0 commit comments

Comments
 (0)