New Docker images for CI

* removed old Docker images
* added new ubuntu and sl images with SageCal dependencies
* updated travis configuration
* added new compile script
This commit is contained in:
Faruk D 2018-10-02 00:20:34 +02:00
parent c05c1a9dcb
commit 1ac6f321a7
11 changed files with 154 additions and 88 deletions

View File

@ -6,20 +6,17 @@ language: cpp
#env: #env:
before_install: before_install:
- docker pull ubuntu:xenial - docker pull fdiblen/ubuntu1604-test:latest
- docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name ubuntu-build ubuntu:xenial - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name ubuntu-build fdiblen/ubuntu1604-test:latest
- docker pull fdiblen/sl7-test:latest
- docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name sl-build fdiblen/sl7-test:latest
# - docker pull base/archlinux # - docker pull base/archlinux
# - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name arch-build base/archlinux # - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name arch-build base/archlinux
- docker pull scientificlinux/sl:7
- docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name sl-build scientificlinux/sl:7
script: script:
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH" - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
- docker exec --env BRANCH=$BRANCH ubuntu-build /bin/bash -c "/travis/workdir/build-tests/ubuntu/prepare-ubuntu.sh" - docker exec -e BRANCH=$BRANCH -e IMAGE='ubuntu' ubuntu-build /bin/bash -c "/travis/workdir/build-tests/compile_sagecal.sh"
- docker exec --env BRANCH=$BRANCH ubuntu-build /bin/bash -c "/travis/workdir/build-tests/ubuntu/compile-ubuntu.sh" - docker exec -e BRANCH=$BRANCH -e IMAGE='sl7' sl-build /bin/bash -c "/travis/workdir/build-tests/compile_sagecal.sh"
# - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/prepare-arch.sh" # - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/prepare-arch.sh"
# - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/compile-arch.sh" # - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/compile-arch.sh"
- docker exec --env BRANCH=$BRANCH sl-build /bin/bash -c "/travis/workdir/build-tests/sl/prepare-sl.sh"
- docker exec --env BRANCH=$BRANCH sl-build /bin/bash -c "/travis/workdir/build-tests/sl/compile-sl.sh"

36
Docker/build_images.sh Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
version=$(date +"%d%m%Y")
for folder in \
sl7-test \
ubuntu1604-test
do
name=${folder%%/}
echo
echo "==========================================="
echo "Building: "$name
echo "==========================================="
cmd="docker build -t fdiblen/$name:$version -t fdiblen/$name:latest ./$name"
echo
echo "Running:"
echo $cmd
echo
echo
eval $cmd
if [ $? -eq 0 ]
then
echo
echo "Successfully built the $name image!"
else
echo
echo "Could not build the $name image" >&2
exit $?
fi
#docker push fdiblen/$name:$version
#docker push fdiblen/$name:latest
done

View File

@ -0,0 +1,42 @@
FROM scientificlinux/sl:7
MAINTAINER f.diblen@esciencecenter.nl
# add EPEL repository for openblas
RUN yum -y \
install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# install dependencies
RUN yum -y install \
wget git pkgconfig make cmake3 cmake3-gui gcc-gfortran gcc-c++ flex bison \
openblas openblas-devel glib2-devel lapack lapack-devel cfitsio cfitsio-devel \
wcslib wcslib-devel ncurses ncurses-devel readline readline-devel \
python-devel boost boost-devel fftw fftw-devel hdf5 hdf5-devel \
numpy boost-python
RUN mkdir /build && cd /build
# compile casacore
RUN git clone --progress --verbose https://github.com/casacore/casacore.git casacore_src && \
cd casacore_src && \
mkdir build && cd build && \
cmake3 .. -DUSE_FFTW3=ON \
-DCMAKE_INSTALL_PREFIX=/opt/casacore \
-DDATA_DIR=/opt/casacore/data -DUSE_OPENMP=ON \
-DUSE_HDF5=ON \
-DBUILD_PYTHON=ON \
-DUSE_THREADS=ON && \
make -j4 && \
make install
## compile sagecal
#RUN cd /build && \
# mkdir build-sl && cd build-sl && \
# cmake3 .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal \
# -DCASACORE_ROOT_DIR=/opt/casacore \
# -DCASACORE_INCLUDE=/opt/casacore/include/casacore
# make -j4 && \
# make install && \
#
#RUN ls -alsrt /opt/sagecal && \
# /opt/sagecal/bin/sagecal

View File

@ -0,0 +1,26 @@
FROM ubuntu:xenial
MAINTAINER f.diblen@esciencecenter.nl
RUN apt-get update -y && \
apt-get install software-properties-common -y && \
add-apt-repository -s ppa:kernsuite/kern-3 -y && \
apt-add-repository multiverse && \
apt-get update -y
RUN apt-get install -y \
git cmake g++ pkg-config \
libcfitsio-bin libcfitsio-dev \
libopenblas-base libopenblas-dev \
wcslib-dev wcslib-tools \
libglib2.0-dev \
libcasa-casa2 casacore-dev casacore-data casacore-tools
## compile sagecal
#RUN mkdir /build && cd /build \
# mkdir build-ubuntu && cd build-ubuntu && \
# cmake .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal && \
# make -j4 && \
# make install && \
# ls -alsrt /opt/sagecal && \
# /opt/sagecal/bin/sagecal

View File

@ -1,11 +0,0 @@
#!/bin/bash
echo "Building SageCal" && \
echo "Branch --> $BRANCH" && \
cd /travis/workdir && \
mkdir build-arch && cd build-arch && \
cmake .. -DENABLE_CUDA=OFF && \
make -j4 && \
ls -alsrt ./dist/bin && \
./dist/bin/sagecal

View File

@ -1,4 +0,0 @@
#!/bin/bash
pacman -Syy --needed --noconfirm \
base-devel cmake git glib2 cfitsio wcslib

View File

@ -0,0 +1,44 @@
#!/usr/bin/env bash
echo 'script: ' $0
echo "Building SageCal" && \
echo "Branch --> $BRANCH" && \
echo "Image --> $IMAGE"
cd /travis/workdir && \
mkdir build && cd build
OPTS=''
case $IMAGE in
ubuntu)
OPTS=''
;;
sl7)
OPTS='-DUSE_FFTW3=ON \
-DCMAKE_INSTALL_PREFIX=/opt/casacore \
-DDATA_DIR=/opt/casacore/data -DUSE_OPENMP=ON \
-DUSE_HDF5=ON \
-DBUILD_PYTHON=ON \
-DUSE_THREADS=ON'
;;
arch)
OPTS=''
;;
*)
echo 'Unknown image $IMAGE!'
exit 1
;;
esac
echo 'CMake options: ' $OPTS
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal \
$OPTS
make -j4 && \
make install && \
ls -alsrt /opt/sagecal && \
/opt/sagecal/bin/sagecal

View File

@ -1,32 +0,0 @@
#!/bin/bash
echo "Building SageCal for Scientific Linux" && \
echo "Branch --> $BRANCH" && \
cd /travis/workdir
# compile casacore first
# mkdir -p /opt/soft/casacore/data
# cd /opt/soft/casacore/data
# wget -c ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar
# tar zxfv WSRT_Measures.ztar && rm -f WSRT_Measures.ztar
cd /travis/workdir
git clone --progress --verbose https://github.com/casacore/casacore.git casacore_src && cd casacore_src
mkdir build && cd build
cmake3 -DUSE_FFTW3=ON -DCMAKE_INSTALL_PREFIX=/opt/soft/casacore -DDATA_DIR=/opt/soft/casacore/data -DUSE_OPENMP=ON \
-DUSE_HDF5=ON -DBUILD_PYTHON=ON -DUSE_THREADS=ON ..
make -j4
make install
# compile sagecal
cd /travis/workdir && \
mkdir build-sl && cd build-sl
cmake3 .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal && \
-DCASACORE_ROOT_DIR=/opt/soft/casacore -DCASACORE_INCLUDE=/opt/soft/casacore/include/casacore
make -j4 && \
make install && \
ls -alsrt /opt/sagecal && \
/opt/sagecal/bin/sagecal

View File

@ -1,11 +0,0 @@
#!/bin/bash
# add EPEL repository for openblas
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# install dependencies
yum -y install wget git pkgconfig make cmake3 cmake3-gui gcc-gfortran gcc-c++ flex bison \
openblas openblas-devel glib2-devel lapack lapack-devel cfitsio cfitsio-devel \
wcslib wcslib-devel ncurses ncurses-devel readline readline-devel\
python-devel boost boost-devel fftw fftw-devel hdf5 hdf5-devel\
numpy boost-python

View File

@ -1,12 +0,0 @@
#!/bin/bash
echo "Building SageCal" && \
echo "Branch --> $BRANCH" && \
cd /travis/workdir && \
mkdir build-ubuntu && cd build-ubuntu && \
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal && \
make -j4 && \
make install && \
ls -alsrt /opt/sagecal && \
/opt/sagecal/bin/sagecal

View File

@ -1,9 +0,0 @@
#!/bin/bash
apt-get update -y
apt-get install software-properties-common -y
add-apt-repository -s ppa:kernsuite/kern-3 -y
apt-add-repository multiverse
apt-get update -y
apt-get install -y git cmake g++ pkg-config libcfitsio-bin libcfitsio-dev libopenblas-base libopenblas-dev wcslib-dev wcslib-tools libglib2.0-dev libcasa-casa2 casacore-dev casacore-data casacore-tools