Home | News | Documentation | Download

Make JupyterHub container import ROOT in a notebook

Hi, I’m trying to import ROOT in a jupyter-notebook spawned by a Hub container.

I have on another container an installation of ROOT, is it possible to export the PYTHONPATH, LD_LIBRARY_PATH in order to make ROOT importable by the Hub container?
I was wondering if docker-compose could be a viable way.

_ROOT Version: v6-22-00

Hello @chiara_iannetta, it looks like pretty interesting setup issue! which container are you using with ROOT?

Hello @oshadura, sorry for the delay, I’m using the rootproject/root container.
So far I have discovered that through the multistage build, it is possible to access different container and use features of them to construct docker images in a faster way.

Still I don’t know if two standalone containers are able to “see” eachother.

Hi @chiara_iannetta ,
two docker containers can see each other the same way two computers can see each other: you can connect them over the network.

However I think the simplest solution would be to make ROOT available in the Hub container itself, either by setting up cvmfs (see e.g. how it is done [here](GitHub - eguiraud/cvmfs_everywhere: Recipe for an ubuntu-based docker container with a working cvmfs client or maybe check CernVM File System) or by creating a new Docker image based on the Jupyther Hub image that also has ROOT installed.

Cheers,
Enrico

EDIT: note that if you just want a jupyter notebook with ROOT available it’s relatively simple to create an image that does that starting from the rootproject/root image. An example is here, it basically comes down to exposing the jupyter server to the host.

EDIT 2: you might also want to check out/follow the progress at Adding ROOT C++ kernel to Jupyter Notebook container