Skip to content

Commit cbf17ec

Browse files
committed
Image compatibility with OSB tweaks
1 parent e1c3a7c commit cbf17ec

2 files changed

Lines changed: 51 additions & 30 deletions

File tree

Dockerfile

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,88 @@
1-
FROM node:14.21.3-bullseye as jsbuild
1+
FROM node:14 as jsbuild
22

3-
WORKDIR /app
4-
5-
COPY --chown=1000:1000 webapp/package.json .
6-
COPY --chown=1000:1000 webapp/yarn.lock .
3+
ENV FOLDER=netpyne
4+
RUN echo "no-cache 2023-7-14"
75

6+
WORKDIR $FOLDER/webapp
7+
COPY webapp/package.json .
8+
COPY webapp/yarn.lock .
89

910
RUN yarn install --network-timeout 1000000000
1011

11-
COPY webapp/ .
12+
COPY webapp .
1213
RUN yarn build-dev
1314

14-
1515
RUN rm -Rf node_modules/*
1616

17+
18+
1719
###
1820
FROM jupyter/base-notebook:hub-1.5.0
1921
ENV NB_UID=jovyan
2022
ENV FOLDER=netpyne
21-
ARG BUILD_ARGS=""
22-
ARG WORKSPACE_VERSION=master
23-
# ARG GEPPETTO_VERSION=development
24-
# ARG NETPYNE_VERSION=master
25-
26-
ENV FOLDER=/home/jovyan/work/NetPyNE-UI
23+
ENV NP_LFPYKIT_HEAD_FILE=/home/jovyan/nyhead.mat
2724

2825
USER root
2926

3027
RUN rm -rf /var/lib/apt/lists
3128
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 openjdk-11-jre-headless -y -y
29+
apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev -y
30+
RUN apt-get install openjdk-11-jre-headless -y
3331
RUN conda install python=3.7 -y
3432

33+
3534
WORKDIR $FOLDER
36-
COPY --chown=1000:1000 requirements.txt requirements.txt
37-
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip && pip install -r requirements.txt --prefer-binary
35+
COPY --chown=1000:1000 requirements.txt requirements.txt
36+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
37+
pip install -r requirements.txt --prefer-binary
38+
39+
COPY . .
40+
COPY --from=jsbuild --chown=1000:1000 $FOLDER/webapp/build webapp/build
41+
42+
# ToDo: fixme, for now remove the jupyter hub config json file because it overrides the default
43+
# and thus removes the frame ancestor cors settings
44+
RUN rm -f ~/.jupyter/*.json
45+
RUN chown $NB_UID .
46+
RUN chown $NB_UID /opt
47+
RUN rm -Rf workspace
48+
49+
USER $NB_UID
50+
51+
# sym link workspace pvc to $FOLDER
52+
RUN mkdir -p /opt/workspace
53+
RUN mkdir -p /opt/user
3854

39-
COPY --chown=jovyan:1000 . .
40-
COPY --from=jsbuild --chown=jovyan:1000 /app webapp
4155

4256

57+
58+
ENV NEURON_HOME=/opt/conda
59+
60+
61+
USER root
62+
4363
RUN jupyter nbextension install --py --symlink --sys-prefix jupyter_geppetto
4464
RUN jupyter nbextension enable --py --sys-prefix jupyter_geppetto
4565
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
4666
RUN jupyter serverextension enable --py --sys-prefix jupyter_geppetto
4767

48-
RUN python utilities/install.py ${BUILD_ARGS} --workspace $WORKSPACE_VERSION
68+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
69+
python utilities/install.py --npm-skip --no-test
4970

50-
RUN jupyter labextension disable @jupyterlab/hub-extension
5171

52-
RUN chown $NB_UID .
53-
RUN chown -R $NB_UID workspace
72+
RUN mv workspace /opt/workspace/tutorials
73+
RUN chown -R $NB_UID /opt/workspace/tutorials
74+
RUN ln -s /opt/workspace workspace
5475

55-
# Temp fixes for eeg plots
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
76+
RUN jupyter labextension disable @jupyterlab/hub-extension
6177
RUN wget --no-check-certificate -O $NP_LFPYKIT_HEAD_FILE https://www.parralab.org/nyhead/sa_nyhead.mat
6278

6379
USER $NB_UID
6480

81+
6582
EXPOSE 8888
6683

84+
ENTRYPOINT ["tini", "-g", "--"]
85+
86+
6787

88+
CMD ./NetPyNE-UI

webapp/GeppettoConfiguration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"_README" : "http://docs.geppetto.org/en/latest/build.html",
33
"contextPath": "org.geppetto.frontend",
4-
"useSsl": false,
5-
"embedded": false,
4+
"useSsl": true,
5+
"embedded": true,
66
"embedderURL": ["/"],
77
"rootRedirect":"",
88
"noTest": false,

0 commit comments

Comments
 (0)