...
- Start a new instance on the LRZ Compute Cloud where the number of cores should be the number of participants of the course. In general 20 cores should be fine.
- Choose Ubuntu for the OS.
- You need a private/public key for login from your terminal/desktop
- Add the Port 8000 in a Security Group of the VM
- Generate a floating IP for the respective provider network your VM is connected to (either MWN or internet) and attach it to the VM.
- You have to use this floating IP when you later on connect to the jupyter server. http://<floating-ip>:8000
- Be aware that the system is accessible from the whole internet and can be an aim for hackers. Monitor the machine periodically and shelve it when it is not in use!
- Also see: Security Basics from the jupyterhub documentation
- You can use the LRZ GitLab Server for authentication (see below for the setup)
Installation of the software
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
$ python >>> import os # create 20 users (user0, user1, .., user19) >>> [os.system(f"useradd -m user{i}") for i in range(20)] >>> [os.system(f"echo user{i}:NEW_SECRET_PASSWORD | chpasswd") for i in range(20)] # create an admin0 user >>> os.system(f"useradd -m admin0") >>> os.system(f"echo admin0:NEW_SECRET_PASSWORD | chpasswd") # create a folder for course material for each user which is owned by admin0 >>> os.system("mkdir /home/admin0/course_material") >>> [os.system(f"ln -s /home/admin0/course_material /home/user{i}/course_material1") for i in range(101)] |
Authentication via OAuth on GitLab
You can use the LRZ GitLab server for the authentication on the JupyterHub server. The user has to configure the application in his profile:
(https://docs.gitlab.com/ee/integration/oauth_provider.html, "Adding an application through the profile"
This only works for applications without root access. Then follow the JupyterHub/GitLab documentation to install the JupyterHub plugin:
https://github.com/jupyterhub/oauthenticator
https://oauthenticator.readthedocs.io/en/latest/getting-started.html#gitlab-setup
...