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

[binder] use CI_IMAGE_TAG as truth source for image base

parent d9ec3a1a
# THIS FILE IS AUTOGENERATED FROM .binder/Dockerfile.in
# the docker container for binder needs pymor installed entirely inside
# 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/jupyter_py3.7:377847deafeab233e9da24a5094f4ae2684d9a5a
ARG BUILD_ENV=binder
ARG PYPI_MIRROR_TAG=latest
FROM $BASE as image_binder
ONBUILD ADD . /pymor
......
# THIS FILE IS AUTOGENERATED FROM .binder/Dockerfile.in
# the docker container for binder needs pymor installed entirely inside
# 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/jupyter_py3.7:CI_IMAGE_TAG
ARG BUILD_ENV=binder
FROM $BASE as image_binder
ONBUILD ADD . /pymor
FROM $BASE as image_dev
ONBUILD RUN echo "dev image uses mounted pymor" && mkdir /pymor
ONBUILD ENV PYTHONPATH=/pymor/src:${PYTHONPATH}
# select "base" image according to build arg
FROM image_${BUILD_ENV}
MAINTAINER rene.fritze@wwu.de
# binder wants to set the NB_ vars anyways, so we use it to service both setups
ARG NB_USER
ARG NB_UID
ARG PYMOR_JUPYTER_TOKEN
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/
# 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
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} \
USER=${NB_USER} \
HOME=/home/pymor
ENTRYPOINT []
WORKDIR /pymor/notebooks
......@@ -21,7 +21,6 @@ services:
args:
BASE: pymor/jupyter_py3.7:${CI_IMAGE_TAG}
PYMOR_JUPYTER_TOKEN: "${PYMOR_JUPYTER_TOKEN}"
PYPI_MIRROR_TAG: ${PYPI_MIRROR_TAG}
NB_USER: "${USER}"
NB_UID: 1000
BUILD_ENV: dev
......
......@@ -9,6 +9,8 @@ cd "${PYMOR_ROOT}"
set -eux
# make sure binder setup is current
make docker_file && git diff --exit-code .binder/Dockerfile
# make sure CI setup is current
./.ci/gitlab/template.ci.py && git diff --exit-code .ci/gitlab/ci.yml
# check if requirements files are up-to-date
......
......@@ -158,7 +158,7 @@ submit oldest 3.6:
verify setup.py:
extends: .test_base
image: python:3.5-alpine
stage: install_checks
stage: sanity
script:
- python setup.py egg_info
......
......@@ -54,7 +54,10 @@ docs:
PYTHONPATH=${PWD}/src/:${PYTHONPATH} make -C docs html
# Docker targets
docker_image:
docker_file:
sed "s;CI_IMAGE_TAG;$(CI_IMAGE_TAG);g" .binder/Dockerfile.in > .binder/Dockerfile
docker_image: docker_file
PYPI_MIRROR_TAG=$(PYPI_MIRROR_TAG) CI_IMAGE_TAG=$(CI_IMAGE_TAG) $(DOCKER_COMPOSE) build
docker_docs: docker_image
......
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