jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.7k stars 4.93k forks source link

Run Notebook server for multiple users #2440

Open ZelphirKaltstahl opened 7 years ago

ZelphirKaltstahl commented 7 years ago

Disclaimer: This is not really an issue, but more of a question and I did not know where else to ask this (a mailing list?).

I want to deploy one (or more than one) notebook server online, so that many people can access it without login and they all have their own notebook instances of a single notebook file, so that no user sees any modifications of another user or can use their Python kernels with all the variables set. I do not need any login. In fact any login would increase the obstacles to use my notebook and is undesirable in my scenario. I don't want people having to sign up for anything. They shall remain anonymous. I want this for allowing anyone to test my notebook.

I know about the project JupyterHub, however, I'd like to avoid using it for such open structure. From working with JupyterHub before, I know that JupyterHub is a huge amount of unstructured code (thousands of lines in one file, every object talking to every other object, no UML diagrams in documentation to help getting an overview, hard to refactor anything without breaking stuff). It is functioning, but it does much more than I need and on a first search, I could not even find the docs for disabling user logins in it. If I have no choice, I'll use it, but it requires me to dabble in so many different things like user database, which spawner to use, how to configure the spawner, how to disable login completely, resource management per configuration files and probably others. I'd rather take one or two days and write my own minimal server, on top of some of the minimalistic webservers Python has, which simply uses dockerpy to spawn a container for each visitor of some route on my server with some predefined resource limitation. I'd have to think about how to link an anonymous visitor with the respective container though.

Is there a way to use plain notebook servers (for example inside a docker container) in such an open way for multiple users, without one user being able to see context of another user? Or maybe any minimal multi user server, which is lightweight in comparison to JupyterHub? Is writing my own realistic, or is linking visitors to their respective docker containers a difficult task?

takluyver commented 7 years ago

It sounds like tmpnb might be what you're after. It doesn't use logins, but gives each user who connects their own notebook server in a docker container. Once the user leaves the page, their server is automatically culled to reclaim resources for more users.

ZelphirKaltstahl commented 7 years ago

This looks indeed like what I am after. I'll give it a try and see, thanks!

sandys commented 7 years ago

I have this exact same issue (and I know of multiple people who do). Context: this was a discussion that started on hacker news: https://news.ycombinator.com/item?id=14036145

basically the simplest, bare-minimum usecase is jupyter with two roles: "editor" and "user". Editor can edit... user can just run (including dashboards). Without any of the jupyterhub needs or anything. This will solve 95% of multi-user usecases.

ZelphirKaltstahl commented 7 years ago

@sandys It rather sounds like multiple people working on one and the same instance of a notebook, being able to cooperate. While that's interesting, it is not what I am looking for. Still thanks for the link, it might be interesting in the future and for other people who stumble over this question.

ZelphirKaltstahl commented 7 years ago

For what it is worth: I ended up using jupyterhub-tmpauthenticator.

sandys commented 7 years ago

Actually, it is exactly what you requested. We wanted to build dashboards by one person and have everyone else use it. This is the most common use case that everyone usually has.

ZelphirKaltstahl commented 7 years ago

@sandys What do you mean by "and have everyone else use it." ? Can you be more specific about that particular part?

This could either be what I want, or something different, depending on how it is interpreted. To be clear, what is discussed on ycombinator to me seems to be collaboration of people on one and the same instance of a notebook. If you read my original post I actually specifically excluded that:

[...] they all have their own notebook instances of a single notebook file, so that no user sees any modifications of another user or can use their Python kernels with all the variables set. [...]

Collaboration would not be what I want, while it would still be interesting for other projects. However, if you mean to say by that phrase, that everyone gets their own instance of the notebook, being unable to see others, then it would be what I wanted.

sandys commented 7 years ago

Hi zelphir, No - I'm NOT looking for collaboration. I'm also looking for the opposite of that. One person creates the notebook and everyone else can use it. Similar to a dashBoard with calculation.

I like to call it "spreadsheet-like". One person creates the spreadsheet (with all its formulas ) and everyone else just uses it with their own data...But cannot edit the formulas.

Is this what you meant ? I apologize if I misunderstood.

On May 13, 2017 21:39, "Zelphir Kaltstahl" notifications@github.com wrote:

@sandys https://github.com/sandys What do you mean by "and have everyone else use it." ? Can you be more specific about that particular part?

This could either be what I want, or something different, depending on how it is interpreted. To be clear, what is discussed on ycombinator to me seems to be collaboration of people on one and the same instance of a notebook. If you read my original post I actually specifically excluded that:

[...] they all have their own notebook instances of a single notebook file, so that no user sees any modifications of another user or can use their Python kernels with all the variables set. [...]

Collaboration would not be what I want, while it would still be interesting for other projects. However, if you mean to say by that phrase, that everyone gets their own instance of the notebook, being unable to see others, then it would be what I wanted.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jupyter/notebook/issues/2440#issuecomment-301257702, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEsU_AyxYPxuoZf9Cbx3qkuf7_KYUYiks5r5dWjgaJpZM4NGxGn .

ZelphirKaltstahl commented 7 years ago

@sandys I guess it is what I am looking for, except the part about speadsheet like and users not being able to edit formulas.

elgalu commented 6 years ago

What about this project https://github.com/sagemathinc/cocalc ?