Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of Slicer notebook in Jupyter Hub #73

Open
bveeni opened this issue May 11, 2022 · 2 comments
Open

Integration of Slicer notebook in Jupyter Hub #73

bveeni opened this issue May 11, 2022 · 2 comments

Comments

@bveeni
Copy link

bveeni commented May 11, 2022

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

@lassoan
Copy link
Contributor

lassoan commented May 11, 2022

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.

@davide84
Copy link

davide84 commented Jun 10, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants