Using JupyterLab¶
About JupyterLab¶
Jupyter is a popular open source web application by Project Jupyter for interactive computing across dozens of languages, including Python, Julia, and R. It comes in two flavors, the classic Jupyter Notebook and the next generation JupyterLab. ARC currently provides both applications via a graphical interface using software called Open OnDemand. Uses include data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.
JupyterLab is a web-based interactive development environment for Jupyter notebooks, code, and data. JupyterLab is the next-generation user interface for Project Jupyter offering all the familiar building blocks of the classic Jupyter Notebook (notebook, terminal, text editor, file browser, rich outputs, etc.) in a flexible and a more powerful user interface. It has a modular structure, where you can open several notebooks or files (e.g. HTML, Text, Markdowns etc) as tabs in the same window. JupyterLab provides flexible building blocks ideal for interactive, exploratory computing. JupyterLab will eventually replace the classic Jupyter Notebook.
Accessing JupyterLab¶
JupyterLab is available to ARC users as an applications in Open OnDemand. This service is a way for users to access to their HPC resources via a web interface. For detailed information about using Open OnDemand please see Using Open OnDemand.
After logging into Open OnDemand, select JupyterLab from the Interactive Apps menu at the top. Complete the form fields. If you have previously installed additional kernels (see below) or libraries that you wish to use, be sure that you select the same version of Python Anaconda that you used during installation. After completing the form, click the Launch button at the bottom. When your job is ready, click the "Connect to Jupyter" button. You should now find Python available as an option on the Launcher tab. If you have installed other kernels (e.g. R), they will show up along with Python.
The kernel¶
A kernel executes the code contained in a Notebook document. The ipython kernel executes python code. Kernels for many other languages exist. When you open a Notebook document, the associated kernel is automatically launched. When the notebook is executed (either cell-by-cell or with menu Cell -> Run All), the kernel performs the computation and produces the results.
The Jupyter apps available via ARC's web interface only provide the iPython kernel. However, you may install additional kernels for your personal use. Please see, Installing the R kernel for instructions.
Ending your JupyterLab Open OnDemand session¶
To ensure you do not incur unnecessary charges on your slurm account,
there are specific steps to follow in order to end your slurm job when
you are finished using JupyterLab. Otherwise, the job will remain
active, and you will contine to accrue charges until the amount of
time you specified when initiating the job has expired. As with all
sessions of the Open OnDemand web interface, the surefire way to avoid
incurring charges for unused resources when you are finished with a
session is to kill that job by using the red Delete
button on the
"My Interactive Sessions" tab. A pop-up window will appear; press
Confirm
to delete the session.
Delete JupyterLab from the "My Interactive Sessions" tab to stop charges when you are done using the app.
If you wish to end your slurm job from within the JupyterLab app,
select File
-->Shut Down
from the menu in the top left-hand side of
the tab holding your JupyterLab session. Click the Shut Down
button
again on the pop-up window when you are asked for confirmation. This
will shut down JupyterLab and kill the interactive session running on
the compute nodes.
Alternatively, select File
-->Shutdown
from within JupyterLab to stop charges when you are done using the app.
After selecting Shut Down
, if you return to the "My Interactive
Sessions" page, you will see that the box for the Jupyter session now
says "Completed" in the top right corner and a message at the bottom
of the box states "Batch Connect Sessions Status Completed." Note,
there may be a brief delay after ending the session by Shutting Down
JupyterLab before the status is updated in the panel of the "My
Interactive Sessions" tab. Your slurm job has ended and you are no
longer being charged for that job. You may click the red Delete
button if you wish to clear it from the "My Interactive Sessions"
page. It is important to note that even if you log out of OnDemand or
close all tabs, unless you delete or end those sessions as indicated
they will continue to run (incurring cost) until the hours you have
allocated for the session have run out.
The job will show as Completed
in the "My Interactive Sessions" tab when you have successfully ended the slurm job. You are no longer being charged for that job.