Skip to content

Commit d1becde

Browse files
authored
Merge pull request #107858 from Blackmist/custom-image
updates for environment
2 parents b947f6a + 7c03744 commit d1becde

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

articles/machine-learning/how-to-deploy-custom-docker-image.md

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: conceptual
99
ms.author: jordane
1010
author: jpe316
1111
ms.reviewer: larryfr
12-
ms.date: 03/05/2020
12+
ms.date: 03/16/2020
1313
---
1414

1515
# Deploy a model using a custom Docker base image
@@ -272,18 +272,49 @@ For more information on customizing your Python environment, see [Create and man
272272
> [!IMPORTANT]
273273
> Currently the Machine Learning CLI can use images from the Azure Container Registry for your workspace or publicly accessible repositories. It cannot use images from standalone private registries.
274274
275-
When deploying a model using the Machine Learning CLI, you provide an inference configuration file that references the custom image. The following JSON document demonstrates how to reference an image in a public container registry:
275+
Before deploying a model using the Machine Learning CLI, create an [environment](https://docs.microsoft.com/python/api/azureml-core/azureml.core.environment.environment?view=azure-ml-py) that uses the custom image. Then create an inference configuration file that references the environment. You can also define the environment directly in the inference configuration file. The following JSON document demonstrates how to reference an image in a public container registry. In this example, the environment is defined inline:
276276

277277
```json
278278
{
279-
"entryScript": "score.py",
280-
"runtime": "python",
281-
"condaFile": "infenv.yml",
282-
"extraDockerfileSteps": null,
283-
"sourceDirectory": null,
284-
"enableGpu": false,
285-
"baseImage": "mcr.microsoft.com/azureml/o16n-sample-user-base/ubuntu-miniconda",
286-
"baseImageRegistry": "mcr.microsoft.com"
279+
"entryScript": "score.py",
280+
"environment": {
281+
"docker": {
282+
"arguments": [],
283+
"baseDockerfile": null,
284+
"baseImage": "mcr.microsoft.com/azureml/o16n-sample-user-base/ubuntu-miniconda",
285+
"enabled": false,
286+
"sharedVolumes": true,
287+
"shmSize": null
288+
},
289+
"environmentVariables": {
290+
"EXAMPLE_ENV_VAR": "EXAMPLE_VALUE"
291+
},
292+
"name": "my-deploy-env",
293+
"python": {
294+
"baseCondaEnvironment": null,
295+
"condaDependencies": {
296+
"channels": [
297+
"conda-forge"
298+
],
299+
"dependencies": [
300+
"python=3.6.2",
301+
{
302+
"pip": [
303+
"azureml-defaults",
304+
"azureml-telemetry",
305+
"scikit-learn",
306+
"inference-schema[numpy-support]"
307+
]
308+
}
309+
],
310+
"name": "project_environment"
311+
},
312+
"condaDependenciesFile": null,
313+
"interpreterPath": "python",
314+
"userManagedDependencies": false
315+
},
316+
"version": "1"
317+
}
287318
}
288319
```
289320

0 commit comments

Comments
 (0)