From e3a64b1f16e50ccd3da7fe68f9a312e6e4083b28 Mon Sep 17 00:00:00 2001 From: Sheri Gilley Date: Fri, 4 Jan 2019 12:51:11 -0600 Subject: [PATCH] code for remote vm --- .../how-to-set-up-training-targets/dsvm.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ignore/doc-qa/how-to-set-up-training-targets/dsvm.py diff --git a/ignore/doc-qa/how-to-set-up-training-targets/dsvm.py b/ignore/doc-qa/how-to-set-up-training-targets/dsvm.py new file mode 100644 index 00000000..7196cb98 --- /dev/null +++ b/ignore/doc-qa/how-to-set-up-training-targets/dsvm.py @@ -0,0 +1,28 @@ +# Code for Remote virtual machines + +compute_target_name = "attach-dsvm" + +# +import azureml.core +from azureml.core.runconfig import RunConfiguration, DEFAULT_CPU_IMAGE +from azureml.core.conda_dependencies import CondaDependencies + +run_dsvm = RunConfiguration(framework = "python") + +# Set the compute target to the Linux DSVM +run_dsvm.target = compute_target_name + +# Use Docker in the remote VM +run_dsvm.environment.docker.enabled = True + +# Use the CPU base image +# To use GPU in DSVM, you must also use the GPU base Docker image "azureml.core.runconfig.DEFAULT_GPU_IMAGE" +run_dsvm.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE +print('Base Docker image is:', run_dsvm.environment.docker.base_image) + +# Prepare the Docker and conda environment automatically when they're used for the first time +run_dsvm.prepare_environment = True + +# Specify the CondaDependencies object +run_dsvm.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn']) +# \ No newline at end of file