Current configuration and bootstrap script for UC Berkeley's D-Lab's JupyterHub for instruction.
This code synthesizes the documentation from z2h for instructional workshops with ~30 students into a shell script
In Google Cloud Shell, after enabling the Compute Engine, Container Engine, and Container Registry APIs, clone in the bootstrap repo:
git clone https://github.com/henchc/dlab-jhub.gitThen run the bootstrap script.
cd dlab-jhub/hub && bash bootstrap.shThe default will use aculich/rockyter for a docker image and D-Lab's Python Fundamentals GitHub repo, and set up a cluster with 3 nodes using machine type n1-highmem-2 (2 CPUs + 13GB memory + 16 PDs). But you can also give the shell script arguments, the first argument is the dockerhub image, the second argument the GitHub repo, and the third argument the number of nodes.
bash bootstrap.sh <DOCKER IMAGE> <GITHUB REPO> <NUM_NODES>With large docker images it will timeout and retry a few times. At the very end it will yield the public IP address for the hub.
Running bootstrap.sh will give you an IP address at the end for your hub. If you somehow lose it, you can print it again by running:
kubectl --namespace=dlabhub get svcTo zip up and download any content, all users can open a new terminal and tar the folder:
tar -czvf my_files.tar <FOLDER TO TAR>Then back in the file browser you can check the box next to the file and click download.
To resize the hub at any point:
gcloud container clusters resize \
             dlabhub \
             --size <NEW-SIZE> \
             --zone us-central1-bThis should not disturb users.
To delete and restart a pod, first check the pods that are running:
kubectl get pods --namespace dlabhubThen delete the problematic pod:
kubectl delete pod <PODNAME> --namespace dlabhub