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
This article describes how to set up a template virtual machine (VM) in Azure Lab Services that includes tools for teaching students to use Jupyter Notebooks. You also learn how lab users can connect to notebooks on their virtual machines.
17
18
18
-
This article outlines how to set up a [template virtual machine (VM)](./classroom-labs-concepts.md#template-virtual-machine) in Azure Lab Services with the tools for teaching students to use Jupyter Notebooks. You also learn how to lab users can connect to notebooks on their virtual machines.
19
+
Jupyter Notebooks is an open-source project that enables you to easily combine rich text and executable Python source code on a single canvas, known as a *notebook*. Run a notebook to create a linear record of inputs and outputs. Those outputs can include text, tables of information, scatter plots, and more.
19
20
20
-
[Jupyter Notebooks](https://jupyter-notebook.readthedocs.io/) is an open-source project that enables you to easily combine rich text and executable Python source code on a single canvas, known as a notebook. Running a notebook results in a linear record of inputs and outputs. Those outputs can include text, tables of information, scatter plots, and more.
[!INCLUDE [must have subscription](./includes/lab-services-class-type-subscription.md)]
25
+
-[!INCLUDE [must have subscription](./includes/lab-services-class-type-subscription.md)]
25
26
26
-
### Lab plan settings
27
+
##Configure lab plan settings
27
28
28
29
[!INCLUDE [must have lab plan](./includes/lab-services-class-type-lab-plan.md)]
29
30
30
-
This lab uses one of the Data Science Virtual Machine Azure Marketplace images as the base VM image. You first need to enable these images in your lab plan. This lets lab creators then select the image as a base image for their lab.
31
+
This lab uses one of the Data Science Virtual Machine images as the base VM image. These images are available in Azure Marketplace. This option lets lab creators then select the image as a base image for their lab. You need to enable these images in your lab plan.
32
+
33
+
Follow these steps to [enable these Azure Marketplace images available to lab creators](specify-marketplace-images.md).
31
34
32
-
1. Follow these steps to [enable these Azure Marketplace images available to lab creators](specify-marketplace-images.md). Select one of the following Azure Marketplace images, depending on your OS requirements:
35
+
- Select one of the following Azure Marketplace images, depending on your operating system requirements:
33
36
34
-
-**Data Science Virtual Machine – Windows Server 2019**
35
-
-**Data Science Virtual Machine – Ubuntu 18.04**
36
-
37
-
1. Alternately, create a custom VM image:
37
+
-**Data Science Virtual Machine – Windows Server 2019/Windows Server 2022**
38
+
-**Data Science Virtual Machine – Ubuntu 20.04**
38
39
39
-
The Data Science VMs images in the Azure Marketplace are already configured with Jupyter Notebooks. These images, however, also include many other development and modeling tools for data science. If you don't want those extra tools and want a lightweight setup with only Jupyter notebooks, create a custom VM image. For an example, [Installing JupyterHub on Azure](http://tljh.jupyter.org/en/latest/install/azure.html).
40
+
- Alternately, create a custom VM image:
40
41
41
-
After you create the custom image, upload the image to a compute gallery to use it with Azure Lab Services. Learn more about [using compute gallery in Azure Lab Services](how-to-attach-detach-shared-image-gallery.md).
42
+
The Data Science VM images in the Azure Marketplace are already configured with [Jupyter Notebooks](https://jupyter-notebook.readthedocs.io/). These images also include other development and modeling tools for data science. If you don't need those extra tools and want a lightweight setup with only Jupyter notebooks, create a custom VM image. For an example, see [Installing JupyterHub on Azure](http://tljh.jupyter.org/en/latest/install/azure.html).
42
43
43
-
### Lab settings
44
+
After you create the custom image, upload the image to a compute gallery to use it with Azure Lab Services. Learn more about [using compute gallery in Azure Lab Services](how-to-attach-detach-shared-image-gallery.md).
44
45
45
-
1. Create a lab for your lab plan:
46
+
##Create a lab
46
47
47
-
[!INCLUDE [create lab](./includes/lab-services-class-type-lab.md)] Specify the following lab settings:
48
+
- Create a lab for your lab plan:
48
49
49
-
| Lab settings | Value |
50
-
| ------------ | ------------------ |
51
-
| Virtual machine size | Select **Small** or **Medium** for a basic setup accessing Jupyter Notebooks. Select **Alternative Small GPU (Compute)** for compute-intensive and network-intensive applications used in Artificial Intelligence and Deep Learning classes. |
52
-
| Virtual machine image | Choose **[Data Science Virtual Machine – Windows Server 2019](https://azuremarketplace.microsoft.com/marketplace/apps/microsoft-dsvm.dsvm-win-2019)** or **[Data Science Virtual Machine – Ubuntu](https://azuremarketplace.microsoft.com/marketplace/apps?search=Data%20science%20Virtual%20machine&page=1&filters=microsoft%3Blinux)** depending on your OS needs. |
[!INCLUDE [create lab](./includes/lab-services-class-type-lab.md)] Specify the following lab settings:
54
51
55
-
1. When you create a lab with the **Alternative Small GPU (Compute)** size, follow these steps to [install GPU drivers](./how-to-setup-lab-gpu.md#ensure-that-the-appropriate-gpu-drivers-are-installed).
52
+
| Lab settings | Value |
53
+
| ------------ | ------------------ |
54
+
| Virtual machine size | Select **Small** or **Medium** for a basic setup to access Jupyter Notebooks. Select **Alternative Small GPU (Compute)** for compute-intensive and network-intensive applications used in Artificial Intelligence and Deep Learning classes. |
55
+
| Virtual machine image | Choose [Data Science Virtual Machine – Windows Server 2019](https://azuremarketplace.microsoft.com/marketplace/apps/microsoft-dsvm.dsvm-win-2019), [Data Science Virtual Machine – Windows Server 2022](https://azuremarketplace.microsoft.com/marketplace/apps/microsoft-dsvm.dsvm-win-2022), or [Data Science Virtual Machine – Ubuntu](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/microsoft-dsvm.ubuntu-2004). |
These process installs recent NVIDIA drivers and the Compute Unified Device Architecture (CUDA) toolkit, which you need to enable high-performance computing with the GPU. For more information, see [Set up a lab with GPU virtual machines](./how-to-setup-lab-gpu.md).
58
+
- When you create a lab with the **Alternative Small GPU (Compute)** size, [install GPU drivers](./how-to-setup-lab-gpu.md#ensure-that-the-appropriate-gpu-drivers-are-installed).
58
59
59
-
## Template machine configuration
60
+
This process installs recent NVIDIA drivers and the Compute Unified Device Architecture (CUDA) toolkit, which you need to enable high-performance computing with the GPU. For more information, see [Set up a lab with GPU virtual machines](./how-to-setup-lab-gpu.md).
The Data Science VM images come with many of data science frameworks and tools required for this type of class. For example, the images include:
64
67
65
-
-[Jupyter Notebooks](http://jupyter-notebook.readthedocs.io/): A web application that allows data scientists to take raw data, run computations, and see the results all in the same environment. It runs locally in the template VM.
68
+
-[Jupyter Notebooks](http://jupyter-notebook.readthedocs.io/): A web application that allows data scientists to take raw data, run computations, and see the results in the same environment. It runs locally in the template VM.
66
69
-[Visual Studio Code](https://code.visualstudio.com/): An integrated development environment (IDE) that provides a rich interactive experience when writing and testing a notebook. For more information, see [Working with Jupyter Notebooks in Visual Studio Code](https://code.visualstudio.com/docs/python/jupyter-support).
67
70
68
-
The **Data Science Virtual Machine – Ubuntu** image is already provisioned with X2GO server to enable lab users to use a graphical desktop experience.
71
+
The **Data Science Virtual Machine – Ubuntu** image is provisioned with X2Go server to enable lab users to use a graphical desktop experience.
69
72
70
73
### Enabling tools to use GPUs
71
74
@@ -80,7 +83,7 @@ from tensorflow.python.client import device_lib
80
83
print(device_lib.list_local_devices())
81
84
```
82
85
83
-
If the output from the above code looks like the following, TensorFlow isn't using the GPU:
86
+
If the output from this code looks like the following result, TensorFlow isn't using the GPU:
Continuing with the above example, see [TensorFlow GPU Support](https://www.tensorflow.org/install/gpu) for guidance. TensorFlow guidance covers:
98
+
Continuing with this example, see [TensorFlow GPU Support](https://www.tensorflow.org/install/gpu) for guidance. TensorFlow guidance covers:
96
99
97
100
- Required version of the [NVIDIA drivers](https://www.nvidia.com/drivers)
98
-
- Required version of the [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit-archive).
99
-
- Instructions to install [NVIDIA CUDA Deep Neural Network library (cudDNN)](https://developer.nvidia.com/cudnn).
101
+
- Required version of the [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit-archive)
102
+
- Instructions to install [NVIDIA CUDA Deep Neural Network library (cudDNN)](https://developer.nvidia.com/cudnn)
100
103
101
-
After you've followed TensorFlow's steps to configure the GPU, when you rerun the test code, you should see output similar to the following output.
104
+
After you follow TensorFlow's steps to configure the GPU, when you rerun the test code, you should see results similar to the following output.
102
105
103
106
```python
104
107
[name: "/device:CPU:0"
@@ -120,15 +123,15 @@ physical_device_desc: "device: 0, name: NVIDIA Tesla K80, pci bus id: 0001:00:00
120
123
]
121
124
```
122
125
123
-
###Provide notebooks for the class
126
+
## Provide notebooks for the class
124
127
125
128
The next task is to provide lab users with notebooks that you want them to use. You can save notebooks locally on the template VM so each lab user has their own copy.
126
129
127
130
If you want to use sample notebooks from Azure Machine Learning, see [how to configure an environment with Jupyter Notebooks](/azure/machine-learning/how-to-configure-environment#jupyter-notebooks).
128
131
129
132
### Publish the template machine
130
133
131
-
You make the lab VM available for lab users, you have to[publish the template](how-to-create-manage-template.md#publish-the-template-vm). The lab VM has all the local tools and notebooks that you configured previously.
134
+
To make the lab VM available for lab users, [publish the template](how-to-create-manage-template.md#publish-the-template-vm). The lab VM has all the local tools and notebooks that you configured previously.
132
135
133
136
## Connect to Jupyter Notebooks
134
137
@@ -144,65 +147,63 @@ If you use a Linux-based lab VM, lab users can connect to their lab VMs through
144
147
145
148
### SSH tunnel to Jupyter server on the VM
146
149
147
-
For Linux-based labs, you can also connect directly from your local computer to the Jupyter server inside the lab VM. The SSH protocol enables port forwarding between the local computer and a remote server (in our case, the user's lab VM). An application that is running on a certain port on the server is **tunneled** to the mapping port on the local computer.
150
+
For Linux-based labs, you can also connect directly from your local computer to the Jupyter server inside the lab VM. The SSH protocol enables port forwarding between the local computer and a remote server. This is the user's lab VM. An application that runs on a certain port on the server is *tunneled* to the mapping port on the local computer.
148
151
149
152
Follow these steps to configure an SSH tunnel between a user's local machine and the Jupyter server on the lab VM:
150
153
151
-
1. Go to the [Azure Lab Services website](https://labs.azure.com)
154
+
1. Go to the [Azure Lab Services website](https://labs.azure.com).
152
155
153
156
1. Verify that the Linux-based [lab VM is running](how-to-use-lab.md#start-or-stop-the-vm).
154
157
155
158
1. Select the **Connect** icon > **Connect via SSH** to get the SSH connection command.
156
159
157
-
The SSH connection command looks like the following:
160
+
The SSH connection command looks like the following example:
Learn more about [how to connect to a Linux VM](connect-virtual-machine.md#connect-to-a-linux-lab-vm-using-ssh).
164
167
165
-
1. On your local computer, launch a terminal or command prompt, and copy the SSH connection string to it. Then, add `-L 8888:localhost:8888` to the command string, which creates the **tunnel** between the ports.
168
+
1. On your local computer, launch a terminal or command prompt, and copy the SSH connection string to it. Then, add `-L 8888:localhost:8888` to the command string, which creates the tunnel between the ports.
166
169
167
-
The final command should look as follows:
170
+
The final command should look like the following example.
1. Paste this URL into a browser on your local computer to connect and work on your Jupyter Notebook.
190
+
1. To connect to your Jupyter Notebook and work on it, paste this URL into a browser on your local computer.
188
191
189
192
> [!NOTE]
190
193
> Visual Studio Code also enables a great [Jupyter Notebook editing experience](https://code.visualstudio.com/docs/python/jupyter-support). You can follow the instructions on [how to connect to a remote Jupyter server](https://code.visualstudio.com/docs/python/jupyter-support#_connect-to-a-remote-jupyter-server) and use the same URL from the previous step to connect from VS Code instead of from the browser.
191
194
192
-
## Cost estimate
195
+
## Estimate cost
193
196
194
-
This section provides a cost estimate forrunning this class for 25 lab users. There are 20 hours of scheduled class time. Also, each user gets 10 hours quota for homework or assignments outside scheduled class time. The VM size we chose was alternative small GPU (compute), which is 139 lab units. If you want to use the Small (20 lab units) or Medium size (42 lab units), you can replace the lab unit partin the equation below with the correct number.
197
+
This section provides a cost estimate forrunning this class for 25 lab users. There are 20 hours of scheduled class time. Also, each user gets 10 hours quota for homework or assignments outside scheduled class time. The VM size chosen was alternative small GPU (compute), which is 139 lab units. If you want to use the Small (20 lab units) or Medium size (42 lab units), you can replace the lab unit partin the equation here with the correct number.
195
198
196
199
Here's an example of a possible cost estimate for this class:
>This cost estimate is for example purposes only. For current details on pricing, see [Azure Lab Services Pricing](https://azure.microsoft.com/pricing/details/lab-services/).
201
204
202
-
## Conclusion
205
+
## Related content
203
206
204
207
In this article, you learned how to create a lab for a Jupyter Notebooks class and how user can connect to their notebooks on the lab VM. You can use a similar setup for other machine learning classes.
205
208
206
-
## Next steps
207
-
208
209
[!INCLUDE [next steps for class types](./includes/lab-services-class-type-next-steps.md)]
0 commit comments