Skip to content

Commit 35cebec

Browse files
authored
Merge pull request #268702 from TimShererWithAquent/us194307d
Freshness Pass 194290 (fourth PR):
2 parents 1661f55 + 1572778 commit 35cebec

File tree

6 files changed

+161
-146
lines changed

6 files changed

+161
-146
lines changed

articles/lab-services/class-type-jupyter-notebook.md

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,67 +5,70 @@ description: Learn how to set up a lab VM in Azure Lab Services to teach data sc
55
services: lab-services
66
ms.service: lab-services
77
ms.custom: devx-track-python
8-
author: ntrogh
9-
ms.author: nicktrog
8+
author: RoseHJM
9+
ms.author: rosemalcolm
1010
ms.topic: how-to
11-
ms.date: 02/17/2023
11+
ms.date: 03/12/2024
12+
#customer intent: As an educator, I want to configure a lab using Azure Lab Services so that students can practice with Jupyter Notebooks.
1213
---
1314

1415
# Set up a lab to teach data science with Python and Jupyter Notebooks
1516

16-
[!INCLUDE [preview note](./includes/lab-services-new-update-focused-article.md)]
17+
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.
1718

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.
1920

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.
21+
[!INCLUDE [preview note](./includes/lab-services-new-update-focused-article.md)]
2122

22-
## Lab configuration
23+
## Prerequisites
2324

24-
[!INCLUDE [must have subscription](./includes/lab-services-class-type-subscription.md)]
25+
- [!INCLUDE [must have subscription](./includes/lab-services-class-type-subscription.md)]
2526

26-
### Lab plan settings
27+
## Configure lab plan settings
2728

2829
[!INCLUDE [must have lab plan](./includes/lab-services-class-type-lab-plan.md)]
2930

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).
3134

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:
3336

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**
3839

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:
4041

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).
4243

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).
4445

45-
1. Create a lab for your lab plan:
46+
## Create a lab
4647

47-
[!INCLUDE [create lab](./includes/lab-services-class-type-lab.md)] Specify the following lab settings:
48+
- Create a lab for your lab plan:
4849

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. |
53-
| Template virtual machine settings | Select **Use virtual machine without customization.**.
50+
[!INCLUDE [create lab](./includes/lab-services-class-type-lab.md)] Specify the following lab settings:
5451

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). |
56+
| Template virtual machine settings | Select **Use virtual machine without customization.** |
5657

57-
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).
5859

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).
61+
62+
### Template machine configuration
6063

6164
[!INCLUDE [configure template vm](./includes/lab-services-class-type-template-vm.md)]
6265

6366
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:
6467

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.
6669
- [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).
6770

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.
6972

7073
### Enabling tools to use GPUs
7174

@@ -80,7 +83,7 @@ from tensorflow.python.client import device_lib
8083
print(device_lib.list_local_devices())
8184
```
8285

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:
8487

8588
```python
8689
[name: "/device:CPU:0"
@@ -92,13 +95,13 @@ incarnation: 15833696144144374634
9295
]
9396
```
9497

95-
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:
9699

97100
- 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)
100103

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.
102105

103106
```python
104107
[name: "/device:CPU:0"
@@ -120,15 +123,15 @@ physical_device_desc: "device: 0, name: NVIDIA Tesla K80, pci bus id: 0001:00:00
120123
]
121124
```
122125

123-
### Provide notebooks for the class
126+
## Provide notebooks for the class
124127

125128
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.
126129

127130
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).
128131

129132
### Publish the template machine
130133

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.
132135

133136
## Connect to Jupyter Notebooks
134137

@@ -144,65 +147,63 @@ If you use a Linux-based lab VM, lab users can connect to their lab VMs through
144147

145148
### SSH tunnel to Jupyter server on the VM
146149

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.
148151

149152
Follow these steps to configure an SSH tunnel between a user's local machine and the Jupyter server on the lab VM:
150153

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).
152155

153156
1. Verify that the Linux-based [lab VM is running](how-to-use-lab.md#start-or-stop-the-vm).
154157

155158
1. Select the **Connect** icon > **Connect via SSH** to get the SSH connection command.
156159

157-
The SSH connection command looks like the following:
160+
The SSH connection command looks like the following example:
158161

159162
```shell
160163
ssh -p 12345 student@ml-lab-00000000-0000-0000-0000-000000000000.eastus2.cloudapp.azure.com
161164
```
162165

163166
Learn more about [how to connect to a Linux VM](connect-virtual-machine.md#connect-to-a-linux-lab-vm-using-ssh).
164167

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.
166169

167-
The final command should look as follows:
170+
The final command should look like the following example.
168171

169172
```shell
170173
ssh –L 8888:localhost:8888 -p 12345 student@ml-lab-00000000-0000-0000-0000-000000000000.eastus.cloudapp.azure.com
171174
```
172175

173-
1. Press **ENTER** to run the command.
176+
1. Press **Enter** to run the command.
174177
1. When prompted, provide the lab VM password to connect to the lab VM.
175-
1. When you’re connected to the VM, start the Jupyter server using this command:
178+
1. When you connect to the VM, start the Jupyter server using this command:
176179

177180
```bash
178181
jupyter notebook
179182
```
180183

181-
The command outputs a URL for the Jupyter server in the terminal. The URL should look like:
184+
The command outputs a URL for the Jupyter server in the terminal. The URL should look like this example:
182185

183186
```output
184187
http://localhost:8888/?token=8c09ecfc93e6a8cbedf9c66dffdae19670a64acc1d37
185188
```
186189

187-
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.
188191

189192
> [!NOTE]
190193
> 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.
191194

192-
## Cost estimate
195+
## Estimate cost
193196

194-
This section provides a cost estimate for running 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 part in the equation below with the correct number.
197+
This section provides a cost estimate for running 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 part in the equation here with the correct number.
195198

196199
Here's an example of a possible cost estimate for this class:
197-
25 lab users \* (20 scheduled hours + 10 quota hours) \* 139 lab units \* 0.01 USD per hour = 1042.5 USD
200+
`25 lab users * (20 scheduled hours + 10 quota hours) * 139 lab units * 0.01 USD per hour = 1042.5 USD`.
198201
199202
>[!IMPORTANT]
200203
>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/).
201204
202-
## Conclusion
205+
## Related content
203206
204207
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.
205208
206-
## Next steps
207-
208209
[!INCLUDE [next steps for class types](./includes/lab-services-class-type-next-steps.md)]

0 commit comments

Comments
 (0)