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 Home page.

Screenshot of the user clicking the Jupyter Notebook Server workflow on the Home page.

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 ACTIVATE 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 Controller... dropdown menu to choose how the job will be submitted. Select PW USER CONTAINER.

Screenshot of the user selecting the service host and controller.

Click Execute.

Screenshot of the user clicking Execute.

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

Screenshot of the user clicking the View icon.

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.

Screenshot of the user clicking the Jupyter file.

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

Screenshot of the user clicking the Cancel icon.

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.