Skip to content

Commit e3a64b1

Browse files
committed
code for remote vm
1 parent 732eecf commit e3a64b1

File tree

1 file changed

+28
-0
lines changed
  • ignore/doc-qa/how-to-set-up-training-targets

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Code for Remote virtual machines
2+
3+
compute_target_name = "attach-dsvm"
4+
5+
#<run_dsvm>
6+
import azureml.core
7+
from azureml.core.runconfig import RunConfiguration, DEFAULT_CPU_IMAGE
8+
from azureml.core.conda_dependencies import CondaDependencies
9+
10+
run_dsvm = RunConfiguration(framework = "python")
11+
12+
# Set the compute target to the Linux DSVM
13+
run_dsvm.target = compute_target_name
14+
15+
# Use Docker in the remote VM
16+
run_dsvm.environment.docker.enabled = True
17+
18+
# Use the CPU base image
19+
# To use GPU in DSVM, you must also use the GPU base Docker image "azureml.core.runconfig.DEFAULT_GPU_IMAGE"
20+
run_dsvm.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE
21+
print('Base Docker image is:', run_dsvm.environment.docker.base_image)
22+
23+
# Prepare the Docker and conda environment automatically when they're used for the first time
24+
run_dsvm.prepare_environment = True
25+
26+
# Specify the CondaDependencies object
27+
run_dsvm.environment.python.conda_dependencies = CondaDependencies.create(conda_packages=['scikit-learn'])
28+
#</run_dsvm>

0 commit comments

Comments
 (0)