-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #825 from MetaCell/release/1.1.0
sync master
- Loading branch information
Showing
71 changed files
with
5,870 additions
and
8,694 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,101 @@ | ||
FROM node:14.21.3-bullseye as jsbuild | ||
FROM node:18 as jsbuild | ||
|
||
WORKDIR /app | ||
|
||
COPY --chown=1000:1000 webapp/package.json . | ||
COPY --chown=1000:1000 webapp/yarn.lock . | ||
ENV FOLDER=netpyne | ||
|
||
WORKDIR $FOLDER/webapp | ||
COPY webapp/package.json . | ||
COPY webapp/yarn.lock . | ||
|
||
RUN yarn install --network-timeout 1000000000 | ||
|
||
COPY webapp/ . | ||
COPY webapp . | ||
RUN yarn build-dev | ||
|
||
|
||
RUN rm -Rf node_modules/* | ||
### Download on a separate stage to run in parallel with buildkit | ||
FROM jupyter/base-notebook:hub-1.5.0 as downloads | ||
USER root | ||
RUN wget --no-check-certificate -O /nyhead.mat https://www.parralab.org/nyhead/sa_nyhead.mat | ||
|
||
### | ||
FROM jupyter/base-notebook:hub-1.5.0 | ||
ENV NB_UID=jovyan | ||
ENV FOLDER=netpyne | ||
ARG BUILD_ARGS="" | ||
ARG WORKSPACE_VERSION=master | ||
# ARG GEPPETTO_VERSION=development | ||
# ARG NETPYNE_VERSION=master | ||
|
||
ENV FOLDER=/home/jovyan/work/NetPyNE-UI | ||
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 openjdk-11-jre-headless -y -y | ||
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 --chown=1000:1000 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 --chown=1000:1000 requirements.txt requirements.txt | ||
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\ | ||
pip install -r requirements.txt --prefer-binary | ||
|
||
|
||
# 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 | ||
# sym link workspace pvc to $FOLDER | ||
RUN mkdir -p /opt/workspace | ||
RUN mkdir -p /opt/user | ||
|
||
COPY netpyne_ui netpyne_ui | ||
COPY utilities utilities | ||
COPY setup.py . | ||
COPY tests tests | ||
COPY NetPyNE-UI . | ||
COPY README.rst . | ||
COPY requirements-test.txt . | ||
|
||
|
||
USER $NB_UID | ||
|
||
COPY --chown=jovyan:1000 . . | ||
COPY --from=jsbuild --chown=jovyan:1000 /app webapp | ||
|
||
|
||
|
||
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 python utilities/install.py ${BUILD_ARGS} --workspace $WORKSPACE_VERSION | ||
ARG BUILD_ARGS="" | ||
ARG WORKSPACE_VERSION=master | ||
|
||
RUN jupyter labextension disable @jupyterlab/hub-extension | ||
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\ | ||
python utilities/install.py ${BUILD_ARGS} --workspace $WORKSPACE_VERSION --npm-skip | ||
|
||
RUN chown $NB_UID . | ||
RUN chown -R $NB_UID workspace | ||
|
||
# Temp fixes for eeg plots | ||
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 | ||
RUN mv workspace /opt/workspace/tutorials | ||
RUN chown -R $NB_UID /opt/workspace | ||
RUN ln -s /opt/workspace workspace | ||
|
||
RUN jupyter labextension disable @jupyterlab/hub-extension | ||
|
||
COPY --from=downloads --chown=1000:1000 /nyhead.mat $NP_LFPYKIT_HEAD_FILE | ||
COPY --from=jsbuild --chown=1000:1000 $FOLDER/webapp/build webapp/build | ||
|
||
RUN chown -R $NB_UID /home/jovyan/.jupyter | ||
RUN touch app.log && chown $NB_UID app.log | ||
USER $NB_UID | ||
|
||
|
||
EXPOSE 8888 | ||
|
||
ENTRYPOINT ["tini", "-g", "--"] | ||
|
||
|
||
|
||
CMD ./NetPyNE-UI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.