SlicerJupyter
SlicerJupyter copied to clipboard
Integration of Slicer notebook in Jupyter Hub
Hi, With slicerJupyter notebook, all users end up sharing same session screen. We would like to have different session for different user. For this, I came to know JupyterHub allows it to happen. I am trying to integrate slicer notebook into existing jupyterhub container, before writing dockerfile. However, I am stuck in running ./install.sh Slicer/Slicer giving error: Sicer: cannot connect server X. If anyone has been successfully serve slicer notebook via JupyterHub, then please kindly guide me through the steps required or can share sample dockerfile to integrate slicer-notebook into jupyterhub. Thanks
You probably want to separate users (not just screens but files, processes, etc) and you can achieve that by running the kernel in a docker container, as it is done at mybinder.org. You can use the current slicer-notebook image for this.
In this docker image, each kernels use the same screen. Since the active kernel's window is automatically brought to the top, this typically causes only temporary inconvenience when frequently switching between notebooks (if it is visible to users at all), so for us this is an acceptable solution.
If this screen sharing is not acceptable for you and willing to spend some time with improving this then you could experiment with automatically setting up a separate virtual desktop or screen or x server for each kernel. Probably you can just edit the command that starts the kernel in the kernelspec file.
Hi! This is how I configured my JupyterHub to have multi-user Slicer sessions:
- install the package "xvfb"
- manually update the slicer kernel the following (and adapt the path to Slicer executable):
{ "display_name": "Slicer 4.11", "language" : "python", "argv": [ "xvfb-run", "-a", "/path/to/Slicer", "--no-splash", "--python-code", "connection_file=r'{connection_file}'; print('Jupyter connection file: ['+connection_file+']'); slicer.modules.jupyterkernel.startKernel(connection_file);slicer.util.mainWindow().showMinimized()" ] }
All the other steps are identical to the official SlicerJupyter documentation.
I am not using a container, but a full server. How to handle different users in the container may be another issue independent from Slicer.