Skip to content

Commit e6086f0

Browse files
authored
Merge pull request #109 from MetaCell/feature_jupyterhub
Jupyter Hub
2 parents 80e5eef + 7f0e5dd commit e6086f0

4 files changed

Lines changed: 81 additions & 1 deletion

File tree

jupyter_hub/Dockerfile_hub

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM jupyterhub/jupyterhub:latest
2+
3+
# feature_jupyterhub
4+
ARG netpyneuiBranch=feature_jupyterhub
5+
ENV netpyneuiBranch=${netpyneuiBranch}
6+
RUN echo "$netpyneuiBranch";
7+
8+
# Install authenticator and spawner + jupyter_client
9+
RUN pip install jupyterhub-tmpauthenticator dockerspawner jupyter_client
10+
11+
# Overwrite jupyterhub_config
12+
RUN wget https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/$netpyneuiBranch/jupyterhub/jupyterhub_config.py -q

jupyter_hub/Dockerfile_spawner

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM metacell/jupyter-neuron:latest
2+
3+
USER root
4+
RUN conda install -c conda-forge nodejs configurable-http-proxy
5+
6+
USER $NB_USER
7+
8+
# feature_jupyterhub
9+
ARG netpyneuiBranch=feature_jupyterhub
10+
ENV netpyneuiBranch=${netpyneuiBranch}
11+
RUN echo "$netpyneuiBranch";
12+
13+
ARG INCUBATOR_VER=unknown
14+
RUN /bin/bash -c "INCUBATOR_VER=${INCUBATOR_VER} source activate snakes && pip install jupyterhub==0.9.4"
15+
16+
# Clone NetPyNE-UI and install the development version
17+
RUN wget https://github.com/MetaCell/NetPyNE-UI/archive/$netpyneuiBranch.zip -q
18+
RUN unzip $netpyneuiBranch.zip
19+
WORKDIR /home/jovyan/work/NetPyNE-UI-$netpyneuiBranch/utilities
20+
RUN /bin/bash -c "source activate snakes && python --version"
21+
RUN /bin/bash -c "source activate snakes && exec python install.py branch $netpyneuiBranch"
22+
WORKDIR /home/jovyan
23+
RUN git clone https://github.com/Neurosim-lab/netpyne_workspace
24+
WORKDIR /home/jovyan/netpyne_workspace
25+
RUN ln -sfn /home/jovyan/work/NetPyNE-UI-$netpyneuiBranch/netpyne_ui/tests tests
26+
27+
# Copy jupyterhub_config
28+
# RUN cp /home/jovyan/work/NetPyNE-UI-$netpyneuiBranch/jupyterhub_config.py .
29+
30+
CMD /bin/bash -c "source activate snakes && exec jupyterhub-singleuser --debug --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui"

jupyter_hub/jupyterhub_config.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Class for authenticating users.
2+
#
3+
# This should be a class with the following form:
4+
#
5+
# - constructor takes one kwarg: `config`, the IPython config object.
6+
#
7+
# with an authenticate method that:
8+
# _class
9+
# - is a coroutine (asyncio or tornado)
10+
# - returns username on success, None on failure
11+
# - takes two arguments: (handler, data),
12+
# where `handler` is the calling web.RequestHandler,
13+
# and `data` is the POST form data from the login page.
14+
#c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator'
15+
# c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator'
16+
# c.DummyAuthenticator.password = "dummypassword"
17+
c.JupyterHub.authenticator_class = 'tmpauthenticator.TmpAuthenticator'
18+
19+
## The class to use for spawning single-user servers.
20+
#
21+
# Should be a subclass of Spawner.
22+
#c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner'
23+
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
24+
from jupyter_client.localinterfaces import public_ips
25+
ip = public_ips()[0]
26+
c.JupyterHub.hub_ip = ip
27+
c.DockerSpawner.image = 'netpyne_ui_jupyterspawner'
28+
c.DockerSpawner.remove_containers = True
29+
c.DockerSpawner.remove = True
30+
c.DockerSpawner.debug = True
31+
c.DockerSpawner.network_name='jupyterhub_network'
32+
33+
## Extra arguments to be passed to the single-user server. Only works for the LocalProcessSpawner
34+
#
35+
# Some spawners allow shell-style expansion here, allowing you to use
36+
# environment variables here. Most, including the default, do not. Consult the
37+
# documentation for your spawner to verify!
38+
# c.Spawner.args = ['--library=netpyne_ui', '--NotebookApp.default_url=/geppetto', '--NotebookApp.token=''']

utilities/GeppettoConfiguration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"_README" : "http://docs.geppetto.org/en/latest/build.html",
3-
"contextPath": "org.geppetto.frontend",
3+
"contextPath": "org.geppetto.frontend/",
44
"useSsl": false,
55
"embedded": false,
66
"embedderURL": ["/"],

0 commit comments

Comments
 (0)