Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Multi-user server for Jupyter notebooks

License

NotificationsYou must be signed in to change notification settings

jupyterhub/jupyterhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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


Latest PyPI versionLatest conda-forge versionDocumentation build statusGitHub Workflow Status - TestTest coverage of codeGitHubDiscourseGitter

WithJupyterHub you can create amulti-user Hub that spawns, manages, and proxies multiple instances of thesingle-userJupyter notebookserver.

Project Jupyter created JupyterHub to support manyusers. The Hub can offer notebook servers to a class of students, a corporatedata science workgroup, a scientific research project, or a high-performancecomputing group.

Technical overview

Three main actors make up JupyterHub:

  • multi-userHub (tornado process)
  • configurable httpproxy (node-http-proxy)
  • multiplesingle-user Jupyter notebook servers (Python/Jupyter/tornado)

Basic principles for operation are:

  • Hub launches a proxy.
  • The 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 notebookservers.

JupyterHub also provides aREST APIfor administration of the Hub and its users.

Installation

Check prerequisites

  • A Linux/Unix based system

  • Python 3.8 or greater

  • nodejs/npm

    • If you are usingconda, the nodejs and npm dependencies will be installed foryou by conda.

    • If you are usingpip, install a recent version (at least 12.0) ofnodejs/npm.

  • If using the default PAM Authenticator, apluggable authentication module (PAM).

  • TLS certificate and key for HTTPS communication

  • Domain name

Install packages

Usingconda

To install JupyterHub along with its dependencies including nodejs/npm:

conda install -c conda-forge jupyterhub

If you plan to run notebook servers locally, install JupyterLab or Jupyter notebook:

conda install jupyterlabconda install notebook

Usingpip

JupyterHub can be installed withpip, and the proxy withnpm:

npm install -g configurable-http-proxypython3 -m pip install jupyterhub

If you plan to run notebook servers locally, you will need to installJupyterLab or Jupyter notebook:

python3 -m pip install --upgrade jupyterlabpython3 -m pip install --upgrade notebook

Run the Hub server

To start the Hub server, run the command:

jupyterhub

Visithttp://localhost:8000 in your browser, and sign in with your system username and password.

Note: To allow multiple users to sign in to the server, you will need torun thejupyterhub command as aprivileged user, such as root.Thewikidescribes how to run the server as aless privileged user, which requiresmore configuration of the system.

Configuration

TheGetting Started section of thedocumentation explains the common steps in setting up JupyterHub.

TheJupyterHub tutorialprovides 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 port10.0.1.2:443 withhttps:

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

Authenticators

AuthenticatorDescription
PAMAuthenticatorDefault, built-in authenticator
OAuthenticatorOAuth + JupyterHub Authenticator = OAuthenticator
ldapauthenticatorSimple LDAP Authenticator Plugin for JupyterHub
kerberosauthenticatorKerberos Authenticator Plugin for JupyterHub

Spawners

SpawnerDescription
LocalProcessSpawnerDefault, built-in spawner starts single-user servers as local processes
dockerspawnerSpawn single-user servers in Docker containers
kubespawnerKubernetes spawner for JupyterHub
sudospawnerSpawn single-user servers without being root
systemdspawnerSpawn single-user notebook servers using systemd
batchspawnerDesigned for clusters using batch scheduling software
yarnspawnerSpawn single-user notebook servers distributed on a Hadoop cluster
wrapspawnerWrapSpawner and ProfilesSpawner enabling runtime configuration of spawners

Docker

A starterdocker image for JupyterHubgives a baseline deployment of JupyterHub using Docker.

Important: Thisquay.io/jupyterhub/jupyterhub image contains only the Hub itself,with no configuration. In general, one needs to make a derivative image, withat least ajupyterhub_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 ornot, Jupyter Notebook version 4 or greater must be installed.

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

docker run -p 8000:8000 -d --name jupyterhub quay.io/jupyterhub/jupyterhub jupyterhub

This command will create a container namedjupyterhub that you canstop and resume withdocker stop/start.

The Hub service will be listening on all interfaces at port 8000, which makesthis a good choice fortesting 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 dockerconfiguration or by using an ssl enabled proxy.

Mounting volumes willallow you tostore data outside the docker image (host system) so it will be persistent, even when you starta new image.

The commanddocker exec -it jupyterhub bash will spawn a root shell in your dockercontainer. You canuse 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 ourcontributor documentationand theCONTRIBUTING.md. TheCONTRIBUTING.md fileexplains how to set up a development installation, how to run the test suite,and how to contribute to documentation.

For a high-level view of the vision and next directions of the project, see theJupyterHub community roadmap.

A note about platform support

JupyterHub is supported on Linux/Unix based systems.

JupyterHub officiallydoes not support Windows. You may be able to useJupyterHub on Windows if you use a Spawner and Authenticator that work onWindows, but the JupyterHub defaults will not. Bugs reported on Windows will notbe accepted, and the test suite will not run on Windows. Small patches that fixminor Windows compatibility issues (such as basic installation)may be accepted,however. For Windows-based systems, we would recommend running JupyterHub in adocker container or Linux VM.

Additional Reference: Tornado's documentation on Windows platform support

License

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

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

Help and resources

We encourage you to ask questions and share ideas on theJupyter community forum.You can also talk with us on our JupyterHubGitter channel.

JupyterHub follows the JupyterCommunity Guides.


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


[8]ページ先頭

©2009-2025 Movatter.jp