Commit d9ec3a1a authored by René Fritze's avatar René Fritze Committed by René Fritze

[binder] switch to using a common base w/ jupyter stuff already installed

parent 7b868245
......@@ -2,7 +2,7 @@
# the container, local dev needs it in path from mounted src
# we trick docker into fulfilling both roles via a conditional ONBUILD
# if you want to use the local dev setup, see docker/docker-compose.yml
ARG BASE=pymor/testing_py3.7:latest
ARG BASE=pymor/jupyter_py3.7:377847deafeab233e9da24a5094f4ae2684d9a5a
ARG BUILD_ENV=binder
ARG PYPI_MIRROR_TAG=latest
......@@ -13,8 +13,6 @@ FROM $BASE as image_dev
ONBUILD RUN echo "dev image uses mounted pymor" && mkdir /pymor
ONBUILD ENV PYTHONPATH=/pymor/src:${PYTHONPATH}
FROM pymor/pypi-mirror_stable_py3.7:${PYPI_MIRROR_TAG} as dependencies
# select "base" image according to build arg
FROM image_${BUILD_ENV}
MAINTAINER rene.fritze@wwu.de
......@@ -28,33 +26,11 @@ USER root
RUN useradd -d /home/pymor --shell /bin/bash -u ${NB_UID} -o -c "" -m ${NB_USER} && \
chown -R ${NB_USER} /home/pymor /pymor/
# the vispy/pythreejs/k3d need npm/nodejs installed for the jupter lab extension
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt update && apt install nodejs
# do local package install before requirements to avoid conflict
COPY .binder/local_packages /pymor/local_packages/
RUN for i in $(find /pymor/local_packages -maxdepth 1 -mindepth 1 -type d | grep -v keepdir) ; do pip install -e $i ; done
COPY --from=dependencies /pymor/downloads/* /tmp/dependencies/
RUN pip install /tmp/dependencies/*
# at this point setup.py exists only in image_binder
# for the dev image it's only available via the mount at runtime
ADD requirements*.txt /tmp/
RUN /bin/bash -c "pip install jupyterlab && \
jupyter nbextension install --py --symlink --sys-prefix pythreejs && \
jupyter nbextension enable --py --sys-prefix pythreejs && \
jupyter labextension install jupyter-threejs && \
pip install nbresuse jupyter_contrib_nbextensions && \
jupyter contrib nbextension install --sys-prefix && \
jupyter nbextension enable collapsible_headings/main && \
jupyter nbextension enable codefolding/main && \
jupyter nbextension enable notify/notify && \
jupyter nbextension enable scroll_down/main && \
([[ -e /pymor/setup.py ]] && pip install /pymor[docs,ci,full] || echo 'no install needed') && \
rm -rf /pymor/local_packages "
ADD .binder/dev-entrypoint.bash /usr/local/bin/
ADD .binder/ipython_kernel_config.py /etc/ipython/
RUN bash -c "([[ -e /pymor/setup.py ]] && pip install /pymor[docs,ci,full] || echo 'no install needed') && \
rm -rf /pymor/local_packages"
USER ${NB_USER}
ENV JUPYTER_TOKEN=${PYMOR_JUPYTER_TOKEN} \
......
......@@ -19,7 +19,7 @@ services:
context: ../
dockerfile: .binder/Dockerfile
args:
BASE: pymor/testing_py3.7:${CI_IMAGE_TAG}
BASE: pymor/jupyter_py3.7:${CI_IMAGE_TAG}
PYMOR_JUPYTER_TOKEN: "${PYMOR_JUPYTER_TOKEN}"
PYPI_MIRROR_TAG: ${PYPI_MIRROR_TAG}
NB_USER: "${USER}"
......@@ -41,13 +41,7 @@ services:
bash -c "jupyter notebook --ip 0.0.0.0 --no-browser --notebook-dir=$${NB_DIR} --NotebookApp.disable_check_xsrf=True"
pytest:
build:
context: ../
dockerfile: .binder/local-dev.Dockerfile
args:
BASE: pymor/testing_py3.7:${CI_IMAGE_TAG}
PYPI_MIRROR_TAG: ${PYPI_MIRROR_TAG}
image: pymor_local_dev
image: pymor/jupyter_py3.7:${CI_IMAGE_TAG}
environment:
- PYMOR_PYTEST_MARKER=${PYMOR_PYTEST_MARKER}
- CI_PROJECT_DIR=/src
......
# the docker container for local dev just needs to pypi-mirror dependencies baked in
ARG PYPI_MIRROR_TAG=latest
ARG BASE=pymor/testing_py3.7:latest
FROM pymor/pypi-mirror_stable_py3.7:${PYPI_MIRROR_TAG} as dependencies
FROM ${BASE}
MAINTAINER rene.fritze@wwu.de
COPY --from=dependencies /pymor/downloads/* /tmp/dependencies/
RUN pip install /tmp/dependencies/*
b91332bb45ed1950647b572cc01b550f9009d977
377847deafeab233e9da24a5094f4ae2684d9a5a
......@@ -48,7 +48,7 @@ numpy-git 3 6:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.6:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.6:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "numpy"
......@@ -59,7 +59,7 @@ oldest 3.6:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.6:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.6:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "OLDEST"
......@@ -70,7 +70,7 @@ minimal_cpp_demo:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.7:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.7:377847deafeab233e9da24a5094f4ae2684d9a5a
script: ./.ci/gitlab/cpp_demo.bash
......@@ -110,7 +110,7 @@ Vanilla 3 6:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.6:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.6:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "Vanilla"
......@@ -120,7 +120,7 @@ PIP_ONLY 3 6:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.6:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.6:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "PIP_ONLY"
......@@ -130,7 +130,7 @@ NOTEBOOKS 3 6:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.6:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.6:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "NOTEBOOKS"
......@@ -140,7 +140,7 @@ MPI 3 6:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.6:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.6:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "MPI"
......@@ -150,7 +150,7 @@ Vanilla 3 7:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.7:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.7:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "Vanilla"
......@@ -160,7 +160,7 @@ PIP_ONLY 3 7:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.7:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.7:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "PIP_ONLY"
......@@ -170,7 +170,7 @@ NOTEBOOKS 3 7:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.7:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.7:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "NOTEBOOKS"
......@@ -180,7 +180,7 @@ MPI 3 7:
- name: pymor/pypi-mirror_stable_py3.6:debcff651a903b10fe5d73e6a7941790cbcfc5b8
alias: pypi_mirror
image: pymor/testing_py3.7:b91332bb45ed1950647b572cc01b550f9009d977
image: pymor/testing_py3.7:377847deafeab233e9da24a5094f4ae2684d9a5a
variables:
PYMOR_PYTEST_MARKER: "MPI"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment