Skip to main content

Running a Jupyter Notebook

This page focuses on the Jupyter workflow, which enables you to run and manage Jupyter Notebooks.

After adding the Jupyter Notebook Server workflow and favoriting it, click its card on the Compute page.

j_notebook_1_nov23.png

You’ll be taken to the workflow’s configuration page.

Navigate to the Jupyter Server Host section. The settings here depend on where you're running the workflow: in your user container, on a controller node, or on a compute node.

About Resources

Running an interactive session on a controller or compute node requires a running resource. If you plan to run an interactive session in your PW user workspace, you do not have to have a resource running.

Use the Service Host dropdown menu to choose where the workflow will be hosted. Select User Workspace.

Use the Select… dropdown menu to choose how the job will be submitted. Select PW USER CONTAINER.

j_notebook_2_nov23.png

Click Execute.

j_notebook_3_nov23.png

You’ll be taken to your workflow’s configuration page. In the Workflow Monitor module, click the View icon.

j_notebook_8_nov23.png

You may see a page with the message Validating URL before the page loads. If you see the message for more than 30 seconds, you can refresh the page.

On the Jupyter page, click the untitled.ipynb file.

j_notebook_9_nov23.png

Your Jupyter Notebook will open in a new tab. You can browse files, create a new Notebook, or double-click on an existing Notebook within your /pw file system.

j_notebook_10_nov23.png

Enter !hostname to confirm where the Notebook is running. The ! tells Jupyter to execute the hostname command in the shell of the underlying operating system.

Click Run.

j_notebook_11_nov23.png

The Notebook will generate a new line with the output pw_user_<your_user_id>, which is the same hostname displayed in your PW IDE terminal.

j_notebook_12_nov23.png

Now you can use the Jupyter Notebook for anything. Please be sure to end the workflow when you're finished by navigating to your Home page or Workflows page and clicking the Cancel icon.

j_notebook_13_nov23.png

About Kernels

You can connect a running Jupyter Notebook to a kernel (i.e., execution engine) in a different Conda environment. To see your available kernels, click Kernel > Change kernel in the Jupyter banner.