Skip to content

Instantly share code, notes, and snippets.

@aculich
Last active September 11, 2018 03:26
Show Gist options
  • Save aculich/b22a0fe5f95de40d7c68a93e722d327e to your computer and use it in GitHub Desktop.
Save aculich/b22a0fe5f95de40d7c68a93e722d327e to your computer and use it in GitHub Desktop.
bacon sage notes
# Before you begin
gcloud container clusters get-credentials sagecampus --zone europe-west1-d
# If you ever change config.yaml in hub-deployment
helm upgrade jhub jupyterhub/jupyterhub --version=v0.6 -f config.yaml
# Individual users plus hub and proxy which are always there
kubectl get pods --namespace sagecampus
# Get nodes
kubectl get nodes --namespace sagecampus
# ALWAYS namespace arg with K8
# Delete a pod
kubectl delete pod pre-pull-jhub-1-1523918230-2dst2 --namespace sagecampus
kubectl delete pod jupyter-geoff-2ebacon --namespace sagecampus
kubectl delete pod {} --namespace sagecampus
kubectl delete pod pre-pull-jhub-12-1524675112-wnrdb --namespace sagecampus
# Delete a node?
Reset manually to preserve IP
# Installing helm
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init
# add jhub helm charts
helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
helm repo update
# retry until tiller active
while [ $? -ne 0 ]; do
echo "Retrying..."
sleep 5
helm repo update
done
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
helm init --service-account tiller --upgrade
# End installing helm
# When problems with upgrading in the config.yaml (proxy/nginx)
# Delete jhub release
helm delete jhub --purge
# Reinstalling helm charts for jupyter on K8
helm install jupyterhub/jupyterhub \
--version=v0.6 \
--name=jhub \
--namespace=sagecampus \
-f config.yaml
1. Make change to notebook
2. Commit and push GitHub and add in Enron data
3. Run make.py for each (make solutions dir first)
4. Move Python and R into main Sage
5. Docker build image
6. docker push (with new tag)
7. Go to Gcloud and change tag in config.yaml
8. Install helm via above (after gcloud )
9. helm upgrade jhub jupyterhub/jupyterhub --version=v0.6 -f config.yaml
If timeout, run again and again. Alternatively, ssh into each node and run docker pull gbacon/sage-....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment