Skip to content

Commit 19be45c

Browse files
authored
Merge pull request #167 from MetaCell/release/0.6.0
Release/0.6.0
2 parents e9a6a9b + e10caa5 commit 19be45c

File tree

383 files changed

+50289
-1476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

383 files changed

+50289
-1476
lines changed

.dockerignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
org.geppetto.frontend.jupyter
2+
pygeppetto
3+
.vscode
4+
.ipynb_checkpoints
5+
netpyne_ui/geppetto
6+
*.egg-info
7+
notebook.ipynb
8+
.git
9+
netpyne
10+
Dockerfile
11+
Dockerfile_base
12+
Dockerfile_dev
13+
netpyne_workspace
14+
webapp/node_modules
15+
webapp/build
16+
webapp/geppetto-client
17+
k8s
18+
src
19+
x86_64

.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
.ipynb_checkpoints/
22
netpyne-ui.log
33
log.file
4+
src
45
*.pyc
56
*.egg-info
67
.DS_Store
78
pygeppetto/
89
netpyne/
910
org.geppetto.frontend.jupyter/
1011
*.ipynb
11-
init.py
12+
init.py
13+
webapp/node_modules
14+
webapp/geppetto-client
15+
webapp/build
16+
netpyne_workspace
17+
Dockerfile_mini
18+
npm*
19+
.vscode
20+
app.log
21+
utilities/x86_64
22+
.idea
23+
x86_64

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 17 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,26 @@
11
language: python
22
os: linux
3-
sudo: false
4-
dist: trusty
5-
bundler_args: --retry 5
3+
python:
4+
- "3.7"
65
node_js:
7-
- "7"
6+
- "12"
87
env:
98
global:
10-
secure: dn0FPQ5IG4M/3kdwnyI78ElQ308Vc3QnKAvkWfwMFb8QxDqxQdnTo7AV1qTMtbLrDNkeEWIgi4nc7jmXNtvGTwOfhAULVh6606Qs5B+ezTdwzajbbFMI8SKQx/pnTojOMu8dx7V4lMoR/YWcojR0VC1IWVC62TGbSB1k5BDGgH0=
11-
before_install:
12-
- sudo apt-get install -y xserver-xorg-dev libxext-dev libxi-dev
13-
install:
14-
- git clone --quiet https://github.com/MetaCell/geppetto-netpyne.git
15-
- cd geppetto-netpyne
16-
- if [ `git branch -a | egrep "remotes/origin/${TRAVIS_BRANCH}"` ]; then git checkout $TRAVIS_BRANCH ; else echo "Branch $TRAVIS_BRANCH does not exist for the dependent bundle, checking out development ..." && git checkout development; fi
17-
- cd ..
18-
- npm install --silent -g phantomjs
19-
- npm install --silent -g casperjs
20-
- npm install --silent -g slimerjs
21-
- npm install --silent -g gl
22-
python:
23-
- "2.7"
24-
- "3.5"
25-
edge: true
9+
- secure: dn0FPQ5IG4M/3kdwnyI78ElQ308Vc3QnKAvkWfwMFb8QxDqxQdnTo7AV1qTMtbLrDNkeEWIgi4nc7jmXNtvGTwOfhAULVh6606Qs5B+ezTdwzajbbFMI8SKQx/pnTojOMu8dx7V4lMoR/YWcojR0VC1IWVC62TGbSB1k5BDGgH0=
10+
- DEFAULT_BRANCH: development
11+
- LANDING_PAGE: "http://localhost:8888/geppetto"
2612
notifications:
2713
slack: metacell:5ALSeoP88DqIhORUJvxE56sq
28-
services:
29-
- docker
30-
addons:
31-
firefox: "58.0"
32-
apt:
33-
packages:
34-
- mesa-utils
35-
- xvfb
36-
- libgl1-mesa-dri
37-
- libglapi-mesa
38-
- libosmesa6
39-
40-
before_script:
41-
- "export DISPLAY=:99.0"
42-
- "sh -e /etc/init.d/xvfb start"
43-
- export SLIMERJSLAUNCHER=/home/travis/firefox-58.0/firefox/firefox
44-
- export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
45-
14+
install:
15+
- sudo apt-get install libgnutls28-dev
16+
- sudo apt install libcurl4-openssl-dev libssl-dev
17+
- sudo apt-get install python3-dev
4618
script:
47-
- travis_retry docker build -t="netpyne-ui" --build-arg netpyneuiBranch=$TRAVIS_BRANCH -f="./Dockerfile_dev" .
48-
- travis_retry docker run -t -dit --name=netpyne-ui_container -h localhost -p 8888:8888 netpyne-ui:latest
49-
- cd $TRAVIS_BUILD_DIR/ && ls
50-
- cd geppetto-netpyne && ls
51-
- cd tests
52-
- bash utilities/netpyne-server-status.sh
53-
- sleep 30
54-
- http_status=$(curl -s -I $1 http://localhost:8888/geppetto | grep HTTP/1.1 | awk {'print $2'})
19+
20+
- python utilities/install.py
21+
- ./NetPyNE-UI &
22+
- http_status=$(curl -s -I $1 $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'})
5523
- echo "$http_status"
56-
- while [ "$http_status" == "404" ]; do
57-
echo "Restart run";
58-
echo "Printing logs for debugging purposes";
59-
docker stop $(docker ps -a -q);
60-
docker rm $(docker ps -a -q);
61-
docker run -t -dit --name=netpyne-ui_container -h localhost -p 8888:8888 netpyne-ui:latest
62-
bash utilities/netpyne-server-status.sh
63-
sleep 30;
64-
http_status=$(curl -s -I $1 http://localhost:8888/geppetto | grep HTTP/1.1 | awk {'print $2'})
65-
echo "Done restarting";
66-
echo "$http_status";
67-
done;
68-
- http_status=$(curl -s -I $1 http://localhost:28081 | grep HTTP/1.1 | awk {'print $2'})
69-
- echo "$http_status";
70-
- "curl -s -I $1 http://localhost:8888/geppetto | grep HTTP/1.1 | awk {'print $2'}"
71-
- firefox --version
72-
- travis_retry xvfb-run -a --server-args="-screen 0 1024x768x24" casperjs test netpyne-tests.js --host=http://localhost:8888/ --engine=slimerjs
73-
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)"
74-
- docker logs -t netpyne-ui_container
75-
- docker stop $(docker ps -a -q)
76-
- docker rm $(docker ps -a -q)
24+
- cd webapp
25+
- travis_retry npm run test -- --verbose --colors
26+
- exit 0

Dockerfile

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
FROM metacell/jupyter-neuron:latest
1+
FROM frodriguez4600/jupyter-neuron:v7.8.0
22
USER $NB_USER
33

4-
ARG netpyneuiBranch=development
5-
ENV netpyneuiBranch=${netpyneuiBranch}
6-
RUN echo "$netpyneuiBranch";
4+
ARG branch=development
5+
RUN echo "$branch";
76

8-
ARG INCUBATOR_VER=unknown
9-
RUN /bin/bash -c "INCUBATOR_VER=${INCUBATOR_VER} source activate snakes && pip install netpyne_ui"
10-
RUN /bin/bash -c "source activate snakes && jupyter nbextension enable --py jupyter_geppetto"
11-
RUN /bin/bash -c "source activate snakes && jupyter serverextension enable --py jupyter_geppetto"
12-
RUN /bin/bash -c "source activate snakes && jupyter nbextension enable --py widgetsnbextension"
7+
ENV INSTALLATION_FOLDER=/home/jovyan/work/NetPyNE-UI
8+
WORKDIR /home/jovyan/work
139

14-
WORKDIR /home/jovyan
15-
RUN git clone --branch v0.5 https://github.com/Neurosim-lab/netpyne_workspace
16-
WORKDIR /home/jovyan/netpyne_workspace
10+
COPY --chown=1000:1000 . NetPyNE-UI
11+
WORKDIR ${INSTALLATION_FOLDER}/utilities
1712

18-
# Uncomment to run travis using this Dockerfile
19-
# Clone the source code and creates a symlink to the test folder
20-
WORKDIR /home/jovyan/work
21-
RUN wget https://github.com/MetaCell/NetPyNE-UI/archive/$netpyneuiBranch.zip -q
22-
RUN unzip $netpyneuiBranch.zip
23-
WORKDIR /home/jovyan/netpyne_workspace
24-
RUN ln -sfn /home/jovyan/work/NetPyNE-UI-$netpyneuiBranch/netpyne_ui/tests tests
13+
RUN python install.py branch $branch
14+
15+
WORKDIR ${INSTALLATION_FOLDER}
2516

26-
CMD /bin/bash -c "source activate snakes && exec jupyter notebook --debug --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui"
17+
CMD /bin/bash -c "jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True"

NetPyNE-UI

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui
2+
exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[![Docker Automated buil](https://img.shields.io/docker/automated/jrottenberg/ffmpeg.svg)](https://hub.docker.com/r/metacell/netpyne-ui/)
2-
2+
[![Build Status](https://travis-ci.org/MetaCell/NetPyNE-UI.svg?branch=master)](https://travis-ci.org/MetaCell/NetPyNE-UI)
3+
[![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/tarelli/NetPyNE-UI%2Ftest?branch=master&key=eyJhbGciOiJIUzI1NiJ9.NWFkNzMyNDIzNjQ1YWMwMDAxMTJkN2Rl.-gUEkJxH6NCCIRgSIgEikVDte-Q0BsGZKEs4uahgpzs&type=cf-1)]( https%3A%2F%2Fg.codefresh.io%2Fpipelines%2Ftest%2Fbuilds%3FrepoOwner%3DMetaCell%26repoName%3DNetPyNE-UI%26serviceName%3DMetaCell%252FNetPyNE-UI%26filter%3Dtrigger%3Abuild~Build%3Bbranch%3Amaster%3Bpipeline%3A5e5bbecc6c98a1209fc7bca3~test)
34
<p align="center">
4-
<img src="https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/master/docs/netpyne.png" width="350px"/>
5+
<img src="https://github.com/MetaCell/NetPyNE-UI/raw/documentation/docs/netpyne.png" width="350px"/>
56
</p>
67

7-
![Screenshot](https://github.com/metacell/netpyne-ui/raw/master/docs/netpyneui.png)
8+
![Screenshot](https://github.com/MetaCell/NetPyNE-UI/raw/documentation/docs/netpyneui.png)
89

910
This repository hosts the User Interface for [NetPyNE](http://www.neurosimlab.org/netpyne/). NetPyNE is a python package to facilitate the development, parallel simulation and analysis of biological neuronal networks using the NEURON simulator.
1011

@@ -21,15 +22,36 @@ If you are familiar with NEURON and have already NEURON installed in your machin
2122
</p>
2223

2324
## Install NetPyNE User Interface from sources (for developers)
25+
26+
### Python Dependencies
27+
28+
We recommend the use of a new python 3 virtual environment:
29+
30+
```bash
31+
python3 -m venv npenv
32+
source npenv/bin/activate
33+
```
34+
35+
Or, with conda
36+
37+
```bash
38+
conda create -n netpyne python=3.7
39+
conda activate netpyne
2440
```
41+
42+
### Run install script
43+
44+
```bash
2545
git clone https://github.com/MetaCell/NetPyNE-UI.git
2646
cd utilities
2747
python install.py
2848
cd ..
2949
./NetPyNE-UI
3050
```
31-
### To update sources:
32-
```
51+
52+
### To update sources
53+
54+
```bash
3355
python update.py
3456
```
3557

docs/gif1.gif

-11.1 MB
Loading

docs/netpyneui.png

-1.56 MB
Loading

docs/wiki1-1.png

68.9 KB
Loading

docs/wiki1-2.png

56.6 KB
Loading

docs/wiki1.png

-58.8 KB
Loading

docs/wiki10.png

-46.1 KB
Loading

docs/wiki11.png

-32.1 KB
Loading

docs/wiki12.png

53.7 KB
Loading

docs/wiki13.png

57.2 KB
Loading

docs/wiki14.png

49.9 KB
Loading

docs/wiki15.png

65.1 KB
Loading

docs/wiki16.png

88.2 KB
Loading

docs/wiki17.png

82.3 KB
Loading

docs/wiki2.png

-83 KB
Loading

docs/wiki3.png

149 KB
Loading

docs/wiki4.png

92.7 KB
Loading

docs/wiki5.png

152 KB
Loading

docs/wiki6.png

101 KB
Loading

docs/wiki7.png

186 KB
Loading

docs/wiki8.png

66.6 KB
Loading

docs/wiki9.png

-71.1 KB
Loading

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

Dockerfile_dev renamed to jupyter_hub/Dockerfile_spawner

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
FROM metacell/jupyter-neuron:latest
2+
3+
USER root
4+
RUN conda install -c conda-forge nodejs configurable-http-proxy
5+
26
USER $NB_USER
37

4-
ARG netpyneuiBranch=development
8+
# feature_jupyterhub
9+
ARG netpyneuiBranch=feature_jupyterhub
510
ENV netpyneuiBranch=${netpyneuiBranch}
611
RUN echo "$netpyneuiBranch";
712

13+
ARG INCUBATOR_VER=unknown
14+
RUN /bin/bash -c "INCUBATOR_VER=${INCUBATOR_VER} source activate snakes && pip install jupyterhub==0.9.4"
15+
816
# Clone NetPyNE-UI and install the development version
917
RUN wget https://github.com/MetaCell/NetPyNE-UI/archive/$netpyneuiBranch.zip -q
1018
RUN unzip $netpyneuiBranch.zip
@@ -15,4 +23,8 @@ WORKDIR /home/jovyan
1523
RUN git clone https://github.com/Neurosim-lab/netpyne_workspace
1624
WORKDIR /home/jovyan/netpyne_workspace
1725
RUN ln -sfn /home/jovyan/work/NetPyNE-UI-$netpyneuiBranch/netpyne_ui/tests tests
18-
CMD /bin/bash -c "source activate snakes && exec jupyter notebook --debug --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui"
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=''']

k8s/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM jupyterhub/k8s-hub:0.9.0
2+
3+
COPY --chown=1000:1000 templates/page.html /usr/local/share/jupyterhub/templates/page.html
4+
COPY --chown=1000:1000 templates/404.html /usr/local/share/jupyterhub/templates/404.html
5+
COPY --chown=1000:1000 templates/spawn_pending.html /usr/local/share/jupyterhub/templates/spawn_pending.html
6+
COPY --chown=1000:1000 static/jupyter.png /usr/local/share/jupyterhub/static/images/jupyter.png
7+
COPY --chown=1000:1000 static/jupyter.png /usr/local/share/jupyterhub/static/images/jupyterhub-80.png
8+
COPY --chown=1000:1000 static/favicon.ico /usr/local/share/jupyterhub/static/favicon.ico
9+
COPY --chown=1000:1000 static/favicon.ico /usr/local/share/jupyterhub/static/images/favicon.ico
10+
COPY --chown=1000:1000 auth.py /usr/local/lib/python3.6/dist-packages/tmpauthenticator/__init__.py
11+
COPY --chown=1000:1000 js/EventSource.js /usr/local/share/jupyterhub/static/js/EventSource.js
12+
13+
14+
CMD ["jupyterhub", "--config", "/srv/jupyterhub_config.py"]

k8s/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# k8s deployment
2+
3+
- Deploy on minikube runnig
4+
5+
```bash
6+
kubectl create -ns netpyne
7+
helm upgrade netpyne jupyterhub --install --reset-values --repo https://jupyterhub.github.io/helm-chart/ --version 0.9.0 --namespace netpyne --values minikube_values.yaml --force --debug
8+
```
9+
10+
- Access the hub by running
11+
12+
```bash
13+
minikube service list
14+
```
15+
16+
and use the url corresponding to nepyne proxy-public on port 80

0 commit comments

Comments
 (0)