I use Microsoft Azure Machine Learning (Azure-ml) to run my (python) experiments.
For specifying the VM and python environment I use:
from azureml.core import Environment
from azureml.core import ScriptRunConfig
# Other imports and code...
# Specify VM and Python environment:
vm_env = Environment.from_conda_specification(name='my-test-env', file_path=PATH_TO_YAML_FILE)
vm_env.docker.enabled = True
vm_env.docker.base_image = 'mcr.microsoft.com/azureml/openmpi3.1.2-cuda10.2-cudnn7-ubuntu18.04'
# Finally, use the environment in the ScriptRunConfig:
src = ScriptRunConfig(source_directory=DEPLOY_CONTAINER_FOLDER_PATH,
script=SCRIPT_FILE_TO_EXECUTE,
arguments=EXECUTE_ARGUMENTS,
compute_target=compute_target,
environment=vm_env)
I get the following warning for the line vm_env.docker.enabled = True
:
'enabled' is deprecated. Please use the azureml.core.runconfig.DockerConfiguration object with the 'use_docker' param instead.
The documentation about the DockerSection Class
and DockerConfiguration Class
is not very clear about applying the DockerConfiguration Class
.
I can't figure out how to use the azureml.core.runconfig.DockerConfiguration
object. Can someone provide me with an example? Thank you!