Skip to content

Commit

Permalink
Merge pull request #758 from MetaCell/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
ddelpiano authored Oct 19, 2023
2 parents 3348ee0 + e1c3a7c commit 594146c
Show file tree
Hide file tree
Showing 168 changed files with 35,050 additions and 6,166 deletions.
258 changes: 258 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
name: Tests Workflow

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the specified branch
push:
branches:
- "master"
- "development"
pull_request:
branches:
- "master"
- "development"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
EEG_Dipole-test:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: EEG and Dipole Plot snapshot test using Tut#1
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run EEG and Dipole Plot test
npm run EEG_Dipole_test
env:
CI: true
Experiment_Manager-test:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Experiment Manager snapshot test using Tut#1
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Experiment Manager test
npm run Experiment_Manager_test
env:
CI: true
Control_Panel-test:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Control Panel test using Tut#2
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Control Panel test
npm run Control_Panel_test
env:
CI: true
Save_and_Open_File-test:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Test for Opening and Saving a file
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Control Panel test
npm run Save_Open_File_test
env:
CI: true
RxD-test:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Test for RxD plot
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run RxD Plot test
npm run RxD_test
env:
CI: true
Tutorial_1-SmokeTest:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Tutorial 1 Plot Tests
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Tutorial 1 Plot Tests
npm run Tutorial_1_test
env:
CI: true
Tutorial_2-SmokeTest:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Tutorial 2 Plot Tests
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Tutorial 2 Plot Tests
npm run Tutorial_2_test
env:
CI: true
Tutorial_3a-SmokeTest:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Tutorial 3a Plot Tests
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Tutorial 3a Plot Tests
npm run Tutorial_3A_test
env:
CI: true
Tutorial_3b-SmokeTest:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Tutorial 3b Plot Tests
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Tutorial 3b Plot Tests
npm run Tutorial_3B_test
env:
CI: true
Tutorial_3c-SmokeTest:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Tutorial 3c Plot Tests
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Tutorial 3c Plot Tests
npm run Tutorial_3C_test
env:
CI: true
Tutorial_4-SmokeTest:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
container: lironavon/docker-puppeteer-container:14.16.0
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: frontend/e2e/tests/package-lock.json
- name: Tutorial 4 Plot Tests
run: |
cd tests/frontend/e2e
#install dependencies
npm ci
# run Tutorial 4 Plot Tests
npm run Tutorial_4_test
env:
CI: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ utilities/x86_64
x86_64
.jupyter-config
venv
webapp/build
webapp/.yalc
node_modules
sa_nyhead.mat
workspace
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:13.14 as jsbuild
FROM node:14.21.3-bullseye as jsbuild

WORKDIR /app

Expand All @@ -18,48 +18,50 @@ RUN rm -Rf node_modules/*
FROM jupyter/base-notebook:hub-1.5.0
ENV NB_UID=jovyan
ENV FOLDER=netpyne
ARG GEPPETTO_VERSION=development
ARG BUILD_ARGS=""
ARG WORKSPACE_VERSION=master
# ARG GEPPETTO_VERSION=development
# ARG NETPYNE_VERSION=master

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

USER root

RUN rm -rf /var/lib/apt/lists
RUN apt-get update -qq &&\
apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev -y
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
RUN conda install python=3.7 -y


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

COPY --chown=$NB_UID:1000 . .
COPY --from=jsbuild --chown=$NB_UID:1000 /app webapp
COPY --chown=jovyan:1000 . .
COPY --from=jsbuild --chown=jovyan:1000 /app webapp


RUN jupyter nbextension install --py --symlink --sys-prefix jupyter_geppetto
RUN jupyter nbextension enable --py --sys-prefix jupyter_geppetto
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
RUN jupyter serverextension enable --py --sys-prefix jupyter_geppetto

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

RUN jupyter labextension disable @jupyterlab/hub-extension

RUN chown $NB_UID .
RUN chown -R $NB_UID workspace

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

USER $NB_UID


EXPOSE 8888





2 changes: 1 addition & 1 deletion NetPyNE-UI
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
CONFIG=$(pwd)/.jupyter-config
export JUPYTER_CONFIG_DIR=$CONFIG
exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True
exec jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --NotebookApp.notebook_dir=workspace --library=netpyne_ui --NotebookApp.disable_check_xsrf=True
12 changes: 7 additions & 5 deletions netpyne_ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
"https://d8bf7e40eec34cb9891f6dd8207b5e83@sentry.metacell.us/6"
)

HEAD_MODEL_FILE = os.getenv("NP_LFPYKIT_HEAD_FILE", "sa_nyhead.mat")

def init_eeg():
import sys
from netpyne_ui.constants import HERE
# FIXES library asking for input to download
sys.stdin = open(os.path.join(HERE, "resources/stdin.txt"),'r')
from lfpykit.eegmegcalc import NYHeadModel
try:
NYHeadModel() # Downloads the model if does not exist
NYHeadModel(HEAD_MODEL_FILE) # Downloads the model if does not exist
except:
logging.error("Error initializing the EEG head model", exc_info=True)

from multiprocessing import Process
thread = Process(target = init_eeg)
thread.start()

if not os.path.exists(HEAD_MODEL_FILE):
from multiprocessing import Process
thread = Process(target = init_eeg)
thread.start()

RouteManager.add_controller(api.NetPyNEController)

Expand Down
Loading

0 comments on commit 594146c

Please sign in to comment.