Introduction

JupyterHub spawns, manages multiple instances of the single-user Jupyter notebook server. The Jupyter notebooks are running python kernels from the Conda Release System.

The Jupyter notebook server is run on the interactive psana nodes or  the interactive psffb nodes. For most users psana should be used. The psffb should be used only for current experiments that require very high bandwidth to the data. See the table below for what is accessible:

accesspsanapsffb
offline datayesno
ffb datayes, but limited bandwidth
(/reg/data/drpsrcf).
yes (fast)
(/cds/data/drpsrcf)
calib folder (LCLS-I)yesyes


JupyterHub is a web service and is available at:

https://pswww.slac.stanford.edu/jupyterhub/hub/home

or following the links at pswww.

Users can login with their unix account to start a new jupyter notebook server.


NOTE: The jupyterhub web interface by default will only allow you to navigate to subdirectories of your home directory (see https://github.com/jupyter/notebook/issues/2032 for the reasoning behind this decision).  If you want to navigate to another directory that is not underneath your home directory, run a script like this in your home directory to make a softlink that you can click on in the jupyterhub web interface:

import os
os.symlink("/reg/d/psdm/xpp/xpptut15","xpptut15")

Available Kernels

When logging into JupyterHub a number of possible kernels are shown:

  • LCLS-I psana analysis kernels (both py2 and py3)
  • LCLS-II psana analysis kernel (py3 only)
  • A kernel for analyzing HDF5 files (py3 only) which should change at a slower rate than psana kernels (which must change to support new detectors, for example)
  • A few different deep-learning kernels

The psana kernels typically point to the latest version.  See the next section for how to create a kernel for a particular version of psana.

Creating Your Own Jupyter Kernels

See https://jupyter-client.readthedocs.io/en/latest/kernels.html#kernelspecs.  To create your own custom kernel (e.g. to select a particular version of psana) insert a kernel directory in your home directory~/.local/share/jupyter/kernels.  You can copy one of the production kernel directories from /reg/g/psdm/sw/conda/jhub_config/prod-rhel7/kernels and modify as you see fit.

Troubleshooting

511 Error

If you try to start a server and see a "511 error" it is often an indication that your ssh keys are too old (or non-existent).  When that happens you need to generate new keys by running this script:

/reg/g/psdm/sw/jupyterhub/psjhub/jhub/generate-keys.sh

Font Error

If you see a "font error" like this when running matplotlib:

findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.
findfont: Generic family 'sans-serif' not found because none of the following families were found: DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif

You can try deleting the contents of ~/.cache/matplotlib as described here https://github.com/matplotlib/matplotlib/issues/13139.

Graphical Errors

When using some modern display packages (e.g. bokeh, ipympl) there can be software requirements on your client machine (e.g. your laptop where you are logging in to jupyter) for recent versions of packages like java and javascript.  To see if this is the case try using a different browser or another computer.

Upgrades

The jupyterhub is upgraded from time to time. After an upgraded the previous version will be available for 4-8 weeks using the url:

https://pswww.slac.stanford.edu/jupyterhubprev/hub/home