neurolibre / neurolibre-binderhub

developer resources for neurolibre.conp.ca

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NeuroLibre is a curated repository of interactive neuroscience notebooks, seamlessly integrating data, text, code and figures. Notebooks can be freely modified and re-executed through the web, offering a fully reproducible, “libre” path from data to figures. NeuroLibre is powered by the Binder project with computational resources provided by CONP, CBRAIN, and Compute Canada. This repository contains some important documentation and scripts for the developer of the neurolibre platform.

neurolibre-binderhub

Repository that contains all files to set up the binder instance

binderhub

All files to configure the binder instance including : config.yaml which is the basic configuration file for the binderhub templates and static folders containing the template for the binder login page (in dev) install-binderhub.sh to setup up the instance

hub-image

This docker image is used by binderhub when building a user pod. This is basically used to allow the user to upload his data on the server, using repo2data.

The images are stored in https://hub.docker.com/u/conpdev

terraform

This folder contains all the terraform configuration to set up the binderhub infrastructure.

usefull kube commands

kubernetes/kubernetes#17512

Get all kube namespaces

kubectl get namespace

List all available nodes

kubectl get nodes | grep node | awk '\''{print $1}'\'' | xargs -I {} sh -c '\''echo {} ; kubectl describe node {} | grep Allocated -A 5 | grep -ve Event -ve Allocated -ve percent -ve -- ; echo '\''

Check CPU usage

util | grep % | awk '{print \$1}' | awk '{ sum += \$1 } END { if (NR > 0) { result=(sum**4000); printf result/NR \"%\n\" } }'

Check memory usage

util | grep % | awk '\''{print $3}'\'' | awk '\''{ sum += $1 } END { if (NR > 0) { result=(sum*100)/(NR*1600); printf result/NR "%\n" } }'\''

Execute a command inside a pod

kubectl exec -n=binderhub -it myPod -- /bin/bash

Delete a pod

kubectl delete -n=binderhub pod

Delete ALL pods (from all namespaces, no just binderhub) kubectl get pods --no-headers=true --all-namespaces |sed -r 's/(\S+)\s+(\S+).*/kubectl --namespace \1 delete pod \2/e'

Upgrade the binderhub version

sudo helm upgrade binderhub jupyterhub/binderhub --version=v0.2.0-10ac4d8 -f config.yaml -f secrets.yaml

Get all logs from a pod

kubectl logs -n=binderhub

Describe a pod

kubectl describe pods -n=binderhub

List all pods

paste <(kubectl get pods -n=binderhub) <(kubectl get pod -o=custom-columns=NODE:.spec.nodeName,START:.metadata.creationTimestamp -n=binderhub) | column -s $'\t' -t

Delete problematic namespaces

NAMESPACE=your-rogue-namespace
(
kubectl proxy &
kubectl get namespace $NAMESPACE -o json | jq '.spec = {"finalizers":[]}' > temp.json
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize
rm temp.json
)

About

developer resources for neurolibre.conp.ca


Languages

Language:HTML 75.2%Language:Dockerfile 17.6%Language:Shell 5.7%Language:Starlark 1.5%