Skip to content

Jupyter Notebook

This tutorial explains how to create a Jupyter Notebook environment through the Jupyter Lab application.

1. Generate RESTful API tokens

The Jupyter notebook environment in this tutorial is used to run an IPython notebook from the Exabyte API Examples Repository in which a connection is made to the RESTful API to retrieve a list of materials. In order to establish the connection, RESTful API tokens must be generated following the steps described here.

2. Upload IPython notebooks

Jupyter Notebook is started on the account Dropbox directory. This directory provides access to previously uploaded or created IPython notebooks. The settings.py file contains the variables required to configure the RESTful API endpoints, and get_materials_by_formula.ipynb from the Exabyte API Examples GitHub Repository should be uploaded to Dropbox for later use inside the Jupyter notebook environment.

3. Create the Jupyter job

A simulation job is required to launch a Jupyter notebook. Click the Create Job link on the left-hand Sidebar to open the Job Designer page.

4. Select the workflow

The Jupyter Notebook workflow should be imported from the Workflows Bank into the account-owned collection before the job is created. This workflow can then be selected and added to the job being created.

5. Adjust the Jupyter Notebook environment

Jupyter Notebook is installed inside a Python virtual environment with no additional packages initially. The environment can be customized by navigating to the workflow tab and adjusting the configure.sh script located inside the notebook unit. In this example, the Exabyte API Client Python package is installed to connect to the RESTful API.

6. Submit the job

Before submitting the job, click the Compute tab of Job Designer to inspect the compute parameters.

7. Access the Jupyter Notebook

The Jupyter notebook can be accessed when the job is active by navigating to the workflow tab and opening the notebook unit. After the installation and configuration process completes, click the Notebook or Lab links to access the environment.

Do not use the URL inside the output file

The URL printed in the output file cannot be used, as notebooks are not accessible via that URL for security reasons.

8. Save Jupyter notebooks

It is essential to save and checkpoint the notebook after introducing any changes. The "save and checkpoint" Jupyter action overwrites the original notebook loaded from Dropbox and saves a copy inside the checkpoints directory located in the job working directory. The checkpoints are later accessible through the Job Files Explorer tab.

9. Stop the Jupyter environment

When editing is complete, the Jupyter Notebook environment can be stopped by either clicking the Quit button in Jupyter Notebook or terminating the job. Any unsaved changes are lost when the notebook is stopped.

10. Access modified files

As explained in the dedicated section, the modified IPython files, checkpoints at each save, and other files associated with the job can be accessed from the Dropbox folder, the job, and through the command-line.

11. Video walkthrough

The animation below demonstrates all steps described above.