JupyterHub and tmpnb

Jessica Hamrick
UC Berkeley
@jhamrick

Cloud-based notebooks

  • tmpnb: temporary notebook servers
  • JupyterHub: user-based, persistent notebook servers

tmpnb

Temporary notebooks using Docker

How tmpnb works

  • A pool of unallocated Docker containers running the notebook are spawned
  • User is assigned to a container and tmpnb re-routes requests to their container
  • After a while, tmpnb will destroy the container and create a new unallocated container

Architecture of tmpnb

JupyterHub

  • Persistent, authenticated notebook servers
  • User goes to JupyterHub URL
  • JuptyerHub asks the authenticator to verify the user
  • If the user is authenticated, JupyterHub asks the spawner to launch the notebook server

Authenticators

  • PAM (default)

Spawners

  • Local process spawner (default)

More spawners

Example: Vanilla JupyterHub

  • JupyterHub runs locally

  • PAM authentication

  • Local process spawner

How it works

How it works

How it works

How it works

Example: Demohub

  • JupyterHub runs locally

  • GitHub OAuth

  • Docker spawner

Example: Compmodels

  • JupyterHub runs inside a Docker container

  • Local+GitHub OAuth

  • Swarm spawner

JupyterHub Services

  • Obtain token to enable communication with JupyterHub
  • Register new route with proxy (e.g. /hub/nbgrader/cogsci131)
  • Authenticate requests through JupyterHub
  • Note: very proof-of-concept, we have plans to make an official "services" API in the future

Example: nbgrader formgrade

Links