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
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-use-mlflow.md
+21-48Lines changed: 21 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -261,26 +261,9 @@ runid = runs[0].id
261
261
model_save_path = 'model'
262
262
```
263
263
264
-
### Create Docker image
264
+
### Deploy the model
265
265
266
-
The `mlflow.azureml.build_image()` function builds a Docker image from the saved model in a framework-aware manner. It automatically creates the framework-specific inferencing wrapper code and specifies package dependencies for you. Specify the model path, your workspace, run ID and other parameters.
267
-
268
-
The following code builds a docker image using *runs:/<run.id>/model* as the model_uri path for a Scikit-learn experiment.
The creation of the Docker image can take several minutes.
280
-
281
-
### Deploy the Docker image
282
-
283
-
After the image is created, use the Azure Machine Learning SDK to deploy the image as a web service.
266
+
Use the Azure Machine Learning SDK to deploy the model as a web service.
284
267
285
268
First, specify the deployment configuration. Azure Container Instance (ACI) is a suitable choice for a quick dev-test deployment, while Azure Kubernetes Service (AKS) is suitable for scalable production deployments.
Then, deploy the image by using the Azure Machine Learning SDK [deploy_from_image()](/python/api/azureml-core/azureml.core.webservice.webservice(class)?view=azure-ml-py#deploy-from-image-workspace--name--image--deployment-config-none--deployment-target-none--overwrite-false-) method.
285
+
Then, register and deploy the model by using the Azure Machine Learning SDK [deploy](/python/api/azureml-core/azureml.core.model.model?view=azure-ml-py#deploy-workspace--name--models--inference-config-none--deployment-config-none--deployment-target-none--overwrite-false-) method.
To deploy to AKS, first create an AKS cluster and bring over the Docker image you want to deploy. For this example, bring over the previously created image from the ACI deployment.
315
-
316
-
To get the image from the previous ACI deployment use the [Image](https://docs.microsoft.com/python/api/azureml-core/azureml.core.image.image.image?view=azure-ml-py) class.
317
-
318
-
```python
319
-
from azureml.core.image import Image
320
-
321
-
# Get the image by name, you can change this based on the image you want to deploy
Create an AKS cluster using the [ComputeTarget.create()](https://docs.microsoft.com/python/api/azureml-core/azureml.core.computetarget?view=azure-ml-py#create-workspace--name--provisioning-configuration-) method. It may take 20-25 minutes to create a new cluster.
299
+
To deploy to AKS, first create an AKS cluster. Create an AKS cluster using the [ComputeTarget.create()](https://docs.microsoft.com/python/api/azureml-core/azureml.core.computetarget?view=azure-ml-py#create-workspace--name--provisioning-configuration-) method. It may take 20-25 minutes to create a new cluster.
326
300
327
301
```python
328
302
from azureml.core.compute import AksCompute, ComputeTarget
@@ -346,26 +320,25 @@ Set up your deployment configuration with the [deploy_configuration()](https://d
346
320
347
321
```python
348
322
from azureml.core.webservice import Webservice, AksWebservice
349
-
from azureml.core.image import ContainerImage
350
323
351
324
# Set the web service configuration (using default here with app insights)
Then, deploy the image by using the Azure Machine Learning SDK [deploy_from_image()](/python/api/azureml-core/azureml.core.webservice.webservice(class)?view=azure-ml-py#deploy-from-image-workspace--name--image--deployment-config-none--deployment-target-none--overwrite-false-) method.
328
+
Then, deploy the image by using the Azure Machine Learning SDK [deploy()](Then, register and deploy the model by using the Azure Machine Learning SDK [deploy](/python/api/azureml-core/azureml.core.model.model?view=azure-ml-py#deploy-workspace--name--models--inference-config-none--deployment-config-none--deployment-target-none--overwrite-false-) method.
0 commit comments