Commit e116eea0 authored by jeremad's avatar jeremad Committed by jeremad

feat(ci): refactor linux CI

* Use nice container feature of github actions
* Remove automated builds for CUDA 8 and 9
parent 31d729ea
......@@ -4,41 +4,25 @@ on: [push]
jobs:
LinuxCuda8:
LinuxCuda:
runs-on: ubuntu-latest
container: stitchem/stitchem:latest
steps:
- uses: actions/checkout@v1
- name: CMake
run: docker build . --file docker/ci-cuda.dockerfile --tag stitchem-cuda8:latest --build-arg version=8
run: mkdir ../build && cd ../build && cmake -DCMAKE_BUILD_TYPE=Release -DRTMP_NVENC=OFF -DCUDA_TARGET_ARCH="50" -DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=OFF -DDISABLE_OPENCL_SPIR=ON -G Ninja ../stitchEm
- name: Build
run: docker run stitchem-cuda8:latest
LinuxCuda9:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: CMake
run: docker build . --file docker/ci-cuda.dockerfile --tag stitchem-cuda9:latest --build-arg version=9
- name: Build
run: docker run stitchem-cuda9:latest
LinuxCuda10:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: CMake
run: docker build . --file docker/ci-cuda.dockerfile --tag stitchem-cuda10:latest --build-arg version=10
- name: Build
run: docker run stitchem-cuda10:latest
run: cd ../build && ninja
LinuxOpenCL:
runs-on: ubuntu-latest
container: stitchem/stitchem:latest
steps:
- uses: actions/checkout@v1
- name: CMake
run: docker build . --file docker/ci-opencl.dockerfile --tag stitchem-opencl:latest
run: mkdir ../build && cd ../build && cmake -DCMAKE_BUILD_TYPE=Release -DGPU_BACKEND_CUDA=OFF -DGPU_BACKEND_OPENCL=ON -DDISABLE_OPENCL_SPIR=ON -G Ninja ../stitchEm
- name: Build
run: docker run stitchem-opencl:latest
run: cd ../build && ninja
MacOpenCL:
runs-on: macos-latest
......
# 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.
To cache apt dependency, and avoid installing them all at each CI build, we use this docker image.
# 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_cuda_x.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
You need rights to [dockerhub](https://hub.docker.com/u/stitchem).
```
docker build --tag stitchem/stitchem:latest --file docker/stitchem.dockerfile .
docker push stitchem/stitchem:latest
```
FROM stitchem/stitchem-base:latest
ENV CUDA=10.2.89-1
ENV CUDA_APT=10-2
ENV CUDA_SHORT=10.2
ENV CUDA_INSTALLER=cuda-repo-ubuntu1804_${CUDA}_amd64.deb
ENV NV_LIB=libnvidia-compute-418
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-compiler-${CUDA_APT} \
cuda-cudart-dev-${CUDA_APT} \
cuda-cufft-dev-${CUDA_APT} \
cuda-nvml-dev-${CUDA_APT} \
${NV_LIB}
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
ENV NV_DRIVER=nvidia-418
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}
RUN mkdir /usr/lib/nvidia
RUN apt install -y -o Dpkg::Options::="--force-overwrite" \
${NV_DRIVER}
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
ENV NV_DRIVER=nvidia-410
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}
RUN mkdir /usr/lib/nvidia
RUN apt install -y -o Dpkg::Options::="--force-overwrite" \
${NV_DRIVER}
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 -DRTMP_NVENC=OFF -DCUDA_TARGET_ARCH="50" -DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=OFF -DDISABLE_OPENCL_SPIR=ON -G Ninja ..
CMD ninja
ARG version
FROM stitchem/stitchem-base:latest
ADD . stitchEm
WORKDIR stitchEm
WORKDIR build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DGPU_BACKEND_CUDA=OFF -DGPU_BACKEND_OPENCL=ON -DDISABLE_OPENCL_SPIR=ON -G Ninja ..
CMD ninja
......@@ -37,3 +37,20 @@ 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
ENV CUDA=10.2.89-1
ENV CUDA_APT=10-2
ENV CUDA_SHORT=10.2
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 apt install ./${CUDA_INSTALLER}
RUN apt update -qq && apt install -y \
cuda-compiler-${CUDA_APT} \
cuda-cudart-dev-${CUDA_APT} \
cuda-cufft-dev-${CUDA_APT} \
cuda-nvml-dev-${CUDA_APT} \
${NV_LIB}
ENV CUDA_HOME=/usr/local/cuda-${CUDA_SHORT}
ENV PATH=${PATH}:${CUDA_HOME}/bin
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CUDA_HOME}/lib64
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