Skip to content

Commit

Permalink
Fix docker base image for jupyter-caf-kernel
Browse files Browse the repository at this point in the history
 - Out of date and needing updates in general
  • Loading branch information
zbeekman committed Aug 10, 2018
1 parent aa98839 commit 7deb2ee
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
42 changes: 20 additions & 22 deletions .Dockerfiles/master-jupyter-inherit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
FROM jupyter/minimal-notebook:da2c5a4d00fa

MAINTAINER Izaak Beekman <izaak@izaakbeekman.com>
FROM jupyter/minimal-notebook:f3652d3f58f2

USER root
ENV GCC_VERSION 7.2.0

ENV NB_USER jovyan
ENV NB_UID 1000
ENV HOME /home/${NB_USER}
ENV GCC_VERSION 7.3.0

RUN DEBIAN_FRONTEND=noninteractive transientBuildDeps="file" \
&& echo "NB_USER=${NB_USER}" \
&& set -v \
&& cat /etc/issue \
&& uname -a \
&& echo "${DEBIAN_FRONTEND}" \
&& apt-get update -y \
&& apt-get install -y \
&& apt-get install -y --no-install-recommends \
software-properties-common \
&& add-apt-repository ppa:ubuntu-toolchain-r/test -y \
&& apt-get update -y \
&& apt-get install -y \
&& apt-get install -y --no-install-recommends \
build-essential \
gcc-7=${GCC_VERSION}-1ubuntu1~16.04 \
gfortran-7=${GCC_VERSION}-1ubuntu1~16.04 \
g++-7=${GCC_VERSION}-1ubuntu1~16.04 \
mpich \
gcc-7>=7.3.0 \
gfortran-7>=7.3.0 \
g++-7>=7.3.0 \
mpich>=3.2 \
libmpich-dev>=3.2 \
${transientBuildDeps} \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-7 \
&& update-alternatives --set gcc "/usr/bin/gcc-7" \
&& gcc --version \
&& gfortran --version \
&& mpiexec --version \
&& mpifort --version \
&& mpif90 --version \
&& mpicc --version \
&& apt-get clean \
&& apt-get purge -y --auto-remove ${transientBuildDeps} \
Expand All @@ -52,28 +48,30 @@ RUN DEBIAN_FRONTEND=noninteractive transientBuildDeps="file" \
org.label-schema.version="${VCS_VERSION}" \
org.label-schema.vendor="SourceryInstitute" \
org.label-schema.license="BSD" \
org.label-schema.docker.cmd="docker run -i -t -p 8888:8888 sourceryinstitute/opencoarrays-notebook"
org.label-schema.docker.cmd="docker run -i -t -p 8888:8888 sourceryinstitute/opencoarrays_jupyter"

ARG RUN_TESTS=false

RUN DEBIAN_FRONTEND=noninteractive transientBuildDeps="cmake git" \
RUN DEBIAN_FRONTEND=noninteractive transientBuildDeps="cmake cmake-data git" \
&& set -v \
&& echo "${DEBIAN_FRONTEND}" \
&& apt-get update && apt-get install -y \
&& apt-get update && apt-get install -y --no-install-recommends \
${transientBuildDeps} \
&& cmake --version \
&& gcc --version \
&& gfortran --version \
&& git clone --single-branch https://github.com/sourceryinstitute/OpenCoarrays \
&& mkdir OpenCoarrays/build \
&& cd OpenCoarrays/build \
&& FC="$(which gfortran)" CC="$(which gcc)" cmake -DCMAKE_BUILD_TYPE=Release .. \
&& FC="$(command -v gfortran)" CC="$(command -v gcc)" cmake -DCAF_ENABLE_FAILED_IMAGES=FALSE -DCMAKE_BUILD_TYPE=Release .. \
&& make -j "$(nproc)" install \
&& if [ "${RUN_TESTS}" = "true" ] ; then ctest --output-on-failure ; fi \
&& cd ../.. \
&& if "${RUN_TESTS}" ; then ctest --output-on-failure ; fi \
&& caf --version \
&& cafrun --version \
&& rm -rf OpenCoarrays \
&& cd ../.. \
&& rm -rf ../../OpenCoarrays \
&& apt-get clean \
&& apt-get purge -y --auto-remove ${transientBuildDeps} \
&& rm -rf /var/lib/apt/lists/* /var/log/* /tmp/*

USER "${NB_USER}"
8 changes: 6 additions & 2 deletions .Dockerfiles/master-jupyter-inherit/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
SHELL := /usr/local/bin/bash -o pipefail
NAME = sourceryinstitute/opencoarrays-notebook
NAME = sourceryinstitute/opencoarrays_jupyter
IMAGE_NAME=$(NAME)
RUN_TESTS=true

#UBADGER_ENDPOINT = "https://hooks.microbadger.com/images/sourceryinstitute/jupyter-caf-kernel/CEL6DIVw-OVbUIXieZhZwvDXl3I="
GIT_MASTER_HEAD_SHA:=$(shell git rev-parse --short=12 --verify HEAD)

Expand All @@ -17,7 +20,8 @@ build: $(subst /,_,$(NAME))-build.stamp ## Build docker file. Depending on which
$(subst /,_,$(NAME))-build.stamp: Dockerfile .dockerignore hooks/build ## Target for doing & timestamping the build
touch $@
hooks/build 2>&1 | tee $(subst stamp,log,$@) || rm -rf $@
docker tag $(NAME):latest $(NAME):$(GIT_MASTER_HEAD_SHA)
docker tag $(NAME) $(NAME):$(GIT_MASTER_HEAD_SHA)
docker tag $(NAME) $(NAME):latest

push: $(subst /,_,$(NAME))-push.stamp ## Push prebuild docker image up to hub.docker.com

Expand Down
12 changes: 5 additions & 7 deletions .Dockerfiles/master-jupyter-inherit/hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ git tag --list
git branch

d_repo='sourceryinstitute/OpenCoarrays'
d_git_remotes=($(git remote show))
d_git_remotes=("$(git remote show)")
echo "${#d_git_remotes[@]} git remotes found."
n_remotes=${#d_git_remotes[@]}
if (( n_remotes > 0 )) ; then
Expand All @@ -37,10 +37,8 @@ d_tag="${IMAGE_NAME##*:}"
d_tag="${d_tag:-${branch_name}-$(date +%s)}"
d_vcs_tag="$(git rev-parse --short=12 --verify HEAD)"

if [[ ${IMAGE_NAME:-} ]]; then
if [[ -n "${IMAGE_NAME:-}" ]]; then
export RUN_TESTS=false
else
export RUN_TESTS=${RUN_TESTS:-false}
fi


Expand All @@ -51,12 +49,12 @@ fi

echo "Build hook running"
docker build --build-arg OPENCOARRAYS_VERSION="${opencoarrays_version}" \
--build-arg RUN_TESTS=${RUN_TESTS} \
--build-arg RUN_TESTS=${RUN_TESTS:-true} \
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
--build-arg VCS_REF="${SOURCE_COMMIT:-$(git rev-parse --short HEAD)}" \
--build-arg VCS_URL="${d_vcs_url}" \
--build-arg VCS_VERSION="${d_vcs_describe:-${d_tag}}" \
--rm \
--pull \
-t "${IMAGE_NAME:-$(tr '[:upper:]' '[:lower:]' <<< "${d_repo}:latest")}" .
docker tag "${IMAGE_NAME:-$(tr '[:upper:]' '[:lower:]' <<< "${d_repo}:latest")}" "${IMAGE_NAME:-$(tr '[:upper:]' '[:lower:]' <<< "${d_repo}:${d_vcs_tag}")}"
-t "${IMAGE_NAME:-$(tr '[:upper:]' '[:lower:]' <<< "${d_repo}")}:latest" .
docker tag "${IMAGE_NAME:-$(tr '[:upper:]' '[:lower:]' <<< "${d_repo}")}:latest" "${IMAGE_NAME:-$(tr '[:upper:]' '[:lower:]' <<< "${d_repo}")}:${d_vcs_tag}"

0 comments on commit 7deb2ee

Please sign in to comment.