Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docker & ccache #214

Merged
merged 16 commits into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ matrix:
# +boost +itk -hdf5 +swig
env: EXTRA_BUILD_FLAGS="-DUSE_SYSTEM_Boost=ON -DUSE_ITK=ON -DUSE_SYSTEM_HDF5=OFF -DUSE_SYSTEM_SWIG=ON" MATRIX_EVAL="CC=gcc CXX=g++" PYMVER=2
# docker
#- os: linux
# # +armadillo +boost +fftw3 +hdf5 +siemens_to_ismrmrd +swig
# env: DOCKER_BUILD=1
#- os: linux
# # +DEVEL +armadillo +boost +fftw3 +hdf5 +siemens_to_ismrmrd +swig
# env: DOCKER_BUILD=DEVEL
- os: linux
# +ace +armadillo +boost +fftw3 +hdf5 +itk +siemens_to_ismrmrd +swig
env: DOCKER_BUILD=1
- os: linux
# +DEVEL +ace +armadillo +boost +fftw3 +hdf5 +itk +siemens_to_ismrmrd +swig
env: DOCKER_BUILD=DEVEL

env:
global:
Expand Down Expand Up @@ -219,19 +219,13 @@ before_install:
- $PY_EXE --version
- $PY_EXE -m pip --version
- $PY_EXE -m pip freeze
# ccache compiler override
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
- ln -s "$(which ccache)" g++
- ln -s "$(which ccache)" g++-6
- ln -s "$(which ccache)" g++-7
- ln -s "$(which ccache)" gcc
- ln -s "$(which ccache)" gcc-6
- ln -s "$(which ccache)" gcc-7
- export PATH="$PWD:$PATH"
- popd
# N.B.: don't put into build matrix to allow caching.
- BUILD_FLAGS="$BUILD_FLAGS -DPYVER=$PYMVER"
- BUILD_FLAGS="$BUILD_FLAGS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
- cmake --version

install:
- |
if [[ -n "$DOCKER_BUILD" ]]; then
Expand Down Expand Up @@ -268,7 +262,7 @@ install:
$PY_EXE -m pip install --user --only-binary=numpy,scipy,matplotlib numpy scipy matplotlib
cmake $BUILD_FLAGS $EXTRA_BUILD_FLAGS .
# Job may timeout (>50min) if no ccache, otherwise should be <1min:
make
make
mv INSTALL/share/gadgetron/config/gadgetron.xml.example INSTALL/share/gadgetron/config/gadgetron.xml
) || travis_terminate 1
source $PWD/INSTALL/bin/env_ccppetmr.sh
Expand Down
11 changes: 7 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04 as base
FROM ubuntu:18.04 as base
LABEL \
author.name="Casper da Costa-Luis" \
[email protected] \
Expand Down Expand Up @@ -76,9 +76,12 @@ COPY user_sirf-ubuntu.sh .
COPY devel/.ccache/ /opt/ccache/
RUN ccache -o cache_dir=/opt/ccache
ARG BUILD_FLAGS="\
-DCMAKE_BUILD_TYPE=Release -DBUILD_STIR_WITH_OPENMP=ON \
-DUSE_SYSTEM_Armadillo=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON \
-DUSE_SYSTEM_HDF5=ON -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=ON"
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache\
-DCMAKE_BUILD_TYPE=Release\
-DBUILD_STIR_WITH_OPENMP=ON -DUSE_SYSTEM_ACE=ON\
-DUSE_SYSTEM_Armadillo=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON\
-DUSE_SYSTEM_HDF5=ON -DUSE_ITK=ON -DBUILD_siemens_to_ismrmrd=ON\
-DUSE_SYSTEM_SWIG=ON"
ARG EXTRA_BUILD_FLAGS=""
RUN bash user_sirf-ubuntu.sh
RUN rm user_sirf-ubuntu.sh
Expand Down
27 changes: 17 additions & 10 deletions docker/build_gadgetron-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
#!/usr/bin/env bash
set -ev
# Gadgetron
# from https://github.com/gadgetron/gadgetron/blob/master/docker/base/ubuntu_1804/Dockerfile#L8
apt-get update -qq
apt-get install -yq --no-install-recommends \
h5utils \
liblapack-dev \
libace-dev
# Not required (yet) by SIRF
# libxml2-dev
# libxslt-dev
# python-h5py
# python-libxml2
# python-psutil
# libplplot-dev
libhdf5-serial-dev \
libboost-all-dev \
libfftw3-dev \
h5utils \
jq \
hdf5-tools \
libatlas-base-dev \
libxml2-dev \
libfreetype6-dev \
libxslt-dev \
libarmadillo-dev \
libace-dev \
liblapack-dev \
liblapacke-dev \
libplplot-dev \
libdcmtk-dev
apt-get clean
10 changes: 3 additions & 7 deletions docker/build_system-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ set -ev
# SIRF external dependencies
apt-get update -qq
apt-get install -yq --no-install-recommends \
hdf5-tools \
hdfview \
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
libarmadillo-dev \
libboost-all-dev \
libfftw3-dev \
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
libgtest-dev \
libhdf5-serial-dev \
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
libplplot-dev \
libxml2-dev \
libxslt-dev \
swig
apt-get clean

# Not required (yet) by SIRF
# libopenblas-dev
5 changes: 3 additions & 2 deletions docker/devel/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ GCONFIG=./INSTALL/share/gadgetron/config/gadgetron.xml
[ -f "$GCONFIG" ] || cp "$GCONFIG".example "$GCONFIG"
./INSTALL/bin/gadgetron >& gadgetron.log&

# print for debugging
[ "$DEBUG" != 0 ] && cat builds/SIRF/build/CMakeCache.txt
ctest -VV
ret=$?
kill -n 15 $(pidof gadgetron)

# print for debugging
[ "$DEBUG" != 0 ] && cat builds/SIRF/build/CMakeCache.txt
[ "$DEBUG" != 0 ] && cat builds/SIRF/build/Testing/Temporary/LastTest.log
# may exceed 4MB travis log limit
[ "$DEBUG" != 0 ] && cat gadgetron.log
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ services:
context: .
target: core
cache_from:
- ubuntu:16.04
- ubuntu:18.04
- ccppetmr/sirf:core
6 changes: 3 additions & 3 deletions docker/user_python-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -ev
[ -f .bashrc ] && . .bashrc
set -ev
INSTALL_DIR="${1:-/opt/pyvenv}"
PYTHON="${2:-miniconda}"

Expand All @@ -13,8 +13,8 @@ miniconda)
rm miniconda.sh
source "$INSTALL_DIR"/bin/activate
conda config --add channels conda-forge
conda update -c conda-forge -y conda
conda update -c conda-forge -y --all
# https://github.com/conda/conda/issues/6030
#conda update -c conda-forge -y conda
;;
*python*)
# virtualenv
Expand Down
5 changes: 3 additions & 2 deletions docker/user_sirf-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env bash
set -ev
[ -f .bashrc ] && . .bashrc
set -ev
# SIRF
git clone https://github.com/CCPPETMR/SIRF-SuperBuild --recursive -b master /opt/SIRF-SuperBuild
git clone https://github.com/CCPPETMR/SIRF-SuperBuild --recursive -b docker /opt/SIRF-SuperBuild
casperdcl marked this conversation as resolved.
Show resolved Hide resolved
pushd /opt/SIRF-SuperBuild
echo $BUILD_FLAGS $EXTRA_BUILD_FLAGS
cmake $BUILD_FLAGS $EXTRA_BUILD_FLAGS .
make -j 2

Expand Down