Page tree


We have a JupyterHub instance on which is reachable from worldwide IP ranges, not just the DESY network.
In order to use the JupyterHub you need a NAF account, see Getting a NAF account for details.

Starting Jupyter

To start a Jupyter Job on the NAF JupyterHub, login with your DESY credentials and select Job options like your primary group and whether 
you wish to use a GPU slot.

You then need to wait until HTCondor starts your jupyter job and the notebook server is spawned. 
This takesabout 20, so don't be too impatient.

Once your server starts you see your AFS $HOME and can start a new Notebook by clicking on the "New" → "Notebook" → "Python 3"

Welcome PageSpawn Options

Spawn PendingThe main Notebook View

ROOT Notebooks

We have ROOT installed on the Batch nodes. To use the Python bindings, simply

import ROOT

in a Python3 Notebook . Or Select the ROOT C++ Kernel directly from the dropdown menu.
For more information, see the official ROOT documentation

JupyterLab User Extensions

If users want to use their own extensions they need to build jupyter lab in their HOME directory.
Execute the following command from a jupyter session terminal (new → Terminal)

jupyter lab build --app-dir=.local/share/jupyter/lab

Then selecting "JupyterLab with user extensions" on the Jupyter Spawn options page will launch jutyerlab from your 
$HOME directory and user extensions can be added.

Using Python Virtualenvs

It is recommended to use virtualenv for your environment.
To install a new virtualenv wiht the desired $NAME in your AFS home open a terminal ("New" → "Terminal") 
and run the following command:

python3 -m venv ~/$NAME

And to add the virtualenv to your jupyter notebook session first activate the virtualenv and install the ipython kernel

source ~/${NAME}/bin/activate

pip install ipykernel

ipython kernel install --user --name=${DISPLAY-NAME}

Where ${DISPLAY-NAME} is the text you want to appear in the jupyter notebook selection menu,
it does not have to be the same as <NAME>

You can now start jupyter notebooks with the virtualenv kernel

Error Handling

Our current implementation of the JupyterHub is not perfect, here are the errors 
we are aware of and what to do about them.

Timout during Spawn

if the spawn of the server takes more than 120 seconds, meaning if HTCondor job doesn't start in 
this time, the job is cancelled and the JupyterHub returns an error.

This can have various reasons, most likely it's general disturbance in the BIRD service
and not directly related to the JupyterHub. If you encounter this kind of issue and there is no 
notification on the login page, send an email to

Server didn't respond in 60 seconds

This is an error that occurs when the HTCondor job for the jupyter notebook get scheduled but 
when it starts the node does not have AFS and the job goes into hold  state.

At the moment the JupyterHub does not recognise this properly 
and thinks the jobs started and waits for the notebook to become reachable which never happens.

In the future we will implement a proper error handling. At the moment users should send a quick email to
with the error message. We will then disable the node and fix the AFS issues.

Could not find local schedd Error

If you get an error "Could not find local schedd" you 
simply need to log out and log in again.

The error results from the login cookie being valid but the kerberos token 
having expired. A fresh login creates a new kerberos token and the error does not
appear any longer.

  • No labels