Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting up dedicated notebook runner inside docker containers on VM @ CHPC #71

Open
gijzelaerr opened this issue Mar 15, 2016 · 0 comments

Comments

@gijzelaerr
Copy link
Member

about

so actually we can set a webserver that runs the course notebooks in docker containers.

Doing this now on 196.24.241.83, created an alias for radioastro.pythonic.nl and interferometery.pythonic.nl.

create VM

https://cloud.chpc.ac.za

This can be automated:

https://github.com/ratt-ru/systems/wiki/openstack

install docker

https://docs.docker.com/linux/step_one/

$ sudo apt-get update
$ sudo apt-get -y install curl git
$ curl -fsSL https://get.docker.com/ | sh

https://github.com/jupyter/tmpnb

Install tmbnb

export TOKEN=$( head -c 30 /dev/urandom | xxd -p )
export CONTAINER=radioastro/course
export PORT=8000

docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$(TOKEN) \
    --name=proxy jupyter/configurable-http-proxy \
    --default-target http://127.0.0.1:9999 --port=$(PORT)
docker run --net=host -d -e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
    --name=tmpnb -v /var/run/docker.sock:/docker.sock \
    jupyter/tmpnb python orchestrate.py --image='$(CONTAINER)' \
    --command="jupyter notebook --NotebookApp.base_url={base_path} \
    --ip=0.0.0.0 --port {port}"

Redirect

due to proxy container design we can't run it on port 80. 8000 is annoyingly blocked by SKA, but we redirect traffic using uptables:

sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant