ContainerImageConfig Class
Defines Image configuration settings specific to Container deployments - requires execution script and runtime.
In typical use cases, you will use the image_configuration
method of the
ContainerImage class to create a ContainerImageConfig object.
Initialize the config object.
- Inheritance
-
ContainerImageConfig
Constructor
ContainerImageConfig(execution_script, runtime, conda_file=None, docker_file=None, schema_file=None, dependencies=None, enable_gpu=None, tags=None, properties=None, description=None, base_image=None, base_image_registry=None, allow_absolute_path=False, cuda_version=None)
Parameters
Name | Description |
---|---|
execution_script
Required
|
The path to local file that contains the code to run for the image. |
runtime
Required
|
The runtime to use for the image. Current supported runtimes are 'spark-py' and 'python'. |
conda_file
|
The path to local file containing a conda environment definition to use for the image. Default value: None
|
docker_file
|
The path to local file containing additional Docker steps to run when setting up the image. Default value: None
|
schema_file
|
The path to local file containing a webservice schema to use when the image is deployed. Default value: None
|
dependencies
|
A list of paths to additional files/folders that the image needs to run. Default value: None
|
enable_gpu
|
Whether to enable GPU support in the image. The GPU image must be used on Microsoft Azure Services such as Azure Container Instances, Azure Machine Learning Compute, Azure Virtual Machines, and Azure Kubernetes Service. Defaults to False. Default value: None
|
tags
|
A dictionary of key value tags to give this image. Default value: None
|
properties
|
A dictionary of key value properties to give this image. These properties cannot be changed after deployment, however new key value pairs can be added. Default value: None
|
description
|
A description to give this image. Default value: None
|
base_image
|
A custom image to be used as base image. If no base image is given then the base image will be used based off of given runtime parameter. Default value: None
|
base_image_registry
|
The image registry that contains the base image. Default value: None
|
allow_absolute_path
|
Indicates whether to allow absolute path. Default value: False
|
cuda_version
|
The version of CUDA to install for images that need GPU support. The GPU image must be used on Microsoft Azure Services such as Azure Container Instances, Azure Machine Learning Compute, Azure Virtual Machines, and Azure Kubernetes Service. Supported versions are 9.0, 9.1, and 10.0. If 'enable_gpu' is set, this defaults to '9.1'. Default value: None
|
execution_script
Required
|
Path to local file that contains the code to run for the image |
runtime
Required
|
Which runtime to use for the image. Current supported runtimes are 'spark-py' and 'python' |
conda_file
Required
|
Path to local file containing a conda environment definition to use for the image |
docker_file
Required
|
Path to local file containing additional Docker steps to run when setting up the image |
schema_file
Required
|
Path to local file containing a webservice schema to use when the image is deployed |
dependencies
Required
|
List of paths to additional files/folders that the image needs to run |
enable_gpu
Required
|
Whether or not to enable GPU support in the image. The GPU image must be used on Microsoft Azure Services such as Azure Container Instances, Azure Machine Learning Compute, Azure Virtual Machines, and Azure Kubernetes Service. Defaults to false. |
tags
Required
|
Dictionary of key value tags to give this image |
properties
Required
|
Dictionary of key value properties to give this image. These properties cannot be changed after deployment, however new key value pairs can be added |
description
Required
|
A description to give this image |
base_image
Required
|
A custom image to be used as base image. If no base image is given then the base image will be used based off of given runtime parameter. |
base_image_registry
Required
|
Image registry that contains the base image. |
allow_absolute_path
Required
|
Flag to allow the absolute path |
cuda_version
Required
|
Version of CUDA to install for images that need GPU support. The GPU image must be used on Microsoft Azure Services such as Azure Container Instances, Azure Machine Learning Compute, Azure Virtual Machines, and Azure Kubernetes Service. Supported versions are 9.0, 9.1, and 10.0. If 'enable_gpu' is set, this defaults to '9.1'. |
Methods
build_create_payload |
Build the creation payload for the Container image. |
create_local_debug_payload |
Build the creation payload for the Container image. |
validate_configuration |
Check that the specified configuration values are valid. Raises a :class:azureml.exceptions.WebserviceException` if validation fails. |
build_create_payload
Build the creation payload for the Container image.
build_create_payload(workspace, name, model_ids)
Parameters
Name | Description |
---|---|
workspace
Required
|
The workspace object to create the image in. |
name
Required
|
The name of the image. |
model_ids
Required
|
A list of model IDs to package into the image. |
Returns
Type | Description |
---|---|
Container image creation payload. |
Exceptions
Type | Description |
---|---|
create_local_debug_payload
Build the creation payload for the Container image.
create_local_debug_payload(workspace, model_ids)
Parameters
Name | Description |
---|---|
workspace
Required
|
The workspace object to create the image in. |
model_ids
Required
|
A list of model IDs to package into the image. |
Returns
Type | Description |
---|---|
Container image creation payload. |
Exceptions
Type | Description |
---|---|
validate_configuration
Check that the specified configuration values are valid.
Raises a :class:azureml.exceptions.WebserviceException` if validation fails.
validate_configuration()
Exceptions
Type | Description |
---|---|