JupyterHub

https://www.youtube.com/watch?v=omxY1YsPGUc

Auth:

Connect JupyterHub's authenticator class to Dataland's user auth system (can be in form of OAuth, a dict fetched from db, file etc.

Storage:

Map HTTP verbs to file operations in ContentOperations class, notebook represented as JSON. You can change what it means to do these different file system operations.

Make databases solve the state problem.

Store notebooks in Postgres DB as binary blobs to help save state.

Run Jupyter notebooks and pass path to a config file, which asks ipython to use a different contents manager class (the postgres contents manager class). Pass user ids to have separate namespaces for different users. Have max file size. Setup encryption.

pgbouncer (connect to this instead of a db) to add transparent connection pooling make sure you don't run out of database connections. (happens cause database runs out of RAM)

Untitled Database

Hubs

Put the hub in an iframe and have a system in our front end to decide what hub to route the user to. Maintain a mapping from users to the server they're currently allocated to and then keep track of which server you should be routed to dynamically and use that to make sure you get sent to the same place.

Sharing notebooks

Use extensions:

nbextension - UI/Javascript (configure a cell as a preview for someone to look at the notebook)

serverextension - Backend/Python