Skip to content

Commit d93b2cc

Browse files
authored
Merge pull request #587 from MetaCell/release/0.8.1
Release/0.8.1 to master
2 parents 0f50696 + 4a148d0 commit d93b2cc

Some content is hidden

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

82 files changed

+4231
-1810
lines changed

.dockerignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ notebook.ipynb
1010
Dockerfile
1111
Dockerfile_base
1212
Dockerfile_dev
13-
node_modules
13+
webapp/node_modules
1414
webapp/build
1515
webapp/geppetto-client
1616
workspace
@@ -23,4 +23,5 @@ app.log
2323
/.pytest_cache
2424
.jupyter-config
2525
**/*.pyc
26-
**/__pycache__
26+
**/__pycache__
27+
app.log

Dockerfile

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,67 @@
1-
FROM frodriguez4600/jupyter-neuron:v7.8.0
2-
ARG INSTALLATION_FOLDER=/home/jovyan/work/NetPyNE-UI
3-
ARG NETPYNE_VERSION=development
4-
ARG WORKSPACE_VERSION=nov2020
1+
FROM node:13.14 as jsbuild
2+
3+
WORKDIR /app
4+
5+
COPY --chown=1000:1000 webapp/package.json .
6+
COPY --chown=1000:1000 webapp/yarn.lock .
7+
8+
9+
RUN yarn install --network-timeout 1000000000
10+
11+
COPY webapp/ .
12+
RUN yarn build-dev
13+
14+
15+
RUN mv node_modules/@metacell .
16+
RUN rm -Rf node_modules/*
17+
RUN mv @metacell node_modules
18+
19+
###
20+
FROM jupyter/base-notebook:hub-1.5.0
21+
ENV NB_UID=jovyan
22+
ENV FOLDER=netpyne
523
ARG GEPPETTO_VERSION=development
624
ARG BUILD_ARGS=""
725

8-
USER $NB_USER
9-
10-
ENV INSTALLATION_FOLDER=$INSTALLATION_FOLDER
11-
ENV NETPYNE_VERSION=$NETPYNE_VERSION
12-
ENV WORKSPACE_VERSION=$WORKSPACE_VERSION
13-
ENV GEPPETTO_VERSION=$GEPPETTO_VERSION
14-
ENV BUILD_ARGS=$BUILD_ARGS
26+
ENV FOLDER=/home/jovyan/work/NetPyNE-UI
1527

16-
# Install openmpi for parallel simulations
17-
# Important: Have to switch to root to install a package and ensure to switch back to NB user afterwards
1828
USER root
19-
RUN apt-get update && apt-get install -y libopenmpi-dev
20-
USER $NB_USER
2129

22-
WORKDIR /home/jovyan/work
23-
COPY --chown=1000:1000 requirements.txt ${INSTALLATION_FOLDER}/requirements.txt
30+
RUN rm -rf /var/lib/apt/lists
31+
RUN apt-get update -qq &&\
32+
apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev -y
33+
RUN conda install python=3.7 -y
34+
35+
36+
WORKDIR $FOLDER
37+
COPY --chown=1000:1000 requirements.txt requirements.txt
38+
RUN pip install -r requirements.txt --no-cache-dir --prefer-binary
39+
40+
COPY --chown=$NB_UID:1000 . .
41+
COPY --from=jsbuild --chown=$NB_UID:1000 /app webapp
42+
43+
44+
RUN jupyter nbextension install --py --symlink --sys-prefix jupyter_geppetto
45+
RUN jupyter nbextension enable --py --sys-prefix jupyter_geppetto
46+
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
47+
RUN jupyter serverextension enable --py --sys-prefix jupyter_geppetto
48+
49+
RUN python utilities/install.py ${BUILD_ARGS} --geppetto ${GEPPETTO_VERSION} --npm-skip
50+
51+
RUN jupyter labextension disable @jupyterlab/hub-extension
52+
53+
RUN chown $NB_UID .
54+
RUN chown -R $NB_UID workspace
55+
56+
# Temp fixes for eeg plots
57+
RUN wget -P `pip show LFPykit | grep "Location:" | awk '{print $2"/lfpykit"}'` https://www.parralab.org/nyhead/sa_nyhead.mat
58+
59+
USER $NB_UID
60+
61+
62+
EXPOSE 8888
2463

25-
WORKDIR ${INSTALLATION_FOLDER}
26-
RUN pip install -r requirements.txt
2764

28-
COPY --chown=1000:1000 . .
29-
WORKDIR ${INSTALLATION_FOLDER}/utilities
3065

31-
RUN npm install --global yarn
32-
RUN npm install --global yalc
33-
RUN python install.py ${BUILD_ARGS} --geppetto ${GEPPETTO_VERSION}
3466

35-
WORKDIR ${INSTALLATION_FOLDER}
3667

37-
RUN pip install -r requirements-test.txt
38-
RUN pytest tests/backend
39-
CMD /bin/bash -c "jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True"

k8s/cf_values.yaml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,19 @@ hub:
22
image:
33
name: gcr.io/metacellllc/netpyne-hub
44
pullPolicy: IfNotPresent
5-
5+
allowNamedServers: true
66
resources:
77
requests:
88
cpu: 100m
99
memory: 128Mi
10-
11-
allowNamedServers: true
1210
namedServerLimitPerUser: 2
1311
shutdownOnLogout: true
14-
1512
extraConfig:
1613
timing: |
17-
c.JupyterHub.allow_named_servers = True
18-
c.Spawner.port = 8000
19-
c.Spawner.http_timeout = 300
20-
c.Spawner.start_timeout = 300
2114
c.Spawner.notebook_dir = '/home/jovyan/work/NetPyNE-UI'
2215
c.Spawner.default_url = '/geppetto'
23-
c.Spawner.debug = True
2416
spawner: >-
25-
c.Spawner.args = ["--library=netpyne_ui", "--NotebookApp.disable_check_xsrf=True"]
26-
27-
scheduling:
28-
userScheduler:
29-
replicas: 1
30-
31-
auth:
32-
type: tmp
33-
17+
c.Spawner.args = ["--library=netpyne_ui"]
3418
singleuser:
3519
storage:
3620
type: none
@@ -54,4 +38,4 @@ cull:
5438
maxAge: 0
5539

5640
debug:
57-
enabled: false
41+
enabled: false

netpyne_ui/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1+
import logging
2+
import sys
3+
import os
4+
15
from jupyter_geppetto.webapi import RouteManager
26
from netpyne_ui import api
7+
from netpyne_ui.constants import HERE
38
import sentry_sdk
49

510
sentry_sdk.init(
611
"https://[email protected]/6"
712
)
813

14+
def init_eeg():
15+
import sys
16+
from netpyne_ui.constants import HERE
17+
# FIXES library asking for input to download
18+
sys.stdin = open(os.path.join(HERE, "resources/stdin.txt"),'r')
19+
from lfpykit.eegmegcalc import NYHeadModel
20+
try:
21+
NYHeadModel() # Downloads the model if does not exist
22+
except:
23+
logging.error("Error initializing the EEG head model", exc_info=True)
24+
25+
from multiprocessing import Process
26+
thread = Process(target = init_eeg)
27+
thread.start()
28+
29+
930
RouteManager.add_controller(api.NetPyNEController)
31+
32+

netpyne_ui/experiments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def edit_experiment(name: str, experiment: dict):
7474

7575
if exp.state != model.ExperimentState.DESIGN:
7676
raise ExperimentsError(
77-
f"Can only edit experiment in f{model.ExperimentState.DESIGN} state"
77+
f"Can only edit experiment in {model.ExperimentState.DESIGN} state"
7878
)
7979

8080
updated_exp = from_dict(model.Experiment, experiment)

0 commit comments

Comments
 (0)