All Projects → jupyterhub → sudospawner

jupyterhub / sudospawner

Licence: BSD-3-Clause License
Spawn JupyterHub single-user servers with sudo

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sudospawner

Primehub
A toil-free multi-tenancy machine learning platform in your Kubernetes cluster
Stars: ✭ 160 (+290.24%)
Mutual labels:  jupyter, jupyterhub
jupyter-remote-desktop-proxy
Run a Linux Desktop on a JupyterHub
Stars: ✭ 46 (+12.2%)
Mutual labels:  jupyter, jupyterhub
Jupyterhub Tutorial
Tutorial materials for deploying JupyterHub
Stars: ✭ 161 (+292.68%)
Mutual labels:  jupyter, jupyterhub
Ldapauthenticator
LDAP Authenticator Plugin for Jupyter
Stars: ✭ 145 (+253.66%)
Mutual labels:  jupyter, jupyterhub
systemdspawner
Spawn JupyterHub single-user notebook servers with systemd
Stars: ✭ 79 (+92.68%)
Mutual labels:  jupyter, jupyterhub
Ml Hub
🧰 Multi-user development platform for machine learning teams. Simple to setup within minutes.
Stars: ✭ 148 (+260.98%)
Mutual labels:  jupyter, jupyterhub
Jupyterlab Hub
Deprecated: JupyterLab extension for running JupyterLab with JupyterHub
Stars: ✭ 181 (+341.46%)
Mutual labels:  jupyter, jupyterhub
Ansible Jupyterhub
Ansible role to setup jupyterhub server (deprecated)
Stars: ✭ 14 (-65.85%)
Mutual labels:  jupyter, jupyterhub
Best Of Jupyter
🏆 A ranked list of awesome Jupyter Notebook, Hub and Lab projects (extensions, kernels, tools). Updated weekly.
Stars: ✭ 200 (+387.8%)
Mutual labels:  jupyter, jupyterhub
Jupyterhub Deploy Teaching
Reference deployment of JupyterHub and nbgrader on a single server
Stars: ✭ 194 (+373.17%)
Mutual labels:  jupyter, jupyterhub
Helm Chart
A store of Helm chart tarballs for deploying JupyterHub and BinderHub on a Kubernetes cluster
Stars: ✭ 123 (+200%)
Mutual labels:  jupyter, jupyterhub
hubshare
A directory sharing service for JupyterHub
Stars: ✭ 57 (+39.02%)
Mutual labels:  jupyter, jupyterhub
Repo2docker
Turn repositories into Jupyter-enabled Docker images
Stars: ✭ 1,177 (+2770.73%)
Mutual labels:  jupyter, jupyterhub
Jupyter Server Proxy
Jupyter notebook server extension to proxy web services.
Stars: ✭ 153 (+273.17%)
Mutual labels:  jupyter, jupyterhub
Nbgrader
A system for assigning and grading notebooks
Stars: ✭ 1,000 (+2339.02%)
Mutual labels:  jupyter, jupyterhub
Configurable Http Proxy
node-http-proxy plus a REST API
Stars: ✭ 166 (+304.88%)
Mutual labels:  jupyter, jupyterhub
Jupyterhub Deploy Docker
Reference deployment of JupyterHub with docker
Stars: ✭ 479 (+1068.29%)
Mutual labels:  jupyter, jupyterhub
Zero To Jupyterhub K8s
Helm Chart & Documentation for deploying JupyterHub on Kubernetes
Stars: ✭ 888 (+2065.85%)
Mutual labels:  jupyter, jupyterhub
Awesome Jupyter
A curated list of awesome Jupyter projects, libraries and resources
Stars: ✭ 2,523 (+6053.66%)
Mutual labels:  jupyter, jupyterhub
jupyterhub-deploy-hpc
Documented examples of Jupyterhub deployment in HPC settings
Stars: ✭ 30 (-26.83%)
Mutual labels:  jupyter, jupyterhub

SudoSpawner

PyPI

GitHub Workflow Status - Test

The SudoSpawner enables JupyterHub to spawn single-user servers without being root, by spawning an intermediate process via sudo, which takes actions on behalf of the user.

The sudospawner mediator, the intermediate process, can only do two things:

  1. send a signal to another process using the os.kill() call
  2. spawn single-user servers

Launching the sudospawner script is the only action that requires a JupyterHub administrator to have sudo access to execute.

Installation and setup

  1. Install:

     pip install -e .
    
  2. Add sudo access to the script.

  3. To configure JupyterHub to use SudoSpawner, add the following to your jupyterhub_config.py:

     c.JupyterHub.spawner_class='sudospawner.SudoSpawner'
    

    The JupyterHub documentation has additional information about creating a configuration file, if needed, and recommended file locations for configuration files.

Custom singleuser launch command

In order to limit what permissions the use of sudospawner grants the Hub, when a single-user server is launched the executable spawned is hardcoded as dirname(sudospawner)/jupyterhub-singleuser. This requires the sudospawner executable to be in the same directory as the jupyterhub-singleuser command. It is very important that users cannot modify the bin/ directory containing sudospawner, otherwise they can modify what sudospawner actually enables JupyterHub to do.

You may want to initialize user environment variables before launching the server, or do other initialization. If you install a script called sudospawner-singleuser next to sudospawner, this will be used instead of the direct jupyterhub-singleuser command.

For example, you might want to spawn notebook servers from conda environments that are revised and deployed separately from your hub instance.

#!/bin/bash -l
set -e

# Activate the notebook environment
source /opt/miniconda/bin/activate /opt/envs/notebook-latest

# Show environment info in the log to aid debugging
conda info

# Delegate the notebook server launch to the jupyterhub-singleuser script.
# this is how most sudospawner-singleuser scripts should end.
exec "$(dirname "$0")/jupyterhub-singleuser" $@

SudoSpawner with JupyterLab-Hub singleuser launch command

In order to have SudoSpawner work with JupyterLab-Hub you will need to create a custom singleuser launch command. Create the script sudospawner-singleuser containing the below code in the same directory as sudospawner and grant it the same permissions.

#!/bin/bash -l

# Delegate the notebook server launch to the jupyter-labhub script.
exec "jupyter-labhub" $@

Example

The Dockerfile in this repo contains an example configuration for setting up a JupyterHub system, without any need to run anything as root.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].