This tutorial page explains how to create a Jupyter Notebook environment through Jupyter Lab application following the below steps.
Generate RESTFul API Tokens¶
The Jupyter notebook environment in the present tutorial is used to run an IPython notebook from 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, one should generate RESTFul API tokens following the steps described in here.
Upload IPython Notebooks¶
Jupyter Notebook is started on the account Dropbox directory. This directory provides users with access to previously uploaded/created IPython notebooks. Here, 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 are uploaded to Dropbox to be later used inside the Jupyter notebook environment.
Create Jupyter Job¶
A simulation job is required to launch a Jupyter notebook. To create a new job, click on the Create Job link located on the left-hand Sidebar which takes you to the Job Designer page where you can configure Jupyter Notebook environment.
Jupyter Notebook installation and configuration is handled through the Jupyter Notebook workflow that should be imported from the Workflows Bank into the account-owned collection before the job is created. This workflow can later be selected and added to the job being created.
Adjust 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. Here, we install Exabyte API Client Python package to connect to Exabyte RESTFul API.
Access Jupyter Notebook¶
The Jupyter notebook can be accessed when the job is active by navigating to the workflow tab and opening the notebook unit. Wait for the Jupyter Notebook to start, as installation and configuration process takes some time, then click on the Notebook or Lab links to access the environment.
Do not use the URL Inside the Output File
Do not use the URL printed in the output file as the notebooks can not be accessed via printed URL for security reasons.
Save Jupyter Notebooks¶
Make sure 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 of the notebook inside checkpoints directory located in the job working directory. The checkpoints will be later accessible through the Job Files Explorer tab.
Stop Jupyter Environment¶
When don editing, the Jupyter Notebook environment can be stopped by either clicking the Quit button in Jupyter Notebook or terminating the job. In either case, make sure to save any changes you have made before stopping the notebook as unsaved changes will be lost otherwise.
Access Modified Files¶
As explained in the dedicated section the modified IPython files, as well as the checkpoints at each save, and the other files associated with the job can be accessed from the Dropbox folder, the job and through command-line.
We demonstrate the steps mentioned above in the animation below.