Skip to content

Commit

Permalink
Merge pull request #167 from MetaCell/release/0.6.0
Browse files Browse the repository at this point in the history
Release/0.6.0
  • Loading branch information
tarelli authored Jul 17, 2020
2 parents e9a6a9b + e10caa5 commit 19be45c
Show file tree
Hide file tree
Showing 383 changed files with 50,289 additions and 1,476 deletions.
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
org.geppetto.frontend.jupyter
pygeppetto
.vscode
.ipynb_checkpoints
netpyne_ui/geppetto
*.egg-info
notebook.ipynb
.git
netpyne
Dockerfile
Dockerfile_base
Dockerfile_dev
netpyne_workspace
webapp/node_modules
webapp/build
webapp/geppetto-client
k8s
src
x86_64
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
.ipynb_checkpoints/
netpyne-ui.log
log.file
src
*.pyc
*.egg-info
.DS_Store
pygeppetto/
netpyne/
org.geppetto.frontend.jupyter/
*.ipynb
init.py
init.py
webapp/node_modules
webapp/geppetto-client
webapp/build
netpyne_workspace
Dockerfile_mini
npm*
.vscode
app.log
utilities/x86_64
.idea
x86_64
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

84 changes: 17 additions & 67 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,26 @@
language: python
os: linux
sudo: false
dist: trusty
bundler_args: --retry 5
python:
- "3.7"
node_js:
- "7"
- "12"
env:
global:
secure: dn0FPQ5IG4M/3kdwnyI78ElQ308Vc3QnKAvkWfwMFb8QxDqxQdnTo7AV1qTMtbLrDNkeEWIgi4nc7jmXNtvGTwOfhAULVh6606Qs5B+ezTdwzajbbFMI8SKQx/pnTojOMu8dx7V4lMoR/YWcojR0VC1IWVC62TGbSB1k5BDGgH0=
before_install:
- sudo apt-get install -y xserver-xorg-dev libxext-dev libxi-dev
install:
- git clone --quiet https://github.com/MetaCell/geppetto-netpyne.git
- cd geppetto-netpyne
- 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
- cd ..
- npm install --silent -g phantomjs
- npm install --silent -g casperjs
- npm install --silent -g slimerjs
- npm install --silent -g gl
python:
- "2.7"
- "3.5"
edge: true
- secure: dn0FPQ5IG4M/3kdwnyI78ElQ308Vc3QnKAvkWfwMFb8QxDqxQdnTo7AV1qTMtbLrDNkeEWIgi4nc7jmXNtvGTwOfhAULVh6606Qs5B+ezTdwzajbbFMI8SKQx/pnTojOMu8dx7V4lMoR/YWcojR0VC1IWVC62TGbSB1k5BDGgH0=
- DEFAULT_BRANCH: development
- LANDING_PAGE: "http://localhost:8888/geppetto"
notifications:
slack: metacell:5ALSeoP88DqIhORUJvxE56sq
services:
- docker
addons:
firefox: "58.0"
apt:
packages:
- mesa-utils
- xvfb
- libgl1-mesa-dri
- libglapi-mesa
- libosmesa6

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- export SLIMERJSLAUNCHER=/home/travis/firefox-58.0/firefox/firefox
- export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/

install:
- sudo apt-get install libgnutls28-dev
- sudo apt install libcurl4-openssl-dev libssl-dev
- sudo apt-get install python3-dev
script:
- travis_retry docker build -t="netpyne-ui" --build-arg netpyneuiBranch=$TRAVIS_BRANCH -f="./Dockerfile_dev" .
- travis_retry docker run -t -dit --name=netpyne-ui_container -h localhost -p 8888:8888 netpyne-ui:latest
- cd $TRAVIS_BUILD_DIR/ && ls
- cd geppetto-netpyne && ls
- cd tests
- bash utilities/netpyne-server-status.sh
- sleep 30
- http_status=$(curl -s -I $1 http://localhost:8888/geppetto | grep HTTP/1.1 | awk {'print $2'})

- python utilities/install.py
- ./NetPyNE-UI &
- http_status=$(curl -s -I $1 $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'})
- echo "$http_status"
- while [ "$http_status" == "404" ]; do
echo "Restart run";
echo "Printing logs for debugging purposes";
docker stop $(docker ps -a -q);
docker rm $(docker ps -a -q);
docker run -t -dit --name=netpyne-ui_container -h localhost -p 8888:8888 netpyne-ui:latest
bash utilities/netpyne-server-status.sh
sleep 30;
http_status=$(curl -s -I $1 http://localhost:8888/geppetto | grep HTTP/1.1 | awk {'print $2'})
echo "Done restarting";
echo "$http_status";
done;
- http_status=$(curl -s -I $1 http://localhost:28081 | grep HTTP/1.1 | awk {'print $2'})
- echo "$http_status";
- "curl -s -I $1 http://localhost:8888/geppetto | grep HTTP/1.1 | awk {'print $2'}"
- firefox --version
- travis_retry xvfb-run -a --server-args="-screen 0 1024x768x24" casperjs test netpyne-tests.js --host=http://localhost:8888/ --engine=slimerjs
- python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)"
- docker logs -t netpyne-ui_container
- docker stop $(docker ps -a -q)
- docker rm $(docker ps -a -q)
- cd webapp
- travis_retry npm run test -- --verbose --colors
- exit 0
31 changes: 11 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
FROM metacell/jupyter-neuron:latest
FROM frodriguez4600/jupyter-neuron:v7.8.0
USER $NB_USER

ARG netpyneuiBranch=development
ENV netpyneuiBranch=${netpyneuiBranch}
RUN echo "$netpyneuiBranch";
ARG branch=development
RUN echo "$branch";

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

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

# Uncomment to run travis using this Dockerfile
# Clone the source code and creates a symlink to the test folder
WORKDIR /home/jovyan/work
RUN wget https://github.com/MetaCell/NetPyNE-UI/archive/$netpyneuiBranch.zip -q
RUN unzip $netpyneuiBranch.zip
WORKDIR /home/jovyan/netpyne_workspace
RUN ln -sfn /home/jovyan/work/NetPyNE-UI-$netpyneuiBranch/netpyne_ui/tests tests
RUN python install.py branch $branch

WORKDIR ${INSTALLATION_FOLDER}

CMD /bin/bash -c "source activate snakes && exec jupyter notebook --debug --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui"
CMD /bin/bash -c "jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True"
2 changes: 1 addition & 1 deletion NetPyNE-UI
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui
exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[![Docker Automated buil](https://img.shields.io/docker/automated/jrottenberg/ffmpeg.svg)](https://hub.docker.com/r/metacell/netpyne-ui/)

[![Build Status](https://travis-ci.org/MetaCell/NetPyNE-UI.svg?branch=master)](https://travis-ci.org/MetaCell/NetPyNE-UI)
[![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)
<p align="center">
<img src="https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/master/docs/netpyne.png" width="350px"/>
<img src="https://github.com/MetaCell/NetPyNE-UI/raw/documentation/docs/netpyne.png" width="350px"/>
</p>

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

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.

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

## Install NetPyNE User Interface from sources (for developers)

### Python Dependencies

We recommend the use of a new python 3 virtual environment:

```bash
python3 -m venv npenv
source npenv/bin/activate
```

Or, with conda

```bash
conda create -n netpyne python=3.7
conda activate netpyne
```

### Run install script

```bash
git clone https://github.com/MetaCell/NetPyNE-UI.git
cd utilities
python install.py
cd ..
./NetPyNE-UI
```
### To update sources:
```

### To update sources

```bash
python update.py
```

Expand Down
Binary file modified docs/gif1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/netpyneui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wiki1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wiki1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wiki12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wiki13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wiki14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wiki15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wiki16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/wiki17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/wiki9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions jupyter_hub/Dockerfile_hub
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM jupyterhub/jupyterhub:latest

# feature_jupyterhub
ARG netpyneuiBranch=feature_jupyterhub
ENV netpyneuiBranch=${netpyneuiBranch}
RUN echo "$netpyneuiBranch";

# Install authenticator and spawner + jupyter_client
RUN pip install jupyterhub-tmpauthenticator dockerspawner jupyter_client

# Overwrite jupyterhub_config
RUN wget https://raw.githubusercontent.com/MetaCell/NetPyNE-UI/$netpyneuiBranch/jupyterhub/jupyterhub_config.py -q
16 changes: 14 additions & 2 deletions Dockerfile_dev → jupyter_hub/Dockerfile_spawner
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
FROM metacell/jupyter-neuron:latest

USER root
RUN conda install -c conda-forge nodejs configurable-http-proxy

USER $NB_USER

ARG netpyneuiBranch=development
# feature_jupyterhub
ARG netpyneuiBranch=feature_jupyterhub
ENV netpyneuiBranch=${netpyneuiBranch}
RUN echo "$netpyneuiBranch";

ARG INCUBATOR_VER=unknown
RUN /bin/bash -c "INCUBATOR_VER=${INCUBATOR_VER} source activate snakes && pip install jupyterhub==0.9.4"

# Clone NetPyNE-UI and install the development version
RUN wget https://github.com/MetaCell/NetPyNE-UI/archive/$netpyneuiBranch.zip -q
RUN unzip $netpyneuiBranch.zip
Expand All @@ -15,4 +23,8 @@ WORKDIR /home/jovyan
RUN git clone https://github.com/Neurosim-lab/netpyne_workspace
WORKDIR /home/jovyan/netpyne_workspace
RUN ln -sfn /home/jovyan/work/NetPyNE-UI-$netpyneuiBranch/netpyne_ui/tests tests
CMD /bin/bash -c "source activate snakes && exec jupyter notebook --debug --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui"

# Copy jupyterhub_config
# RUN cp /home/jovyan/work/NetPyNE-UI-$netpyneuiBranch/jupyterhub_config.py .

CMD /bin/bash -c "source activate snakes && exec jupyterhub-singleuser --debug --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui"
38 changes: 38 additions & 0 deletions jupyter_hub/jupyterhub_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Class for authenticating users.
#
# This should be a class with the following form:
#
# - constructor takes one kwarg: `config`, the IPython config object.
#
# with an authenticate method that:
# _class
# - is a coroutine (asyncio or tornado)
# - returns username on success, None on failure
# - takes two arguments: (handler, data),
# where `handler` is the calling web.RequestHandler,
# and `data` is the POST form data from the login page.
#c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator'
# c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator'
# c.DummyAuthenticator.password = "dummypassword"
c.JupyterHub.authenticator_class = 'tmpauthenticator.TmpAuthenticator'

## The class to use for spawning single-user servers.
#
# Should be a subclass of Spawner.
#c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner'
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
from jupyter_client.localinterfaces import public_ips
ip = public_ips()[0]
c.JupyterHub.hub_ip = ip
c.DockerSpawner.image = 'netpyne_ui_jupyterspawner'
c.DockerSpawner.remove_containers = True
c.DockerSpawner.remove = True
c.DockerSpawner.debug = True
c.DockerSpawner.network_name='jupyterhub_network'

## Extra arguments to be passed to the single-user server. Only works for the LocalProcessSpawner
#
# Some spawners allow shell-style expansion here, allowing you to use
# environment variables here. Most, including the default, do not. Consult the
# documentation for your spawner to verify!
# c.Spawner.args = ['--library=netpyne_ui', '--NotebookApp.default_url=/geppetto', '--NotebookApp.token=''']
14 changes: 14 additions & 0 deletions k8s/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM jupyterhub/k8s-hub:0.9.0

COPY --chown=1000:1000 templates/page.html /usr/local/share/jupyterhub/templates/page.html
COPY --chown=1000:1000 templates/404.html /usr/local/share/jupyterhub/templates/404.html
COPY --chown=1000:1000 templates/spawn_pending.html /usr/local/share/jupyterhub/templates/spawn_pending.html
COPY --chown=1000:1000 static/jupyter.png /usr/local/share/jupyterhub/static/images/jupyter.png
COPY --chown=1000:1000 static/jupyter.png /usr/local/share/jupyterhub/static/images/jupyterhub-80.png
COPY --chown=1000:1000 static/favicon.ico /usr/local/share/jupyterhub/static/favicon.ico
COPY --chown=1000:1000 static/favicon.ico /usr/local/share/jupyterhub/static/images/favicon.ico
COPY --chown=1000:1000 auth.py /usr/local/lib/python3.6/dist-packages/tmpauthenticator/__init__.py
COPY --chown=1000:1000 js/EventSource.js /usr/local/share/jupyterhub/static/js/EventSource.js


CMD ["jupyterhub", "--config", "/srv/jupyterhub_config.py"]
16 changes: 16 additions & 0 deletions k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# k8s deployment

- Deploy on minikube runnig

```bash
kubectl create -ns netpyne
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
```

- Access the hub by running

```bash
minikube service list
```

and use the url corresponding to nepyne proxy-public on port 80
Loading

0 comments on commit 19be45c

Please sign in to comment.