Skip to content

Commit 3e7bc93

Browse files
authored
Merge pull request #55 from MetaCell/travis_fix
Travis fix
2 parents 3ebc5ea + 379c642 commit 3e7bc93

6 files changed

Lines changed: 69 additions & 36 deletions

File tree

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ env:
99
global:
1010
secure: dn0FPQ5IG4M/3kdwnyI78ElQ308Vc3QnKAvkWfwMFb8QxDqxQdnTo7AV1qTMtbLrDNkeEWIgi4nc7jmXNtvGTwOfhAULVh6606Qs5B+ezTdwzajbbFMI8SKQx/pnTojOMu8dx7V4lMoR/YWcojR0VC1IWVC62TGbSB1k5BDGgH0=
1111
install:
12-
- git clone --quiet -b $TRAVIS_BRANCH https://github.com/MetaCell/geppetto-netpyne.git
12+
- git clone --quiet https://github.com/MetaCell/geppetto-netpyne.git
13+
- cd geppetto-netpyne
14+
- 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
15+
- cd ..
1316
- npm install --silent -g phantomjs
1417
- npm install --silent -g casperjs
1518
- npm install --silent -g slimerjs
@@ -38,7 +41,7 @@ before_script:
3841
- export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
3942

4043
script:
41-
- travis_retry docker build -t="netpyne-ui" --build-arg netpyneuiBranch=$TRAVIS_BRANCH .
44+
- travis_retry docker build -t="netpyne-ui" --build-arg netpyneuiBranch=$TRAVIS_BRANCH -f="./Dockerfile_dev" .
4245
- travis_retry docker run -t -dit --name=netpyne-ui_container -h localhost -p 8888:8888 netpyne-ui:latest
4346
- cd $TRAVIS_BUILD_DIR/ && ls
4447
- cd geppetto-netpyne && ls

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ RUN make --silent install -j4
4747

4848
# Switch to non sudo, create a Python 2 virtual environment
4949
USER $NB_USER
50-
RUN conda update conda
50+
# Commenting out the conda update things broke!
51+
# RUN conda update conda
5152
RUN conda create --name snakes python=2
5253

5354
# Install NEURON python

Dockerfile_dev

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ RUN make --silent install -j4
5151

5252
# Switch to non sudo, create a Python 2 virtual environment
5353
USER $NB_USER
54-
RUN conda update conda
54+
# Commenting out the conda update things broke!
55+
# RUN conda update conda
5556
RUN conda create --name snakes python=2
5657

5758
# Install NEURON python
@@ -67,7 +68,7 @@ RUN wget https://github.com/MetaCell/NetPyNE-UI/archive/$netpyneuiBranch.zip
6768
RUN unzip $netpyneuiBranch.zip
6869
WORKDIR NetPyNE-UI-$netpyneuiBranch/utilities
6970
RUN /bin/bash -c "source activate snakes && python --version"
70-
RUN /bin/bash -c "source activate snakes && exec python install.py"
71+
RUN /bin/bash -c "source activate snakes && exec python install.py branch $netpyneuiBranch"
7172
WORKDIR /home/jovyan
7273
RUN git clone https://github.com/Neurosim-lab/netpyne_workspace
7374
WORKDIR /home/jovyan/netpyne_workspace

netpyne_ui/netpyne_geppetto.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,10 @@ def globalMessageHandler(identifier, command, parameters):
452452
response = eval(command + '(*parameters)')
453453
GeppettoJupyterModelSync.events_controller.triggerEvent(
454454
"receive_python_message", {'id': identifier, 'response': response})
455-
except Exception as e:
456-
return netpyne_geppetto.getJSONError("Unhandle exception in Global Message Handler",traceback.format_exc())
455+
except:
456+
response = netpyne_geppetto.getJSONError("Error while executing command "+command,traceback.format_exc())
457+
GeppettoJupyterModelSync.events_controller.triggerEvent(
458+
"receive_python_message", {'id': identifier, 'response': response})
457459

458460

459461
def configure_logging():

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="netpyne_ui",
5-
version="0.3",
5+
version="0.4",
66
url="https://github.com/MetaCell/NetPyNE-UI",
77
author="MetaCell",
88
author_email="info@metacell.us",
@@ -28,6 +28,6 @@
2828
],
2929
install_requires=[
3030
'jupyter_geppetto==0.4.1',
31-
'netpyne==0.7.8.1'
31+
'netpyne==0.7.8'
3232
],
3333
)

utilities/install.py

Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,73 @@
22
from setuptools.command.install import install
33
import subprocess
44
import json
5-
import os
5+
import os, sys
66
from shutil import copyfile
77

8-
# Cloning Repos
9-
print("Cloning PyGeppetto...")
10-
subprocess.call(['git', 'clone', '-b', 'v0.4.1-M1', 'https://github.com/openworm/pygeppetto.git'], cwd='../')
11-
subprocess.call(['pip', 'install', '-e', '.'], cwd='../pygeppetto/')
8+
branch = "development"
9+
10+
#by default clones branch (which can be passed as a parameter python install.py branch test_branch)
11+
#if branch doesnt exist clones the default_branch
12+
def clone(repository, folder, default_branch, cwdp='', recursive = False):
13+
global branch
14+
print("Cloning "+repository)
15+
if recursive:
16+
subprocess.call(['git', 'clone', '--recursive', repository], cwd='./'+cwdp)
17+
else:
18+
subprocess.call(['git', 'clone', repository], cwd='./'+cwdp)
19+
checkout(folder, default_branch, cwdp)
1220

13-
print("Cloning NetPyNE...")
14-
subprocess.call(['git', 'clone', '-b', 'v0.7.8_UI0.3Release', 'https://github.com/Neurosim-lab/netpyne.git'], cwd='../')
15-
subprocess.call(['pip', 'install', '-e', '.'], cwd='../netpyne/')
21+
def checkout(folder, default_branch, cwdp):
22+
currentPath = os.getcwd()
23+
print currentPath
24+
newPath = currentPath+"/"+cwdp+folder
25+
print newPath
26+
os.chdir(newPath)
27+
python_git=subprocess.Popen("git branch -a",shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
28+
outstd,errstd=python_git.communicate()
29+
if branch in outstd:
30+
subprocess.call(['git', 'checkout', branch], cwd='./')
31+
else:
32+
subprocess.call(['git', 'checkout', default_branch], cwd='./')
33+
os.chdir(currentPath)
1634

17-
print("Cloning Geppetto Jupyter (Python package)...")
18-
subprocess.call(['git', 'clone', '--recursive', '-b', 'v0.4.1-M1', 'https://github.com/openworm/org.geppetto.frontend.jupyter.git'], cwd='../')
35+
def main(argv):
36+
global branch
37+
if(len(argv) > 0):
38+
if(argv[0] == 'branch'):
39+
branch = argv[1]
1940

20-
print("Cloning Geppetto Frontend")
21-
subprocess.call(['git', 'checkout', 'v0.4.1-M1'], cwd='../org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/')
41+
if __name__ == "__main__":
42+
main(sys.argv[1:])
2243

23-
print("Cloning Geppetto NetPyNE Configuration ...")
24-
subprocess.call(['git', 'clone', 'https://github.com/MetaCell/geppetto-netpyne.git'],
25-
cwd='../org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/extensions/')
44+
os.chdir(os.getcwd()+"/../")
45+
# Cloning Repos
46+
clone('https://github.com/openworm/pygeppetto.git','pygeppetto','v0.4.1-M1')
47+
subprocess.call(['pip', 'install', '-e', '.'], cwd='./pygeppetto/')
2648

27-
subprocess.call(['git', 'checkout', '0.3'], cwd='../org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/extensions/geppetto-netpyne/')
49+
clone('https://github.com/Neurosim-lab/netpyne.git','netpyne','metadata')
50+
subprocess.call(['pip', 'install', '-e', '.'], cwd='./netpyne/')
51+
52+
clone('https://github.com/openworm/org.geppetto.frontend.jupyter.git','org.geppetto.frontend.jupyter','v0.4.1-M1','', True )
53+
checkout('geppetto', 'v0.4.1-M1','org.geppetto.frontend.jupyter/src/jupyter_geppetto/')
54+
clone('https://github.com/MetaCell/geppetto-netpyne.git','geppetto-netpyne','0.3','org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/extensions/')
2855

2956
print("Enabling Geppetto NetPyNE Extension ...")
30-
geppetto_configuration = os.path.join(os.path.dirname(__file__), 'GeppettoConfiguration.json')
31-
copyfile(geppetto_configuration, '../org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/GeppettoConfiguration.json')
57+
geppetto_configuration = os.path.join(os.path.dirname(__file__), './utilities/GeppettoConfiguration.json')
58+
copyfile(geppetto_configuration, './org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/GeppettoConfiguration.json')
3259

3360
# Installing and building
3461
print("NPM Install and build for Geppetto Frontend ...")
35-
subprocess.call(['npm', 'install'], cwd='../org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/')
36-
subprocess.call(['npm', 'run', 'build-dev-noTest'], cwd='../org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/')
62+
subprocess.call(['npm', 'install'], cwd='./org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/')
63+
subprocess.call(['npm', 'run', 'build-dev-noTest'], cwd='./org.geppetto.frontend.jupyter/src/jupyter_geppetto/geppetto/src/main/webapp/')
3764

3865
print("Installing jupyter_geppetto python package ...")
39-
subprocess.call(['pip', 'install', '-e', '.'], cwd='../org.geppetto.frontend.jupyter')
66+
subprocess.call(['pip', 'install', '-e', '.'], cwd='./org.geppetto.frontend.jupyter')
4067
print("Installing jupyter_geppetto Jupyter Extension ...")
41-
subprocess.call(['jupyter', 'nbextension', 'install', '--py', '--symlink', '--user', 'jupyter_geppetto'], cwd='../org.geppetto.frontend.jupyter')
42-
subprocess.call(['jupyter', 'nbextension', 'enable', '--py', '--user', 'jupyter_geppetto'], cwd='../org.geppetto.frontend.jupyter')
43-
subprocess.call(['jupyter', 'nbextension', 'enable', '--py', 'widgetsnbextension'], cwd='../org.geppetto.frontend.jupyter')
44-
subprocess.call(['jupyter', 'serverextension', 'enable', '--py', 'jupyter_geppetto'], cwd='../org.geppetto.frontend.jupyter')
68+
subprocess.call(['jupyter', 'nbextension', 'install', '--py', '--symlink', '--user', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')
69+
subprocess.call(['jupyter', 'nbextension', 'enable', '--py', '--user', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')
70+
subprocess.call(['jupyter', 'nbextension', 'enable', '--py', 'widgetsnbextension'], cwd='./org.geppetto.frontend.jupyter')
71+
subprocess.call(['jupyter', 'serverextension', 'enable', '--py', 'jupyter_geppetto'], cwd='./org.geppetto.frontend.jupyter')
4572

4673
print("Installing NetPyNE UI python package ...")
47-
subprocess.call(['pip', 'install', '-e', '.'], cwd='..')
48-
74+
subprocess.call(['pip', 'install', '-e', '.'], cwd='.')

0 commit comments

Comments
 (0)