Commit 2c3605ca authored by Lukas Riedel's avatar Lukas Riedel

Merge branch '56-add-job-for-building-and-deploying-dorie-docker-image' into 'master'

Resolve "Add job for building and deploying DORiE Docker image"

Closes #56

See merge request !47
parents 8d9b6011 b954fc1a
image: dorie/dune-env:2.5.1
variables:
DUNE_CONTROL_PATH: /opt/dune:$CI_PROJECT_DIR
DUNECONTROL: ./dune-common/bin/dunecontrol
CPUS_MULTICORE: 3
CPUS_DIND: 3
DOCKER_LOGIN:
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PW
DUNE_ENV_IMAGE:
dorie/dune-env:2.5.1
CMAKE_FLAGS:
-DDUNE_PYTHON_VIRTUALENV_SETUP=True
-DDUNE_PYTHON_ALLOW_GET_PIP=True
MAKE_FLAGS:
-j 4
-j $CPUS_MULTICORE
image: $DUNE_ENV_IMAGE
before_script:
- cd /opt/dune
stages:
- setup
- prep
- build
- test
- deploy
build:main:
stage: build
setup:dune-env:
stage: setup
only:
- web # activate through 'Run pipeline' only.
tags:
- multicore
- dind
image: docker:stable
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
before_script:
- $DOCKER_LOGIN
script:
- CMAKE_FLAGS="$CMAKE_FLAGS"
MAKE_FLAGS="$MAKE_FLAGS"
$DUNECONTROL --only=dorie all
- MAKE_FLAGS="$MAKE_FLAGS"
$DUNECONTROL --only=dorie make build_tests
artifacts:
name: "$CI_JOB_NAME"
paths:
- $CI_PROJECT_DIR/build-cmake
expire_in: 1 day
- docker build --build-arg PROCNUM=$CPUS_DIND -f dockerfiles/dune-env -t $DUNE_ENV_IMAGE .
- docker push $DUNE_ENV_IMAGE
prep:update-dune:
stage: prep
only:
- master
- tags
tags:
- dind
image: docker:stable
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
before_script:
- $DOCKER_LOGIN
script:
- docker build --build-arg PROCNUM=$CPUS_DIND -f dockerfiles/dune-env-update -t $DUNE_ENV_IMAGE .
- docker push $DUNE_ENV_IMAGE
build:update_dune:
build:main:
stage: build
tags:
- multicore
only:
- master
script:
- $DUNECONTROL update
- $DUNECONTROL exec "rm -rf build-cmake"
- CMAKE_FLAGS="$CMAKE_FLAGS"
MAKE_FLAGS="$MAKE_FLAGS"
$DUNECONTROL --module=dorie all
$DUNECONTROL --only=dorie all
- MAKE_FLAGS="$MAKE_FLAGS"
$DUNECONTROL --only=dorie make build_tests
artifacts:
......@@ -93,21 +117,6 @@ test:ode:
- $CI_PROJECT_DIR/build-cmake/Testing
expire_in: 1 day
test:ode-update_dune:
stage: test
dependencies:
- build:update_dune
only:
- master
script:
- $DUNECONTROL --only=dorie configure
- $DUNECONTROL --only=dorie make test_run_ode
artifacts:
name: "$CI_JOB_NAME"
paths:
- $CI_PROJECT_DIR/build-cmake/Testing
expire_in: 1 day
test:parallel:
stage: test
dependencies:
......@@ -147,4 +156,38 @@ test:mass_conserve:
name: "$CI_JOB_NAME"
paths:
- $CI_PROJECT_DIR/build-cmake/Testing
expire_in: 1 day
\ No newline at end of file
expire_in: 1 day
deploy:dockerhub-devel:
stage: deploy
only:
- master@dorie/dorie
tags:
- dind
image: docker:stable
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
before_script:
- $DOCKER_LOGIN
script:
- docker build --build-arg PROCNUM=$CPUS_DIND -f dockerfiles/dorie -t dorie/dorie:devel .
- docker push dorie/dorie:devel
deploy:dockerhub-stable:
stage: deploy
only:
- tags@dorie/dorie
tags:
- dind
image: docker:stable
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
before_script:
- $DOCKER_LOGIN
script:
- docker build --build-arg PROCNUM=$CPUS_DIND -f dockerfiles/dorie -t dorie/dorie:$CI_COMMIT_TAG .
- docker push dorie/dorie:$CI_COMMIT_TAG
......@@ -3,6 +3,10 @@
## Unreleased
### Added
* Automatic deployment of `devel` and stable DORiE Docker Images to Docker Hub
* Automatic update of the DUNE environment Docker Image for `master` builds
### Changed
* Switch VTK output from conforming to non-conforming
......
FROM dorie/dune-env:2.5.1 as builder
FROM dorie/dune-env:2.5.1
LABEL maintainer="lriedel@iup.uni-heidelberg.de"
# number of cores for parallel builds
ARG PROCNUM=1
WORKDIR /opt/dune
ADD . /opt/dune/dorie/
RUN CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol --only=dorie all \
&& ./dune-common/bin/dunecontrol --only=dorie exec \
RUN MAKE_FLAGS="-j ${PROCNUM}" \
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol --only=dorie all \
&& ./dune-common/bin/dunecontrol --only=dorie exec \
"rm build-cmake/dune/dorie/impl/libdorie-impl.a build-cmake/dune/dorie/impl/CMakeFiles/dorie-impl.dir/*.cc.o"
ENV PATH="/opt/dune/dorie/build-cmake/bin:${PATH}"
WORKDIR /sim
......
FROM ubuntu:bionic
LABEL maintainer="lriedel@iup.uni-heidelberg.de"
# number of cores for parallel builds
ARG PROCNUM=1
RUN apt-get clean && apt-get update && apt-get install -y \
cmake \
doxygen \
gcc \
g++ \
gfortran \
git \
libatlas-base-dev \
libfftw3-dev \
libfftw3-mpi-dev \
libfreetype6-dev \
libhdf5-mpi-dev \
libmetis-dev \
libopenmpi-dev \
libpng-dev \
libparmetis-dev \
libsuperlu-dev \
libxft-dev \
locales \
python3-dev \
python3-pip \
&& apt-get clean
RUN rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
WORKDIR /opt/dune
RUN git clone https://gitlab.dune-project.org/staging/dune-uggrid.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/oklein/dune-randomfield.git -b master \
&& git clone https://gitlab.dune-project.org/core/dune-common.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/core/dune-geometry.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/core/dune-grid.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/core/dune-istl.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/core/dune-localfunctions.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/staging/dune-functions.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/pdelab/dune-pdelab.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/staging/dune-typetree.git -b releases/2.5 \
&& git clone https://gitlab.dune-project.org/quality/dune-testtools.git -b master
WORKDIR /opt/dune
RUN MAKE_FLAGS="-j ${PROCNUM}" \
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol all
FROM dorie/dune-env:2.5.1
LABEL maintainer="lriedel@iup.uni-heidelberg.de"
# number of cores for parallel builds
ARG PROCNUM=1
RUN apt-get clean && apt-get update && apt-get upgrade -y && apt-get clean
WORKDIR /opt/dune
RUN ./dune-common/bin/dunecontrol update
RUN MAKE_FLAGS="-j ${PROCNUM}" \
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" \
./dune-common/bin/dunecontrol all
\ No newline at end of file
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