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
The [prebuilt Docker images for model inference](concept-prebuilt-docker-images-inference.md) contain packages for popular machine learning frameworks. There are two methods that can be used to add Python packages __without rebuilding the Docker image__:
19
19
20
-
*[Dynamic installation](#dynamic): This approach uses a [requirements](https://pip.pypa.io/en/stable/cli/pip_install/#requirements-file-format) file to automatically restore python packages when the Docker container boots.
20
+
*[Dynamic installation](#dynamic): This approach uses a [requirements](https://pip.pypa.io/en/stable/cli/pip_install/#requirements-file-format) file to automatically restore Python packages when the Docker container boots.
21
21
22
22
Consider this method __for rapid prototyping__. When the image starts, packages are restored using the `requirements.txt` file. This method increases startup of the image, and you must wait longer before the deployment can handle requests.
23
23
24
-
*[Pre-installed python packages](#preinstalled): You provide a directory containing preinstalled Python packages. During deployment, this directory is mounted into the container for your entry script (`score.py`) to use.
24
+
*[Pre-installed Python packages](#preinstalled): You provide a directory containing preinstalled Python packages. During deployment, this directory is mounted into the container for your entry script (`score.py`) to use.
25
25
26
26
Use this approach __for production deployments__. Since the directory containing the packages is mounted to the image, it can be used even when your deployments don't have public internet access. For example, when deployed into a secured Azure Virtual Network.
27
27
@@ -38,7 +38,7 @@ The [prebuilt Docker images for model inference](concept-prebuilt-docker-images-
38
38
39
39
## Dynamic installation
40
40
41
-
This approach uses a [requirements](https://pip.pypa.io/en/stable/cli/pip_install/#requirements-file-format) file to automatically restore python packages when the image starts up.
41
+
This approach uses a [requirements](https://pip.pypa.io/en/stable/cli/pip_install/#requirements-file-format) file to automatically restore Python packages when the image starts up.
42
42
43
43
To extend your prebuilt docker container image through a requirements.txt, follow these steps:
44
44
@@ -75,11 +75,11 @@ The following diagram is a visual representation of the dynamic installation pro
75
75
76
76
<aid="preinstalled"></a>
77
77
78
-
## Pre-installed python packages
78
+
## Pre-installed Python packages
79
79
80
80
This approach mounts a directory that you provide into the image. The Python packages from this directory can then be used by the entry script (`score.py`).
81
81
82
-
To extend your prebuilt docker container image through pre-installed python packages, follow these steps:
82
+
To extend your prebuilt docker container image through pre-installed Python packages, follow these steps:
83
83
84
84
> [!IMPORTANT]
85
85
> You must use packages compatible with Python 3.7. All current images are pinned to Python 3.7.
@@ -125,7 +125,7 @@ Here are some things that may cause this problem:
125
125
126
126
* The [Model.package()](/python/api/azureml-core/azureml.core.model(class)) method lets you create a model package in the form of a Docker image or Dockerfile build context. Using Model.package() with prebuilt inference docker images triggers an intermediate image build that changes the non-root user to root user.
127
127
128
-
* We encourage you to use our python package extensibility solutions. If other dependencies are required (such as`apt` packages), create your own [Dockerfile extending from the inference image](how-to-extend-prebuilt-docker-image-inference.md#buildmodel).
128
+
* We encourage you to use our Python package extensibility solutions. If other dependencies are required (such as`apt` packages), create your own [Dockerfile extending from the inference image](how-to-extend-prebuilt-docker-image-inference.md#buildmodel).
129
129
130
130
## Frequently asked questions
131
131
@@ -147,7 +147,7 @@ Here are some things that may cause this problem:
| Solution | Create a `requirements.txt` that installs the specified packages when the container starts. | Create a local python environment withall of the dependencies. Mount this directory into container at runtime. |
150
+
| Solution | Create a `requirements.txt` that installs the specified packages when the container starts. | Create a local Python environment withall of the dependencies. Mount this directory into container at runtime. |
151
151
| Package Installation | No extra installation (assuming pip already installed) | Virtual environment or conda environment installation. |
152
152
| Virtual environment Setup | No extra setup of virtual environment required, as users can pull the current local user environment with pip freeze as needed to create the `requirements.txt`. | Need to set up a clean virtual environment, may take extra steps depending on the current user local environment. |
153
153
| [Debugging](how-to-inference-server-http.md) | Easy to set up and debug server, since dependencies are clearly listed. | Unclean virtual environment could cause problems when debugging of server. For example, it may not be clear if errors come from the environment or user code. |
0 commit comments