GithubHelp home page GithubHelp logo

alexxnica / jupyterhub Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jupyterhub/jupyterhub

0.0 0.0 0.0 2.02 MB

Multi-user server for Jupyter notebooks

Home Page: https://jupyterhub.readthedocs.io

License: Other

Python 91.54% Mako 0.12% JavaScript 4.11% CSS 0.63% HTML 3.59%

jupyterhub's Introduction

Technical Overview | Installation | Configuration | Docker | Contributing | License | Help and Resources

JupyterHub

PyPI Documentation Status Build Status Circle CI codecov.io Google Group

With JupyterHub you can create a multi-user Hub which spawns, manages, and proxies multiple instances of the single-user Jupyter notebook (IPython notebook) server.

Project Jupyter created JupyterHub to support many users. The Hub can offer notebook servers to a class of students, a corporate data science workgroup, a scientific research project, or a high performance computing group.

Technical overview

Three main actors make up JupyterHub:

  • multi-user Hub (tornado process)
  • configurable http proxy (node-http-proxy)
  • multiple single-user Jupyter notebook servers (Python/IPython/tornado)

Basic principles for operation are:

  • Hub spawns a proxy.
  • Proxy forwards all requests to Hub by default.
  • Hub handles login, and spawns single-user servers on demand.
  • Hub configures proxy to forward url prefixes to the single-user notebook servers.

JupyterHub also provides a REST API for administration of the Hub and its users.

Installation

###Check prerequisites

  • Python 3.3 or greater

  • nodejs/npm Install a recent version of nodejs/npm For example, install it on Linux (Debian/Ubuntu) using:

    sudo apt-get install npm nodejs-legacy
    

    The nodejs-legacy package installs the node executable and is currently required for npm to work on Debian/Ubuntu.

  • TLS certificate and key for HTTPS communication

  • Domain name

Install packages

JupyterHub can be installed with pip, and the proxy with npm:

npm install -g configurable-http-proxy
pip3 install jupyterhub    

If you plan to run notebook servers locally, you will need to install the Jupyter notebook package:

pip3 install --upgrade notebook

Run the Hub server

To start the Hub server, run the command:

jupyterhub

Visit https://localhost:8000 in your browser, and sign in with your unix PAM credentials.

Note: To allow multiple users to sign into the server, you will need to run the jupyterhub command as a privileged user, such as root. The wiki describes how to run the server as a less privileged user, which requires more configuration of the system.

Configuration

The Getting Started section of the documentation explains the common steps in setting up JupyterHub.

The JupyterHub tutorial provides an in-depth video and sample configurations of JupyterHub.

Create a configuration file

To generate a default config file with settings and descriptions:

jupyterhub --generate-config

Start the Hub

To start the Hub on a specific url and port 10.0.1.2:443 with https:

jupyterhub --ip 10.0.1.2 --port 443 --ssl-key my_ssl.key --ssl-cert my_ssl.cert

Authenticators

Authenticator Description
PAMAuthenticator Default, built-in authenticator
OAuthenticator OAuth + JupyterHub Authenticator = OAuthenticator
ldapauthenticator Simple LDAP Authenticator Plugin for JupyterHub

Spawners

Spawner Description
LocalProcessSpawner Default, built-in spawner starts single-user servers as local processes
dockerspawner Spawn single-user servers in Docker containers
kubespawner Kubernetes spawner for JupyterHub
sudospawner Spawn single-user servers without being root
systemdspawner Spawn single-user notebook servers using systemd
batchspawner Designed for clusters using batch scheduling software
wrapspawner WrapSpawner and ProfilesSpawner enabling runtime configuration of spawners

Docker

A starter docker image for JupyterHub gives a baseline deployment of JupyterHub using Docker.

Important: This jupyterhub/jupyterhub image contains only the Hub itself, with no configuration. In general, one needs to make a derivative image, with at least a jupyterhub_config.py setting up an Authenticator and/or a Spawner. To run the single-user servers, which may be on the same system as the Hub or not, Jupyter Notebook version 4 or greater must be installed.

The JupyterHub docker image can be started with the following command:

docker run -d --name jupyterhub jupyterhub/jupyterhub jupyterhub

This command will create a container named jupyterhub that you can stop and resume with docker stop/start.

The Hub service will be listening on all interfaces at port 8000, which makes this a good choice for testing JupyterHub on your desktop or laptop.

If you want to run docker on a computer that has a public IP then you should (as in MUST) secure it with ssl by adding ssl options to your docker configuration or by using a ssl enabled proxy.

Mounting volumes will allow you to store data outside the docker image (host system) so it will be persistent, even when you start a new image.

The command docker exec -it jupyterhub bash will spawn a root shell in your docker container. You can use the root shell to create system users in the container. These accounts will be used for authentication in JupyterHub's default configuration.

Contributing

If you would like to contribute to the project, please read our contributor documentation and the CONTRIBUTING.md.

For a development install, clone the repository and then install from source:

git clone https://github.com/jupyterhub/jupyterhub
cd jupyterhub
pip3 install -r dev-requirements.txt -e .

If the pip3 install command fails and complains about lessc being unavailable, you may need to explicitly install some additional JavaScript dependencies:

npm install

This will fetch client-side JavaScript dependencies necessary to compile CSS.

You may also need to manually update JavaScript and CSS after some development updates, with:

python3 setup.py js    # fetch updated client-side js
python3 setup.py css   # recompile CSS from LESS sources

We use pytest for running tests:

pytest jupyterhub/tests

License

We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.

All code is licensed under the terms of the revised BSD license.

Help and resources

We encourage you to ask questions on the Jupyter mailing list. To participate in development discussions or get help, talk with us on our JupyterHub Gitter channel.


Technical Overview | Installation | Configuration | Docker | Contributing | License | Help and Resources

jupyterhub's People

Contributors

apetresc avatar barrachri avatar betatim avatar carreau avatar ckald avatar cwaldbieser avatar daradib avatar dblockow-d2dcrc avatar deephorizons avatar dmartzol avatar dominicfollettsmith avatar dsblank avatar ellisonbg avatar iamed18 avatar jdavidheiser avatar jhamrick avatar josephtate avatar minrk avatar obiwahn avatar ozancaglayan avatar parente avatar rgbkrk avatar robnagler avatar shreddd avatar ssanderson avatar takluyver avatar vilhelmen avatar whitead avatar willingc avatar yuvipanda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.