Purpose: The building of development environments raises an unnecessary technical problem. In many cases even if someone has the technical capacity to build, it does not mean they will have time to do so. In order to remove this barrier to participation we have created some Docker images to allow people to use our tools. Each of these images serves Jupyter notebooks and including a Python scientific computing stack (extended from jupyter/docker-stacks/scipy-notebook), and some combination of NEURON-7.4, scoop, DEAP, sciunit, and neuronunit.
git clone https://github.com/scidash/docker-stacks
./run neuronunit
docker pull scidash/<image-name>
where <image-name>
is one of the sub-directories above (e.g. neuronunit
). Then do docker run -it -p 8887:8888 scidash/<image-name>
to launch it. ./shell <image-name>
to get a shell inside the given container. ./build-all
or build just one image with:
./build <image-name>
. This is similar to the usual docker build
command except that it checks GitHub to see if a newer version of the corresponding SciDash repository is available, and downloads that code, before building the image. -dev
flag is passed to run
or shell
.sudo apt-get install npm nodejs-legacy
npm install -g configurable-http-proxy
pip install jupyterhub
pip install -U notebook
jupyterhub --generate-config
Then put something like this in your jupyterhub-config.py
file and follow the instructions in the comments, then run jupyterhub
from the host. More is required if you want SSL, GitHub authentication, etc.:
import os
import platform
import netifaces
# Install the proxy first:
# npm install -g configurable-http-proxy
# If NPM is not working on your Mac, try this:
# https://gist.github.com/DanHerbert/9520689
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
# You need to open up a port on the host that a Docker container can access:
# sudo ifconfig lo0 alias 10.200.11.1/24
if platform.system == 'Darwin':
lo0 = netifaces.ifaddresses('lo0')
try:
docker0_ipv4 = lo0[netifaces.AF_INET][1]
except IndexError:
raise Exception(("OSX hosts must add an additional IP to the loopback interface that the Docker container can access, "
"e.g. 'sudo ifconfig lo0 alias 10.200.10.1/24'"))
else:
docker0 = netifaces.ifaddresses('docker0')
docker0_ipv4 = lo0[netifaces.AF_INET][0]
ip = docker0_ipv4['addr']
c.JupyterHub.ip = ip
c.JupyterHub.hub_ip = ip
# If you make changes an restart the server, you might want to kill
# the Docker container so that it starts a new one instead of using the old one:
# docker rm -f $(docker ps -a -q) # Careful, this kills all the containers.
c.DockerSpawner.container_image = 'scidash/neuronunit-showcase'
c.DockerSpawner.extra_create_kwargs.update({
'command': '/usr/local/bin/start-singleuser.sh'
})
Then run jupyterhub
, visit the indicated URL (e.g. 10.200.11.1:8000
) in your browser, and log in as a system user.