Skip to content

Commit 35b6d06

Browse files
committed
Merge deployment fixes
2 parents 6dc1526 + 8496995 commit 35b6d06

4 files changed

Lines changed: 63 additions & 56 deletions

File tree

.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: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,66 @@
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
26+
ENV FOLDER=/home/jovyan/work/NetPyNE-UI
927

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
15-
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+
2435

25-
WORKDIR ${INSTALLATION_FOLDER}
26-
RUN pip install -r requirements.txt
36+
WORKDIR $FOLDER
37+
COPY --chown=1000:1000 requirements.txt requirements.txt
38+
RUN pip install -r requirements.txt --no-cache-dir --prefer-binary
2739

28-
COPY --chown=1000:1000 . .
29-
WORKDIR ${INSTALLATION_FOLDER}/utilities
40+
COPY --chown=$NB_UID:1000 . .
41+
COPY --from=jsbuild --chown=$NB_UID:1000 /app webapp
3042

31-
RUN npm install --global yarn
32-
RUN npm install --global yalc
33-
RUN python install.py ${BUILD_ARGS} --geppetto ${GEPPETTO_VERSION}
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+
57+
USER $NB_UID
58+
59+
60+
EXPOSE 8888
3461

3562
# Temp fixes for eeg plots
3663
RUN wget -P `pip show LFPykit | grep "Location:" | awk '{print $2"/lfpykit"}'` https://www.parralab.org/nyhead/sa_nyhead.mat
3764

38-
WORKDIR ${INSTALLATION_FOLDER}
3965

40-
RUN pip install -r requirements-test.txt
41-
RUN pytest tests/backend
42-
CMD /bin/bash -c "jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True"
66+

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

requirements.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ jedi==0.17.0
2323
Jinja2==2.11.2
2424
jsonpickle==2.1.0
2525
jsonschema==3.2.0
26-
jupyter==1.0.0
27-
jupyter-client==6.1.3
28-
jupyter-console==6.1.0
29-
jupyter-core==4.6.3
3026
jupyter_geppetto==1.1.1
31-
jupyter-telemetry==0.0.5
32-
jupyterhub==1.1.0
33-
jupyterlab==2.1.3
27+
jupyter-client==7.0.6
28+
jupyter-core==4.9.1
29+
jupyter-server==1.11.2
30+
jupyterhub==1.5.0
31+
jupyterlab==3.2.4
3432
jupyterthemes==0.20.0
3533
kiwisolver==1.2.0
3634
lesscpy==0.14.0

0 commit comments

Comments
 (0)