JupyterHub

From JoBaPedia
Revision as of 12:41, 1 April 2022 by Joachim (talk | contribs) (Created page with "= Setup JupyterHub = * create new user and group jupyterhub and put user in group shadow * allow sudo for members of group. Create /etc/sudoers.d/jupyterhub Cmnd_Alias JUPYTER_CMD = /home/jupyterhub/miniconda3/bin/sudospawner jupyterhub ALL=(%jupyterhub) NOPASSWD:JUPYTER_CMD * install conda for that user script=Miniconda3-latest-Linux-x86_64.sh wget "https://repo.anaconda.com/miniconda/$script" chmod +x "$script" "./$script" -b ~/miniconda3/bin/conda init bash ....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Setup JupyterHub

  • create new user and group jupyterhub and put user in group shadow
  • allow sudo for members of group. Create /etc/sudoers.d/jupyterhub
Cmnd_Alias JUPYTER_CMD = /home/jupyterhub/miniconda3/bin/sudospawner
jupyterhub ALL=(%jupyterhub) NOPASSWD:JUPYTER_CMD
  • install conda for that user
script=Miniconda3-latest-Linux-x86_64.sh
wget "https://repo.anaconda.com/miniconda/$script"
chmod +x "$script"
"./$script" -b
~/miniconda3/bin/conda init bash
. ~/.bashrc
conda update conda
  • install packages
conda install -c conda-forge jupyterhub sudospawner opencv pandas matplotlib
  • configure jupyterhub
jupyterhub --generate-config -f jupyterhub_config.py
add line "c.JupyterHub.bind_url = 'http://:7000'" to config file 
  • start the hub
jupyterhub --JupyterHub.spawner_class=sudospawner.SudoSpawner