Introduction
Overview
Teaching: 10 min
Exercises: 5 minQuestions
Why would I want to use the Jefferson Lab Jupyter server?
How can I access the Jefferson Lab Jupyter server?
Objectives
Explain the benefits of using the centralized server.
Create a new Jupyter notebook with the Python 3 kernel.
Using the Jefferson Lab Jupyter server for centralized analysis
You may be familiar with the benefits of using python, IPython, or Jupyter notebooks on your local computer, whether that is a laptop or a desktop computer at your institutions. This may appear as a sufficient solution to you.
Why would you want to use a centralized Jupyter server for storing your notebooks?
What are the benefits and disadvantages of a centralized approach?
Take a few minutes to list the benefits and disadvantages that you see at this point to using a centralized server. Consider both your own convenience as well as the point of view of others with whom you are collaborating.
If you have the opportunity to talk to another Jupyter user about your list, compare and explain why you may have listed things that the other person has not listed.
Solution
Accessing the Jefferson Lab Jupyter server
You can access the Jefferson Lab Jupyter server at jupyter.jlab.org. You will be asked to log in with your Jefferson Lab username and password.
As with a locally running instance of a Jupyter Notebook, you will at first reach your Jupyter Notebook file tree. When you log in for the first time, this file tree will be empty.
Creating notebooks on the Jefferson Lab Jupyter server
We can create blank notebooks by using the “New” button on the top right of the file tree window. There are several kernel options available:
- Python 2 Notebook
- Python 3 Notebook
- Text File
- Folder
- Terminal
More kernel options listed?
It is possible that in the future more kernels will be added to the Jupyter server to allow anything from interactive ROOT C++ notebooks to R notebooks. There are currently more than 50 different kernels supported by the Jupyter server.
Different interface?
It is also possible that the server will be upgraded to the new Jupyter Lab interface which will appear familiar to users of IDEs or analysis studios (such as RStudio or even Matlab).
Let’s practice using the server to create a new python 3 notebook.
For this lesson we will exclusively use python 3. Most functionality on the Jefferson Lab Jupyter server should be equivalent between python 2 and python 3. The system administrators have been attempting to keep the same set of packages installed for both python versions, to the extent possible
Create your first notebook on the Jefferson Lab Jupyter server!
Log in to the Jefferson Lab Jupyter server at jupyter.jlab.org and perform the following actions:
- Create a new directory called
tutorial
- Create a new Python 3 Notebook in the directory
tutorial
- Change the name of the Notebook to
python3-intro
- Add the following cells of code, and execute them with Shift-Enter:
import sys print(sys.version) !pip list
Solution
Uploading Jupyter Notebooks to the Jefferson Lab Jupyter server
To get started with the tutorial, we will be uploading Jupyter Notebooks from a GitHub repository at github.com/JeffersonLab/jupyter_tutorial.
You can upload multiple files at once by selecting them in the upload dialog. You will need to confirm the files individually before they will be uploaded.
Upload sample notebooks on the Jefferson Lab Jupyter server
Log in to the Jefferson Lab Jupyter server at jupyter.jlab.org and perform the following actions:
- Download the sample Jupyter notebooks in the jupyter_tutorial GitHub repository
- Extract the file on your local computer
- Upload only the files from the
1_Basics
directory into the tutorial directory on the Jupyter server
Git clone the sample notebooks on the Jefferson Lab Jupyter server
Log in to the Jefferson Lab interactive farm node and navigate to
/group/jupyterusers/$USER
and perform the following actions:
- Clone the jupyter_tutorial GitHub repository
git clone https://github.com/JeffersonLab/jupyter_tutorial
A word of caution: What the Jupyter server at Jefferson Lab is NOT!
The Jupyter server at Jefferson Lab should be treated in the same way as an interactive farm node: it is a shared resource that can be access by a large number of users at any given time. It is not a computational cluster.
Work that is suitable for use on the Jupyter server should be limited to:
- visualization of analysis result: plotting, etc…
- prototyping of analysis steps, with as ultimate goal the submission to a batch farm node (more on that later).
Just as with the interactive farm nodes, there are maximum CPU and memory usage limits in place. Your Jupyter kernel may get killed if it is using too much resources (or at least it will get re-niced to run with lower priority). Abuse of this system, just as with the interactive farm nodes, is likely to lead to revocation of use privileges.
Key Points
Access Jefferson Lab’s Jupyter server at jupyter.jlab.org.