Skip to content

JasonJWilliamsNY/docker_jupyterhub_config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

docker_jupyterhub_config

Configfiles for dockerized-jupyterhub

Draft instructions

Setup config files

Enter usernames for your hub users

  1. Clone this repo and place jupyterhub-persistant/ in a convenient location on your server. In jupyterhub-persistant/ edit usernames.txt; this file should have one or more valid linux username(s) (one name per line). Accounts will be created in your container for each user. The sample list has user1,user2, and user3. Usernames have passwords such that: some_username.123.

    tip: You can edit the password in line 16 of createusers.sh password=$(openssl passwd -1 -salt xyz $base'.123') currently appends .123 to the end of the username (which is also = to $base in this line)

    Note: Your user will have a home directory at /home/$user This will be a symbolic link to a folder jupyterhub-persistant/$user that will be created on the machine running the docker container. In this way, data and changes made by the user on the hub will exist persistently outside of the container.

Indicate hub admin users

  1. You should setup at least one user from your username list to be a hub admin user. In the jupyterhub_config.py file, edit c.Authenticator.admin_users. Include in the brackets quoted, comma-separated usernames.

    # remember to uncomment this line after editing
    c.Authenticator.admin_users = {"user_foo","user_bar"}
    

Copy jupyter-persistant

  1. Place jupyterhub-persistant/ in a suitable location on the machine where Docker is hosted. The -v option used at execution will bind this folder.

  2. Make sure /jupyterhub-persistant/createusers.sh is executable:

     chmod +x SOMEPATH/jupyterhub-persistant/createusers.sh
    

Running the hub

  1. Pull the image from dockerhub

     docker pull jasonjwilliamsny/ubuntu-jhub-dev3.0
    
  2. Start the container with this command (remember to edit the location of jupyterhub-persistant/ and use the full path)

     docker run -p 8000:8000 --name jupyterhub -d -v FULL-PATH-TO/jupyter-persistant:/jupyter-persistant jasonjwilliamsny/ubuntu-jhub-dev3.0:latest
    

    You can also add options to explicitly allow cpu/memory usage

     docker run -p 8000:8000 --cpus="16" --memory=60g  --name jupyterhub -d -v SOMEPATH/jupyter-persistant:/jupyter-persistant jasonjwilliamsny/ubuntu-jhub-dev3.0:latest
    
  3. Docker will be available at the ip address of the machine

     localhost:8000
    

    Tip: Using the Hub's Terminal, have users clone a repo of notebooks into their home directory.

Things to think about/to do

  • add instruction for certificate creation for SSL
  • Docker container must have enough resources (CPU/MEM/DISK) to run a container with many users (need to test)

About

Configfiles for dockerized-jupyterhub

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published