Permalink
Browse files

Travis Docker AArch64 Qemu build

  • Loading branch information...
milot-mirdita committed Feb 7, 2019
1 parent af1e851 commit fbc269d30e7bc69c852f2939b00fb53dabc8116a
Showing with 94 additions and 38 deletions.
  1. +50 −27 .travis.yml
  2. +44 −9 Dockerfile
  3. +0 −2 util/build_osx.sh
@@ -1,10 +1,19 @@
language: c++
language: minimal

env:

matrix:
include:
- os: linux
dist: xenial
addons:
apt:
packages:
- qemu-user-static
- binfmt-support
env: QEMU_ARM=1
- os: linux
dist: trusty
sudo: false
addons:
apt:
packages:
@@ -15,11 +24,9 @@ matrix:
- zlib1g-dev
- libbz2-dev
- vim-common
env:
- MATRIX_EVAL="CC=clang-3.6;CXX=clang++-3.6"
env: CC=clang-3.6 CXX=clang++-3.6
- os: linux
dist: trusty
sudo: false
addons:
apt:
sources:
@@ -34,11 +41,9 @@ matrix:
- zlib1g-dev
- libbz2-dev
- vim-common
env:
- MATRIX_EVAL="CC=clang-7;CXX=clang++-7"
env: CC=clang-7 CXX=clang++-7
- os: linux
dist: trusty
sudo: false
addons:
apt:
packages:
@@ -49,11 +54,9 @@ matrix:
- zlib1g-dev
- libbz2-dev
- vim-common
env:
- MATRIX_EVAL="CC=gcc-4.8;CXX=g++-4.8"
env: CC=gcc-4.8 CXX=g++-4.8
- os: linux
dist: trusty
sudo: false
addons:
apt:
sources:
@@ -66,11 +69,9 @@ matrix:
- zlib1g-dev
- libbz2-dev
- vim-common
env:
- MATRIX_EVAL="CC=gcc-8;CXX=g++-8"
env: CC=gcc-8 CXX=g++-8
- os: linux
dist: trusty
sudo: false
addons:
apt:
sources:
@@ -84,8 +85,7 @@ matrix:
- libbz2-dev
- vim-common
- libopenmpi-dev
env:
- MATRIX_EVAL="CC=gcc-8;CXX=g++-8;MPI=1"
env: MPI=1 CC=gcc-8 CXX=g++-8
- os: osx
osx_image: xcode10.1
addons:
@@ -96,21 +96,44 @@ matrix:
- gcc@8
- zlib
- bzip2
env:
- MATRIX_EVAL="CC=gcc-8;CXX=g++-8"
env: CC=gcc-8 CXX=g++-8
allow_failures:
- env: QEMU_ARM=1
fast_finish: true

services:
- docker

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link gcc@8 --force; fi
- eval "${MATRIX_EVAL}"
- export CC
- export CXX

script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -n "$MPI" ]]; then mkdir build; cd build; cmake -G Ninja -DHAVE_MPI=1 -DHAVE_SSE4_1=1 .. || exit 1; ninja || exit 1; cd ..; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -z "$MPI" ]]; then mkdir build; cd build; cmake -G Ninja -DHAVE_MPI=0 -DHAVE_SSE4_1=1 .. || exit 1; ninja || exit 1; cd ..; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./util/build_osx.sh . build || exit 1; fi
- |
if [[ -n "$QEMU_ARM" ]]; then \
docker build --build-arg NAMESPACE=arm64v8/ -t mmseqs . || exit 1; \
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then \
if [[ -n "$MPI" ]]; then MPI=1; else MPI=0; fi; \
mkdir build; cd build; cmake -G Ninja -DHAVE_MPI="$MPI" -DHAVE_SSE4_1=1 .. || exit 1; ninja || exit 1; \
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then \
./util/build_osx.sh . build || exit 1; \
else \
exit 1; \
fi
after_success:
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$TRAVIS_OS_NAME" == "osx" ]]; then openssl aes-256-cbc -K $encrypted_4188a201d0b5_key -iv $encrypted_4188a201d0b5_iv -in ./util/.travis.enc -out $HOME/.ssh/id_rsa -d; fi
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ -f "$HOME/.ssh/id_rsa" ]]; then chmod 400 $HOME/.ssh/id_rsa; fi
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ -f "$HOME/.ssh/id_rsa" ]]; then ssh -o StrictHostKeyChecking=no codeship@uniclust.mmseqs.com "mkdir -p /home/mirdita/repositories/mmseqs-webserver/archive/${TRAVIS_COMMIT}"; fi
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ -f "$HOME/.ssh/id_rsa" ]]; then cd build; scp -o StrictHostKeyChecking=no mmseqs-osx-static_sse41.tar.gz mmseqs-osx-static_avx2.tar.gz codeship@uniclust.mmseqs.com:/home/mirdita/repositories/mmseqs-webserver/archive/${TRAVIS_COMMIT}; cd ..; fi

- |
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]] || [[ "$TRAVIS_OS_NAME" != "osx" ]]; then \
exit 0; \
fi; \
if [[ "$encrypted_4188a201d0b5_key" == "" ]] || [[ "$encrypted_4188a201d0b5_iv" == "" ]]; then \
exit 0; \
fi; \
openssl aes-256-cbc -K "$encrypted_4188a201d0b5_key" -iv "$encrypted_4188a201d0b5_iv" -in ./util/.travis.enc -out "$HOME/.ssh/id_rsa" -d; \
chmod 400 "$HOME/.ssh/id_rsa"; \
ssh -o StrictHostKeyChecking=no codeship@uniclust.mmseqs.com \
"mkdir -p /home/mirdita/repositories/mmseqs-webserver/archive/${TRAVIS_COMMIT}"; \
cd build; \
scp -o StrictHostKeyChecking=no mmseqs-osx-static_sse41.tar.gz mmseqs-osx-static_avx2.tar.gz \
codeship@uniclust.mmseqs.com:/home/mirdita/repositories/mmseqs-webserver/archive/${TRAVIS_COMMIT};
@@ -1,23 +1,58 @@
FROM alpine:3.7 as mmseqs-builder
ARG NAMESPACE=
FROM alpine:3.7 as qemu-downloader
ARG NAMESPACE
RUN apk add --no-cache wget && \
if [[ "$NAMESPACE" == "arm64v8/" ]]; then \
wget -nv -O "/usr/bin/qemu-aarch64-static" https://github.com/multiarch/qemu-user-static/releases/download/v3.1.0-2/qemu-aarch64-static; \
else \
echo -e '#!/bin/sh\n"$@"\n' > "/usr/bin/qemu-aarch64-static"; \
fi; \
chmod +x /usr/bin/qemu-aarch64-static;

FROM ${NAMESPACE}alpine:3.7 as mmseqs-builder
ARG NAMESPACE
COPY --from=qemu-downloader /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
RUN apk add --no-cache gcc g++ cmake musl-dev vim git ninja zlib-dev bzip2-dev

WORKDIR /opt/mmseqs
ADD . .
RUN mkdir -p build_sse/bin && mkdir -p build_avx/bin && mkdir -p build_neon/bin

WORKDIR /opt/mmseqs/build_sse
RUN if [[ "$NAMESPACE" == "" ]]; then \
cmake -G Ninja -DHAVE_SSE4_1=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
ninja && ninja install; \
fi

WORKDIR build_sse
RUN cmake -G Ninja -DHAVE_SSE4_1=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..
RUN ninja && ninja install
WORKDIR /opt/mmseqs/build_avx
RUN if [[ "$NAMESPACE" == "" ]]; then \
cmake -G Ninja -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
ninja && ninja install; \
fi

WORKDIR ../build_avx
RUN cmake -G Ninja -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..
RUN ninja && ninja install
WORKDIR /opt/mmseqs/build_neon
RUN if [[ "$NAMESPACE" == "arm64v8/" ]]; then \
cmake -G Ninja -DHAVE_NEON=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..; \
ninja && ninja install; \
touch /opt/mmseqs/build_sse/bin/mmseqs; \
touch /opt/mmseqs/build_avx/bin/mmseqs; \
elif [[ "$NAMESPACE" == "" ]]; then \
touch /opt/mmseqs/build_neon/bin/mmseqs; \
fi

FROM alpine:3.7
FROM ${NAMESPACE}alpine:3.7
ARG NAMESPACE
MAINTAINER Milot Mirdita <milot@mirdita.de>
COPY --from=qemu-downloader /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static

RUN apk add --no-cache gawk bash grep libstdc++ libgomp zlib libbz2

COPY --from=mmseqs-builder /opt/mmseqs/build_sse/bin/mmseqs /usr/local/bin/mmseqs_sse42
COPY --from=mmseqs-builder /opt/mmseqs/build_avx/bin/mmseqs /usr/local/bin/mmseqs_avx2
COPY --from=mmseqs-builder /opt/mmseqs/build_neon/bin/mmseqs /usr/local/bin/mmseqs_neon
ADD util/mmseqs_wrapper.sh /usr/local/bin/mmseqs

CMD ["mmseqs"]
RUN if [[ "$NAMESPACE" == "arm64v8/" ]]; then mv -f /usr/local/bin/mmseqs_neon /usr/local/bin/mmseqs; fi

CMD ["/usr/local/bin/mmseqs"]

@@ -7,8 +7,6 @@ if [ ! -d "$REPO" ]; then
exit 1
fi

export CXX=${CXX:-g++-7}

mkdir -p "$BUILD/mmseqs"
mkdir -p "$BUILD/lib"
cd "$BUILD/lib"

0 comments on commit fbc269d

Please sign in to comment.