Here is the default jupyter config for a standard SWAN setup for me:
$ jupyter --paths
config:
/scratch/pelson/.jupyter
/cvmfs/sft.cern.ch/lcg/releases/Python/3.7.6-b96a9/x86_64-centos7-gcc8-opt/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
...
runtime:
/scratch/pelson/.local/share/jupyter/runtime
There is no directory which is persistent and writable, therefore there is no currently way (FWICS) to configure Jupyter to pick up anything persistently. Therefore, if you want to have a custom kernel, you have to do something at SWAN startup - either set an environment variable (e.g. JUPYTER_PATH), or to install a kernel into $SCRATCH_HOME
.
The alternative approach is to put something into each of your notebooks to do the setup/config - I have an example of doing that to install a virtual environment and setup the Python path here. I personally don’t particularly like this approach, and prefer to setup the environment before any notebooks are loaded/executed since it it feels like an implementation detail of SWAN is bleeding into the data analysis record. To be completely clear though, I don’t think Jupyter has solved the problem of declaring the software environment in which to run a notebook problem yet, so its isn’t a SWAN problem per-se.