4

I am working a Jupiter Notebook/ Lab (via JupyterHub) integration into an other application.

Goal:

The goal is to allow users to create a Jupyter Notebook/ Lab server from the application (using the JupyterHub API) and therefore extend the applications capabilities with the power of python.

As far as I know this would be possible by implementing a custom Authenticator that integrates the applications login system and create the servers using the JupyterHub API.

Problem:

A nice feature would be to give multiple users of the application access to the same Jupyter Notebook/ Lab (server). However, I cannot find a way to share servers across users or mange permissions to servers.

There is a Groups feature in JupyterHub, but it is very poorly documented... and I don't really understand what it is doing.

I would be grateful for any help, whether this is (at all) possible with JupyterHub?

Bohne
  • 173
  • 1
  • 7
  • 12
  • can you clarify whether you want multiple users to be able to have their own accounts/directories, but running on shared hardware, or if you want the users to be able to share the same user directory/storage, or if you want simultaneous usage of the same python sessions, e.g. google docs for jupyterlab? the answers would depend a lot on how "shared" you're hoping to get. – Michael Delgado Jun 21 '22 at 16:39
  • Sure thank you! By "shared" I mean, that multiple users should be able to access the same directories/ files. Whether they can work simultaneously is not mandatory (but would be nice to have). – Bohne Jun 21 '22 at 16:43
  • Maybe I can add an example: User A starts the server through our application, creates a Notebook and writes some code. (At some late point) User B is able to access the Notebook written by User A and add their ideas to the code. – Bohne Jun 21 '22 at 16:48
  • Can you just allow users to clone the same git repository? – Michael Delgado Jun 21 '22 at 16:50
  • 1
    Sure, that would be a workaround. You mean that each user has their own `Jupiter-single-user` sever. And they simply clone that code from git repos. However, it would be nicer if the sharing would be handled through JupyterHub – Bohne Jun 21 '22 at 16:57
  • yeah that's what I mean. otherwise you're going to have to figure out how to deal with conflict management etc. you could also certainly give each jupyter user access to a networked drive or read/write to a cloud storage bucket or something. – Michael Delgado Jun 21 '22 at 17:09
  • for sure! good luck with your jupyterhub :D – Michael Delgado Jun 21 '22 at 17:13

1 Answers1

1

You need to generate the JuputerHub configuration file, using jupyterhub --generate-config -f /etc/jupyterhub/jupyterhub_conf.py. Then edit that config file to include the line: c.Spawner.notebook_dir=/path/to/common/directory. You will need to configure other things also to make it work properly.

Run the JupyterHub with: jupyterhub -f /etc/jupyterhub/jupyterhub_conf.py &, or better, as a service.

coding
  • 627
  • 7
  • 20