Skip to content

Commit

Permalink
Simplify netpyne build
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Nov 7, 2023
1 parent f532f2d commit 59c587a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 107 deletions.
87 changes: 1 addition & 86 deletions applications/netpyne/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,90 +1,5 @@
FROM node:14 as jsbuild
ENV REPO=https://github.com/MetaCell/NetPyNE-UI.git
ENV BRANCH_TAG=release/1.0.0
ENV FOLDER=netpyne
RUN echo "no-cache 2023-7-14"
RUN git clone $REPO -b $BRANCH_TAG $FOLDER
RUN rm -Rf .git

COPY overrides/geppetto/GeppettoConfiguration.json $FOLDER/webapp/GeppettoConfiguration.json

WORKDIR $FOLDER/webapp
RUN yarn install --network-timeout 1000000000
RUN yarn build-dev

RUN rm -Rf node_modules/*



###
FROM jupyter/base-notebook:hub-1.4.2
ENV NB_UID=jovyan
ENV FOLDER=netpyne
ENV NP_LFPYKIT_HEAD_FILE=/home/jovyan/nyhead.mat

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
RUN apt-get install openjdk-11-jre-headless -y
RUN conda install python=3.7 -y


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

COPY --from=jsbuild --chown=1000:1000 $FOLDER .

# ToDo: fixme, for now remove the jupyter hub config json file because it overrides the default
# and thus removes the frame ancestor cors settings
RUN rm -f ~/.jupyter/*.json
RUN chown $NB_UID .
RUN chown $NB_UID /opt
RUN rm -Rf workspace

USER $NB_UID

# sym link workspace pvc to $FOLDER
RUN mkdir -p /opt/workspace
RUN mkdir -p /opt/user




ENV NEURON_HOME=/opt/conda


USER root

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 --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
python utilities/install.py --npm-skip --no-test
FROM gcr.io/metacellllc/netpyne-ui:1.0.0-osb

COPY overrides/requirements.txt overrides/requirements.txt
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
pip install -r overrides/requirements.txt

RUN mv workspace /opt/workspace/tutorials
RUN chown -R $NB_UID /opt/workspace/tutorials
RUN ln -s /opt/workspace workspace

RUN jupyter labextension disable @jupyterlab/hub-extension
RUN wget --no-check-certificate -O $NP_LFPYKIT_HEAD_FILE https://www.parralab.org/nyhead/sa_nyhead.mat

USER $NB_UID


EXPOSE 8888

ENTRYPOINT ["tini", "-g", "--"]



CMD ./NetPyNE-UI
21 changes: 0 additions & 21 deletions applications/netpyne/overrides/geppetto/GeppettoConfiguration.json

This file was deleted.

0 comments on commit 59c587a

Please sign in to comment.