Skip to content

Commit 9dd4952

Browse files
authored
Update how-to-troubleshoot-environments.md
1 parent 8399fe3 commit 9dd4952

File tree

1 file changed

+112
-39
lines changed

1 file changed

+112
-39
lines changed

articles/machine-learning/how-to-troubleshoot-environments.md

Lines changed: 112 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ To create a new environment, you must use one of the following approaches:
165165
- [Sample here](https://aka.ms/azureml/environment/create-env-conda-spec-v2)
166166

167167
### Missing Docker definition
168-
*Applies to: Azure CLI & Python SDK v1 (Deprecated)*
168+
*Applies to: Python SDK v1 (Deprecated)*
169169
<!--issueDescription-->
170170
This issue can happen when your environment definition is missing a `DockerSection.` This section configures settings related to the final Docker image built from your environment specification.
171171

@@ -195,16 +195,12 @@ myenv.docker.base_dockerfile = dockerfile
195195
**Resources**
196196
* [DockerSection](https://aka.ms/azureml/environment/environment-docker-section)
197197

198-
### Missing Docker build context location
199-
- If you're specifying a Docker build context as part of your environment build, you must provide the path of the build context directory
200-
- See [BuildContext](https://aka.ms/azureml/environment/build-context-class)
201-
202198
### Too many Docker options
203199
<!--issueDescription-->
204200

205201
**Potential causes:**
206202

207-
*Applies to: Azure CLI & Python SDK v1*
203+
*Applies to: Python SDK v1 (Deprecated)*
208204

209205
You have more than one of these Docker options specified in your environment definition
210206
- `base_image`
@@ -227,7 +223,7 @@ You have more than one of these Docker options specified in your environment def
227223

228224
Choose which Docker option you'd like to use to build your environment. Then set all other specified options to None.
229225

230-
*Applies to: Azure CLI & Python SDK v1*
226+
*Applies to: Python SDK v1 (Deprecated)*
231227

232228
```
233229
from azureml.core import Environment
@@ -248,7 +244,7 @@ myenv.docker.base_image = None
248244

249245
**Potential causes:**
250246

251-
*Applies to: Azure CLI & Python SDK v1*
247+
*Applies to: Python SDK v1 (Deprecated)*
252248

253249
You didn't specify one of the following options in your environment definition
254250
- `base_image`
@@ -271,15 +267,15 @@ You didn't specify one of the following options in your environment definition
271267

272268
Choose which Docker option you'd like to use to build your environment, then populate that option in your environment definition.
273269

274-
*Applies to: Azure CLI & Python SDK v1*
270+
*Applies to: Python SDK v1 (Deprecated)*
275271

276272
```
277273
from azureml.core import Environment
278274
myenv = Environment(name="myEnv")
279275
myenv.docker.base_image = "pytorch/pytorch:latest"
280276
```
281277

282-
*Applies to: Azure CLI & Python SDK v2*
278+
*Applies to: Python SDK v2*
283279

284280
```
285281
env_docker_image = Environment(
@@ -307,7 +303,7 @@ ml_client.environments.create_or_update(env_docker_image)
307303

308304
**Troubleshooting steps**
309305

310-
*Applies to: Python SDK azureml V1*
306+
*Applies to: Python SDK v1 (Deprecated)*
311307

312308
Add the missing username or password to your environment definition to fix the issue
313309

@@ -323,7 +319,7 @@ ws = Workspace.from_config()
323319
ws.set_connection("connection1", "ACR", "<URL>", "Basic", "{'Username': '<username>', 'Password': '<password>'}")
324320
```
325321

326-
*Applies to: Azure CLI extensions V1 & V2*
322+
*Applies to: Azure CLI extensions v1 & v2*
327323

328324
Create a workspace connection from a YAML specification file
329325

@@ -335,8 +331,8 @@ az ml connection create --file connection.yml --resource-group my-resource-group
335331
> * Providing credentials in your environment definition is deprecated. Use workspace connections instead.
336332
337333
**Resources**
338-
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
339-
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
334+
* [Python SDK v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
335+
* [Python SDK v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
340336
* [Azure CLI workspace connections](/cli/azure/ml/connection)
341337

342338
### Multiple credentials for base image registry
@@ -352,7 +348,7 @@ az ml connection create --file connection.yml --resource-group my-resource-group
352348

353349
**Troubleshooting steps**
354350

355-
*Applies to: Python SDK azureml V1*
351+
*Applies to: Python SDK v1 (Deprecated)*
356352

357353
If you're using workspace connections, view the connections you have set, and delete whichever one(s) you don't want to use
358354

@@ -374,8 +370,8 @@ myEnv.docker.base_image_registry.registry_identity = None
374370
375371
**Resources**
376372
* [Delete a workspace connection v1](https://aka.ms/azureml/environment/delete-connection-v1)
377-
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
378-
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
373+
* [Python SDK v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
374+
* [Python SDK v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
379375
* [Azure CLI workspace connections](/cli/azure/ml/connection)
380376

381377
### Secrets in base image registry
@@ -393,7 +389,7 @@ myEnv.docker.base_image_registry.registry_identity = None
393389

394390
Specifying credentials in your environment definition is deprecated. Delete credentials from your environment definition and use workspace connections instead.
395391

396-
*Applies to: Python SDK azureml V1*
392+
*Applies to: Python SDK v1 (Deprecated)*
397393

398394
Set a workspace connection on your workspace
399395

@@ -403,7 +399,7 @@ ws = Workspace.from_config()
403399
ws.set_connection("connection1", "ACR", "<URL>", "Basic", "{'Username': '<username>', 'Password': '<password>'}")
404400
```
405401

406-
*Applies to: Azure CLI extensions V1 & V2*
402+
*Applies to: Azure CLI extensions v1 & v2*
407403

408404
Create a workspace connection from a YAML specification file
409405

@@ -412,8 +408,8 @@ az ml connection create --file connection.yml --resource-group my-resource-group
412408
```
413409

414410
**Resources**
415-
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
416-
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
411+
* [Python SDK v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
412+
* [Python SDK v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
417413
* [Azure CLI workspace connections](/cli/azure/ml/connection)
418414

419415
### Deprecated Docker attribute
@@ -436,30 +432,107 @@ az ml connection create --file connection.yml --resource-group my-resource-group
436432

437433
**Troubleshooting steps**
438434

439-
*Applies to: Python SDK azureml V1*
435+
*Applies to: Python SDK v1 (Deprecated)*
440436

441437
Instead of specifying these attributes in the `DockerSection` of your environment definition, use [DockerConfiguration](https://aka.ms/azureml/environment/docker-configuration-class)
442438

443439
**Resources**
444440
* See `DockerSection` [deprecated variables](https://aka.ms/azureml/environment/docker-section-class)
445441

446442
### Dockerfile length over limit
447-
- The specified Dockerfile can't exceed the maximum Dockerfile size of 100 KB
448-
- Consider shortening your Dockerfile to get it under this limit
443+
<!--issueDescription-->
444+
**Potential causes:**
445+
* Your specified Dockerfile exceeded the maximum size of 100 KB
446+
447+
**Affected areas (symptoms):**
448+
* Failure in registering your environment
449+
<!--/issueDescription-->
450+
451+
**Troubleshooting steps**
452+
453+
Shorten your Dockerfile to get it under this limit
454+
455+
**Resources**
456+
* See [best practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)
449457

450458
### *Docker build context issues*
459+
### Missing Docker build context location
460+
<!--issueDescription-->
461+
**Potential causes:**
462+
* You didn't provide the path of your build context directory in your environment definition
463+
464+
**Affected areas (symptoms):**
465+
* Failure in registering your environment
466+
<!--/issueDescription-->
467+
468+
**Troubleshooting steps**
469+
470+
*Applies to: Python SDK v1 (Deprecated)*
471+
472+
Include a path in the `build_context` of your [DockerSection](https://aka.ms/azureml/environment/docker-section-class)
473+
* See [DockerBuildContext Class](/python/api/azureml-core/azureml.core.environment.dockerbuildcontext)
474+
475+
*Applies to: Azure CLI & Python SDK v2*
476+
477+
Ensure that you include a path for your build context
478+
* See [BuildContext class](https://aka.ms/azureml/environment/build-context-class)
479+
* See this [sample](https://aka.ms/azureml/environment/create-env-build-context-v2)
480+
481+
**Resources**
482+
* [Understand build context](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context)
483+
451484
### Missing Dockerfile path
452-
- In the Docker build context, a Dockerfile path must be specified
453-
- The path should be relative to the root of the Docker build context directory
454-
- See [Build Context class](https://aka.ms/azureml/environment/build-context-class)
485+
<!--issueDescription-->
486+
This issue can happen when AzureML fails to find your Dockerfile. As a default, AzureML will look for a Dockerfile named 'Dockerfile' at the root of your build context directory unless a Dockerfile path is specified.
487+
488+
**Potential causes:**
489+
* Your Dockerfile isn't at the root of your build context directory and/or is named something other than 'Dockerfile,' and you didn't provide its path
490+
491+
**Affected areas (symptoms):**
492+
* Failure in registering your environment
493+
<!--/issueDescription-->
494+
495+
**Troubleshooting steps**
496+
497+
*Applies to: Python SDK v1 (Deprecated)*
498+
499+
In the `build_context` of your [DockerSection](https://aka.ms/azureml/environment/docker-section-class), include a `dockerfile_path`
500+
* See [DockerBuildContext Class](/python/api/azureml-core/azureml.core.environment.dockerbuildcontext)
501+
502+
*Applies to: Azure CLI & Python SDK v2*
503+
504+
Specify a Dockerfile path
505+
* [See BuildContext class](https://aka.ms/azureml/environment/build-context-class)
506+
* See this [sample](https://aka.ms/azureml/environment/create-env-build-context-v2)
507+
508+
**Resources**
509+
* [Understand build context](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context)
455510

456511
### Not allowed to specify attribute with Docker build context
457-
- If a Docker build context is specified, then the following items can't also be specified in the
458-
environment definition:
459-
- Environment variables
460-
- Conda dependencies
461-
- R
462-
- Spark
512+
<!--issueDescription-->
513+
This issue can happen when you've specified properties in your environment definition that can't be included with a Docker build context.
514+
515+
**Potential causes:**
516+
* You specified a Docker build context, along with at least one of the following in your environment definition:
517+
* Environment variables
518+
* Conda dependencies
519+
* R
520+
* Spark
521+
522+
**Affected areas (symptoms):**
523+
* Failure in registering your environment
524+
<!--/issueDescription-->
525+
526+
**Troubleshooting steps**
527+
528+
*Applies to: Python SDK v1 (Deprecated)*
529+
530+
If any of the above-listed properties are specified in your environment definition, remove them
531+
* If you're using a Docker build context and want to specify conda dependencies, your conda specification should reside in your build context directory
532+
533+
**Resources**
534+
* [Understand build context](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context)
535+
* Python SDK v1 [Environment Class](https://aka.ms/azureml/environment/environment-class-v1)
463536

464537
### Location type not supported/Unknown location type
465538
- The following are accepted location types:
@@ -644,7 +717,7 @@ This issue can happen by failing to access a workspace's associated Azure Contai
644717

645718
**Troubleshooting steps**
646719

647-
*Applies to: Python SDK azureml V1*
720+
*Applies to: Python SDK v1*
648721

649722
Update the workspace image build compute property using SDK:
650723

@@ -654,7 +727,7 @@ ws = Workspace.from_config()
654727
ws.update(image_build_compute = 'mycomputecluster')
655728
```
656729

657-
*Applies to: Azure CLI extensions V1 & V2*
730+
*Applies to: Azure CLI extensions v1 & v2*
658731

659732
Update the workspace image build compute property using Azure CLI:
660733

@@ -1004,15 +1077,15 @@ because you can't provide interactive authentication during a build
10041077

10051078
Provide authentication via workspace connections
10061079

1007-
*Applies to: Python SDK azureml V1*
1080+
*Applies to: Python SDK v1*
10081081

10091082
```
10101083
from azureml.core import Workspace
10111084
ws = Workspace.from_config()
10121085
ws.set_connection("connection1", "PythonFeed", "<URL>", "Basic", "{'Username': '<username>', 'Password': '<password>'}")
10131086
```
10141087

1015-
*Applies to: Azure CLI extensions V1 & V2*
1088+
*Applies to: Azure CLI extensions v1 & v2*
10161089

10171090
Create a workspace connection from a YAML specification file
10181091

@@ -1021,8 +1094,8 @@ az ml connection create --file connection.yml --resource-group my-resource-group
10211094
```
10221095

10231096
**Resources**
1024-
* [Python SDK AzureML v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
1025-
* [Python SDK AzureML v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
1097+
* [Python SDK v1 workspace connections](https://aka.ms/azureml/environment/set-connection-v1)
1098+
* [Python SDK v2 workspace connections](/python/api/azure-ai-ml/azure.ai.ml.entities.workspaceconnection)
10261099
* [Azure CLI workspace connections](/cli/azure/ml/connection)
10271100

10281101
### Forbidden blob

0 commit comments

Comments
 (0)