Commit 8978380d authored by jeremad's avatar jeremad Committed by jeremad

add travis configuration

use a docker image for CI
parent 6c4ce7f2
dist: xenial
services:
- docker
matrix:
include:
- name: CUDA 8
script:
- docker build --tag stitchem-cuda8:latest --file docker/ci.dockerfile --build-arg version=8 .
- name: CUDA 9
script:
- docker build --tag stitchem-cuda9:latest --file docker/ci.dockerfile --build-arg version=9 .
- name: CUDA 10
script:
- docker build --tag stitchem-cuda10:latest --file docker/ci.dockerfile --build-arg version=10 .
......@@ -29,15 +29,33 @@ cmake -DCREATE_BOX_PACKAGE=OFF \
```
# Installing the dependencies on Ubuntu:
sudo apt install bison clang-tools cmake doxygen flex \
libceres-dev libeigen3-dev libglm-dev \
libfaac-dev libfaad-dev \
libglew-dev libglfw3-dev \
libmp3lame-dev libopencv-dev libopenexr-dev \
libportaudio-ocaml-dev librtmp-dev libturbojpeg0-dev \
libx264-dev ninja-build portaudio19-dev \
qt5-default qtmultimedia5-dev qttools5-dev libpng-dev \
libmp3lame-dev libx264-dev libportaudio-ocaml-dev libfaad-dev swig
sudo apt install
bison \
clang-tools \
cmake \
doxygen \
flex \
libceres-dev \
libeigen3-dev \
libfaac-dev \
libfaad-dev \
libglew-dev \
libglfw3-dev \
libglm-dev \
libmp3lame-dev \
libopencv-dev \
libopenexr-dev \
libpng-dev \
libportaudio-ocaml-dev \
librtmp-dev \
libturbojpeg0-dev \
libx264-dev \
ninja-build \
portaudio19-dev \
qt5-default \
qtmultimedia5-dev \
qttools5-dev \
swig
# Set up gcc-6 and g++-6 as your compiler
sudo apt-get install gcc-6 g++-6
......
# How does it work?
To avoid rebuilding an entire docker container at each build, we use base images for each cuda version (currently 8.0, 9.2 and 10.1). Those images are built locally and pushed to [dockerhub](https://hub.docker.com/u/stitchem). Then, the travis CI builds the ci image (that depends on the base images), adds the stitchEm sources and builds the applications.
# Modifying the images
## Modifying base image (base.dockerfile)
* Push your changes, create PR and merge it in master
* Ask for the rights to https://hub.docker.com/r/stitchem/stitchem-base
* Build the image locally: `docker build --tag stitchem/stitchem-base:latest --file docker/base.dockerfile .`
* Push the image: `docker push stitchem/stitchem-base:latest`
* Do the next section for x in 8, 9, 10
## Modifying base_cuda_x (base_cuda_x.dockerfile)
* Push your changes, create PR and merge it in master
* Ask for the rights to https://hub.docker.com/r/stitchem/stitchem-base-cudax
* Build the image locally: `docker build --tag stitchem/stitchem-base-cudax:latest --file docker/base.dockerfile .`
* Push the image: `docker push stitchem/stitchem-base-cudax:latest`
## Modifying CI image (ci.dockerfile)
* Push your changes, create PR and merge it in master
* You're all set
FROM ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
bison \
doxygen \
flex \
git \
libceres-dev \
libeigen3-dev \
libglm-dev \
libfaac-dev \
libfaad-dev \
libglew-dev \
libglfw3-dev \
libmp3lame-dev \
libopencv-dev \
libopenexr-dev \
libportaudio-ocaml-dev \
librtmp-dev \
libx264-dev \
ninja-build \
portaudio19-dev \
python-pip \
qt5-default \
qtmultimedia5-dev \
qttools5-dev \
swig \
wget
RUN pip install cmake
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
RUN apt-key add 7fa2af80.pub
RUN apt clean
FROM stitchem/stitchem-base:latest
ENV CUDA=10.1.105-1
ENV CUDA_APT=10-1
ENV CUDA_SHORT=10.1
ENV CUDA_INSTALLER=cuda-repo-ubuntu1804_${CUDA}_amd64.deb
RUN wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/${CUDA_INSTALLER}
RUN dpkg -i ${CUDA_INSTALLER}
RUN apt update -qq && apt install -y \
cuda-core-${CUDA_APT} \
cuda-cudart-dev-${CUDA_APT} \
cuda-cufft-dev-${CUDA_APT} \
cuda-nvml-dev-${CUDA_APT}
ENV CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
ENV PATH=${PATH}:${CUDA_HOME}/bin
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CUDA_HOME}/lib64
FROM stitchem/stitchem-base:latest
ENV CUDA=8.0.61-1
ENV CUDA_APT=8-0
ENV CUDA_SHORT=8.0
ENV CUDA_INSTALLER=cuda-repo-ubuntu1604_${CUDA}_amd64.deb
RUN apt update && apt install -y gcc-5 g++-5
ENV CC=gcc-5
ENV CXX=g++-5
RUN wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_INSTALLER}
RUN dpkg -i ${CUDA_INSTALLER}
RUN apt update -qq && apt install -y \
cuda-core-${CUDA_APT} \
cuda-cudart-dev-${CUDA_APT} \
cuda-cufft-dev-${CUDA_APT} \
cuda-nvml-dev-${CUDA_APT}
ENV CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
ENV PATH=${PATH}:${CUDA_HOME}/bin
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CUDA_HOME}/lib64
FROM stitchem/stitchem-base:latest
ENV CUDA=9.2.148-1
ENV CUDA_APT=9-2
ENV CUDA_SHORT=9.2
ENV CUDA_INSTALLER=cuda-repo-ubuntu1604_${CUDA}_amd64.deb
RUN wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_INSTALLER}
RUN dpkg -i ${CUDA_INSTALLER}
RUN apt update -qq && apt install -y \
cuda-core-${CUDA_APT} \
cuda-cudart-dev-${CUDA_APT} \
cuda-cufft-dev-${CUDA_APT} \
cuda-nvml-dev-${CUDA_APT}
ENV CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
ENV PATH=${PATH}:${CUDA_HOME}/bin
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CUDA_HOME}/lib64
ARG version
FROM stitchem/stitchem-base-cuda${version}:latest
ADD . stitchEm
WORKDIR stitchEm
RUN echo ${CUDA_SHORT} > cuda.version
WORKDIR build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DLINUX_PKG=ON -DRTMP_NVENC=OFF -DCUDA_TARGET_ARCH="50" -G Ninja ..
RUN ninja
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