Skip to content

Commit 594146c

Browse files
authored
Merge pull request #758 from MetaCell/release/1.0.0
Release/1.0.0
2 parents 3348ee0 + e1c3a7c commit 594146c

File tree

168 files changed

+35050
-6166
lines changed

Some content is hidden

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

168 files changed

+35050
-6166
lines changed

.github/workflows/tests.yml

+258
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
name: Tests Workflow
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the specified branch
6+
push:
7+
branches:
8+
- "master"
9+
- "development"
10+
pull_request:
11+
branches:
12+
- "master"
13+
- "development"
14+
15+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
16+
jobs:
17+
EEG_Dipole-test:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-20.04
20+
container: lironavon/docker-puppeteer-container:14.16.0
21+
env:
22+
CI: true
23+
steps:
24+
- uses: actions/checkout@v1
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v1
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache-dependency-path: frontend/e2e/tests/package-lock.json
30+
- name: EEG and Dipole Plot snapshot test using Tut#1
31+
run: |
32+
cd tests/frontend/e2e
33+
#install dependencies
34+
npm ci
35+
# run EEG and Dipole Plot test
36+
npm run EEG_Dipole_test
37+
env:
38+
CI: true
39+
Experiment_Manager-test:
40+
# The type of runner that the job will run on
41+
runs-on: ubuntu-20.04
42+
container: lironavon/docker-puppeteer-container:14.16.0
43+
env:
44+
CI: true
45+
steps:
46+
- uses: actions/checkout@v1
47+
- name: Use Node.js ${{ matrix.node-version }}
48+
uses: actions/setup-node@v1
49+
with:
50+
node-version: ${{ matrix.node-version }}
51+
cache-dependency-path: frontend/e2e/tests/package-lock.json
52+
- name: Experiment Manager snapshot test using Tut#1
53+
run: |
54+
cd tests/frontend/e2e
55+
#install dependencies
56+
npm ci
57+
# run Experiment Manager test
58+
npm run Experiment_Manager_test
59+
env:
60+
CI: true
61+
Control_Panel-test:
62+
# The type of runner that the job will run on
63+
runs-on: ubuntu-20.04
64+
container: lironavon/docker-puppeteer-container:14.16.0
65+
env:
66+
CI: true
67+
steps:
68+
- uses: actions/checkout@v1
69+
- name: Use Node.js ${{ matrix.node-version }}
70+
uses: actions/setup-node@v1
71+
with:
72+
node-version: ${{ matrix.node-version }}
73+
cache-dependency-path: frontend/e2e/tests/package-lock.json
74+
- name: Control Panel test using Tut#2
75+
run: |
76+
cd tests/frontend/e2e
77+
#install dependencies
78+
npm ci
79+
# run Control Panel test
80+
npm run Control_Panel_test
81+
env:
82+
CI: true
83+
Save_and_Open_File-test:
84+
# The type of runner that the job will run on
85+
runs-on: ubuntu-20.04
86+
container: lironavon/docker-puppeteer-container:14.16.0
87+
env:
88+
CI: true
89+
steps:
90+
- uses: actions/checkout@v1
91+
- name: Use Node.js ${{ matrix.node-version }}
92+
uses: actions/setup-node@v1
93+
with:
94+
node-version: ${{ matrix.node-version }}
95+
cache-dependency-path: frontend/e2e/tests/package-lock.json
96+
- name: Test for Opening and Saving a file
97+
run: |
98+
cd tests/frontend/e2e
99+
#install dependencies
100+
npm ci
101+
# run Control Panel test
102+
npm run Save_Open_File_test
103+
env:
104+
CI: true
105+
RxD-test:
106+
# The type of runner that the job will run on
107+
runs-on: ubuntu-20.04
108+
container: lironavon/docker-puppeteer-container:14.16.0
109+
env:
110+
CI: true
111+
steps:
112+
- uses: actions/checkout@v1
113+
- name: Use Node.js ${{ matrix.node-version }}
114+
uses: actions/setup-node@v1
115+
with:
116+
node-version: ${{ matrix.node-version }}
117+
cache-dependency-path: frontend/e2e/tests/package-lock.json
118+
- name: Test for RxD plot
119+
run: |
120+
cd tests/frontend/e2e
121+
#install dependencies
122+
npm ci
123+
# run RxD Plot test
124+
npm run RxD_test
125+
env:
126+
CI: true
127+
Tutorial_1-SmokeTest:
128+
# The type of runner that the job will run on
129+
runs-on: ubuntu-20.04
130+
container: lironavon/docker-puppeteer-container:14.16.0
131+
env:
132+
CI: true
133+
steps:
134+
- uses: actions/checkout@v1
135+
- name: Use Node.js ${{ matrix.node-version }}
136+
uses: actions/setup-node@v1
137+
with:
138+
node-version: ${{ matrix.node-version }}
139+
cache-dependency-path: frontend/e2e/tests/package-lock.json
140+
- name: Tutorial 1 Plot Tests
141+
run: |
142+
cd tests/frontend/e2e
143+
#install dependencies
144+
npm ci
145+
# run Tutorial 1 Plot Tests
146+
npm run Tutorial_1_test
147+
env:
148+
CI: true
149+
Tutorial_2-SmokeTest:
150+
# The type of runner that the job will run on
151+
runs-on: ubuntu-20.04
152+
container: lironavon/docker-puppeteer-container:14.16.0
153+
env:
154+
CI: true
155+
steps:
156+
- uses: actions/checkout@v1
157+
- name: Use Node.js ${{ matrix.node-version }}
158+
uses: actions/setup-node@v1
159+
with:
160+
node-version: ${{ matrix.node-version }}
161+
cache-dependency-path: frontend/e2e/tests/package-lock.json
162+
- name: Tutorial 2 Plot Tests
163+
run: |
164+
cd tests/frontend/e2e
165+
#install dependencies
166+
npm ci
167+
# run Tutorial 2 Plot Tests
168+
npm run Tutorial_2_test
169+
env:
170+
CI: true
171+
Tutorial_3a-SmokeTest:
172+
# The type of runner that the job will run on
173+
runs-on: ubuntu-20.04
174+
container: lironavon/docker-puppeteer-container:14.16.0
175+
env:
176+
CI: true
177+
steps:
178+
- uses: actions/checkout@v1
179+
- name: Use Node.js ${{ matrix.node-version }}
180+
uses: actions/setup-node@v1
181+
with:
182+
node-version: ${{ matrix.node-version }}
183+
cache-dependency-path: frontend/e2e/tests/package-lock.json
184+
- name: Tutorial 3a Plot Tests
185+
run: |
186+
cd tests/frontend/e2e
187+
#install dependencies
188+
npm ci
189+
# run Tutorial 3a Plot Tests
190+
npm run Tutorial_3A_test
191+
env:
192+
CI: true
193+
Tutorial_3b-SmokeTest:
194+
# The type of runner that the job will run on
195+
runs-on: ubuntu-20.04
196+
container: lironavon/docker-puppeteer-container:14.16.0
197+
env:
198+
CI: true
199+
steps:
200+
- uses: actions/checkout@v1
201+
- name: Use Node.js ${{ matrix.node-version }}
202+
uses: actions/setup-node@v1
203+
with:
204+
node-version: ${{ matrix.node-version }}
205+
cache-dependency-path: frontend/e2e/tests/package-lock.json
206+
- name: Tutorial 3b Plot Tests
207+
run: |
208+
cd tests/frontend/e2e
209+
#install dependencies
210+
npm ci
211+
# run Tutorial 3b Plot Tests
212+
npm run Tutorial_3B_test
213+
env:
214+
CI: true
215+
Tutorial_3c-SmokeTest:
216+
# The type of runner that the job will run on
217+
runs-on: ubuntu-20.04
218+
container: lironavon/docker-puppeteer-container:14.16.0
219+
env:
220+
CI: true
221+
steps:
222+
- uses: actions/checkout@v1
223+
- name: Use Node.js ${{ matrix.node-version }}
224+
uses: actions/setup-node@v1
225+
with:
226+
node-version: ${{ matrix.node-version }}
227+
cache-dependency-path: frontend/e2e/tests/package-lock.json
228+
- name: Tutorial 3c Plot Tests
229+
run: |
230+
cd tests/frontend/e2e
231+
#install dependencies
232+
npm ci
233+
# run Tutorial 3c Plot Tests
234+
npm run Tutorial_3C_test
235+
env:
236+
CI: true
237+
Tutorial_4-SmokeTest:
238+
# The type of runner that the job will run on
239+
runs-on: ubuntu-20.04
240+
container: lironavon/docker-puppeteer-container:14.16.0
241+
env:
242+
CI: true
243+
steps:
244+
- uses: actions/checkout@v1
245+
- name: Use Node.js ${{ matrix.node-version }}
246+
uses: actions/setup-node@v1
247+
with:
248+
node-version: ${{ matrix.node-version }}
249+
cache-dependency-path: frontend/e2e/tests/package-lock.json
250+
- name: Tutorial 4 Plot Tests
251+
run: |
252+
cd tests/frontend/e2e
253+
#install dependencies
254+
npm ci
255+
# run Tutorial 4 Plot Tests
256+
npm run Tutorial_4_test
257+
env:
258+
CI: true

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ utilities/x86_64
2727
x86_64
2828
.jupyter-config
2929
venv
30+
webapp/build
31+
webapp/.yalc
3032
node_modules
33+
sa_nyhead.mat
34+
workspace

Dockerfile

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:13.14 as jsbuild
1+
FROM node:14.21.3-bullseye as jsbuild
22

33
WORKDIR /app
44

@@ -18,48 +18,50 @@ RUN rm -Rf node_modules/*
1818
FROM jupyter/base-notebook:hub-1.5.0
1919
ENV NB_UID=jovyan
2020
ENV FOLDER=netpyne
21-
ARG GEPPETTO_VERSION=development
2221
ARG BUILD_ARGS=""
22+
ARG WORKSPACE_VERSION=master
23+
# ARG GEPPETTO_VERSION=development
24+
# ARG NETPYNE_VERSION=master
2325

2426
ENV FOLDER=/home/jovyan/work/NetPyNE-UI
2527

2628
USER root
2729

2830
RUN rm -rf /var/lib/apt/lists
2931
RUN apt-get update -qq &&\
30-
apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev -y
32+
apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev openjdk-11-jre-headless -y -y
3133
RUN conda install python=3.7 -y
3234

33-
3435
WORKDIR $FOLDER
3536
COPY --chown=1000:1000 requirements.txt requirements.txt
36-
RUN pip install -r requirements.txt --no-cache-dir --prefer-binary
37+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip && pip install -r requirements.txt --prefer-binary
3738

38-
COPY --chown=$NB_UID:1000 . .
39-
COPY --from=jsbuild --chown=$NB_UID:1000 /app webapp
39+
COPY --chown=jovyan:1000 . .
40+
COPY --from=jsbuild --chown=jovyan:1000 /app webapp
4041

4142

4243
RUN jupyter nbextension install --py --symlink --sys-prefix jupyter_geppetto
4344
RUN jupyter nbextension enable --py --sys-prefix jupyter_geppetto
4445
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
4546
RUN jupyter serverextension enable --py --sys-prefix jupyter_geppetto
4647

47-
RUN python utilities/install.py ${BUILD_ARGS} --geppetto ${GEPPETTO_VERSION} --npm-skip
48+
RUN python utilities/install.py ${BUILD_ARGS} --workspace $WORKSPACE_VERSION
4849

4950
RUN jupyter labextension disable @jupyterlab/hub-extension
5051

5152
RUN chown $NB_UID .
5253
RUN chown -R $NB_UID workspace
5354

5455
# Temp fixes for eeg plots
55-
RUN wget -P `pip show LFPykit | grep "Location:" | awk '{print $2"/lfpykit"}'` https://www.parralab.org/nyhead/sa_nyhead.mat
56+
ENV NEURON_HOME=/opt/conda
57+
# For lfpykit 0.4
58+
# RUN wget -P $(pip show LFPykit | grep "Location:" | awk '{print $2"/lfpykit"}') https://www.parralab.org/nyhead/sa_nyhead.mat
59+
# For lpfykit 0.5
60+
ENV NP_LFPYKIT_HEAD_FILE=/home/jovyan/nyhead.mat
61+
RUN wget --no-check-certificate -O $NP_LFPYKIT_HEAD_FILE https://www.parralab.org/nyhead/sa_nyhead.mat
5662

5763
USER $NB_UID
5864

59-
6065
EXPOSE 8888
6166

6267

63-
64-
65-

NetPyNE-UI

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
CONFIG=$(pwd)/.jupyter-config
33
export JUPYTER_CONFIG_DIR=$CONFIG
4-
exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True
4+
exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --NotebookApp.notebook_dir=workspace --library=netpyne_ui --NotebookApp.disable_check_xsrf=True

netpyne_ui/__init__.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,23 @@
1111
"https://[email protected]/6"
1212
)
1313

14+
HEAD_MODEL_FILE = os.getenv("NP_LFPYKIT_HEAD_FILE", "sa_nyhead.mat")
15+
1416
def init_eeg():
1517
import sys
1618
from netpyne_ui.constants import HERE
1719
# FIXES library asking for input to download
1820
sys.stdin = open(os.path.join(HERE, "resources/stdin.txt"),'r')
1921
from lfpykit.eegmegcalc import NYHeadModel
2022
try:
21-
NYHeadModel() # Downloads the model if does not exist
23+
NYHeadModel(HEAD_MODEL_FILE) # Downloads the model if does not exist
2224
except:
2325
logging.error("Error initializing the EEG head model", exc_info=True)
2426

25-
from multiprocessing import Process
26-
thread = Process(target = init_eeg)
27-
thread.start()
28-
27+
if not os.path.exists(HEAD_MODEL_FILE):
28+
from multiprocessing import Process
29+
thread = Process(target = init_eeg)
30+
thread.start()
2931

3032
RouteManager.add_controller(api.NetPyNEController)
3133

0 commit comments

Comments
 (0)