azure-pipelines.yml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. # https://aka.ms/yaml
  2. trigger:
  3. - master
  4. variables:
  5. regression: 1
  6. jobs:
  7. - job: build_ubuntu_1804
  8. displayName: Ubuntu 1804
  9. pool:
  10. vmImage: 'Ubuntu-18.04'
  11. timeoutInMinutes: 120
  12. strategy:
  13. matrix:
  14. avx2:
  15. SIMD: 'AVX2'
  16. ARCHIVE_NAME: 'avx2'
  17. STATIC: 1
  18. MPI: 0
  19. BUILD_TYPE: Release
  20. sse2:
  21. SIMD: 'SSE2'
  22. ARCHIVE_NAME: 'sse2'
  23. STATIC: 1
  24. MPI: 0
  25. BUILD_TYPE: Release
  26. avx2_mpi:
  27. SIMD: 'AVX2'
  28. ARCHIVE_NAME: 'avx2-mpi'
  29. STATIC: 0
  30. MPI: 1
  31. BUILD_TYPE: RelWithDebInfo
  32. asan:
  33. SIMD: 'AVX2'
  34. ARCHIVE_NAME: 'avx2-asan'
  35. STATIC: 0
  36. MPI: 1
  37. BUILD_TYPE: ASanOpt
  38. steps:
  39. - script: |
  40. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  41. sudo apt-get update
  42. sudo apt-get install -y g++-10
  43. displayName: Install newer GCC
  44. condition: eq(variables['BUILD_TYPE'], 'ASanOpt')
  45. - script: |
  46. sudo apt-get update
  47. sudo apt-get -y install mpi-default-dev mpi-default-bin
  48. displayName: Install MPI dependencies
  49. condition: eq(variables['MPI'], 1)
  50. - script: |
  51. mkdir build && cd build
  52. if [ "${BUILD_TYPE}" = "ASanOpt" ]; then
  53. export CC=gcc-10 ; export CXX=g++-10
  54. fi
  55. if [ "${STATIC}" -eq "1" ]; then
  56. cmake -DCMAKE_INSTALL_PREFIX=${BUILD_SOURCESDIRECTORY}/hhsuite \
  57. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
  58. -DBUILD_SHARED_LIBS=OFF \
  59. -DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" \
  60. -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \
  61. -DHAVE_${SIMD}=1 \
  62. -DCHECK_MPI=${MPI} \
  63. ..
  64. else
  65. cmake -DCMAKE_INSTALL_PREFIX=${BUILD_SOURCESDIRECTORY}/hhsuite \
  66. -DHAVE_SANITIZER=1 \
  67. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
  68. -DHAVE_${SIMD}=1 \
  69. -DCHECK_MPI=${MPI} \
  70. ..
  71. fi
  72. make -j $(nproc --all)
  73. make install
  74. cd ${BUILD_SOURCESDIRECTORY}
  75. cp LICENSE README.md hhsuite
  76. tar -czvf hhsuite-linux-${ARCHIVE_NAME}.tar.gz hhsuite
  77. displayName: Build HHsuite
  78. - script: |
  79. if [ "${BUILD_TYPE}" = "ASanOpt" ]; then
  80. echo "leak:libgomp1" > ${BUILD_SOURCESDIRECTORY}/ASan.supp
  81. export ASAN_OPTIONS=suppressions=${BUILD_SOURCESDIRECTORY}/ASan.supp
  82. fi
  83. cd ${BUILD_SOURCESDIRECTORY}/data
  84. PATH="${BUILD_SOURCESDIRECTORY}/hhsuite/bin:$PATH"
  85. ./test.sh
  86. displayName: Run regression
  87. condition: eq(variables['regression'], 1)
  88. - task: PublishPipelineArtifact@0
  89. inputs:
  90. targetPath: $(Build.SourcesDirectory)/hhsuite-linux-$(ARCHIVE_NAME).tar.gz
  91. artifactName: hhsuite-linux-$(ARCHIVE_NAME)
  92. condition: eq(variables['STATIC'], 1)
  93. - job: build_ubuntu_cross_2004
  94. displayName: Ubuntu 2004 cross-compile
  95. pool:
  96. vmImage: 'Ubuntu-20.04'
  97. strategy:
  98. matrix:
  99. power8:
  100. SIMD: POWER8
  101. ARCH: ppc64el
  102. ARCHIVE_NAME: ppc64el-power8
  103. CPREF: powerpc64le
  104. power9:
  105. SIMD: POWER9
  106. ARCH: ppc64el
  107. ARCHIVE_NAME: ppc64el-power9
  108. CPREF: powerpc64le
  109. arm64:
  110. SIMD: ARM8
  111. ARCH: arm64
  112. ARCHIVE_NAME: arm64
  113. CPREF: aarch64
  114. steps:
  115. - script: |
  116. sudo dpkg --add-architecture $ARCH
  117. cat << HEREDOC | sudo tee /etc/apt/sources.list
  118. deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ focal main universe multiverse
  119. deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ focal-updates main universe multiverse
  120. deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ focal-backports main universe multiverse
  121. deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu/ focal-security main universe multiverse
  122. deb [arch=$ARCH] http://ports.ubuntu.com/ubuntu-ports/ focal main universe multiverse
  123. deb [arch=$ARCH] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main universe multiverse
  124. deb [arch=$ARCH] http://ports.ubuntu.com/ubuntu-ports/ focal-backports main universe multiverse
  125. deb [arch=$ARCH] http://ports.ubuntu.com/ubuntu-ports/ focal-security main universe multiverse
  126. HEREDOC
  127. sudo apt-get update
  128. sudo apt-get -y install -o APT::Immediate-Configure=false crossbuild-essential-$ARCH qemu-user-static
  129. displayName: Install crossbuild toolchain
  130. - script: |
  131. mkdir build && cd build
  132. CC=${CPREF}-linux-gnu-gcc CXX=${CPREF}-linux-gnu-g++ \
  133. cmake -DCMAKE_INSTALL_PREFIX=${BUILD_SOURCESDIRECTORY}/hhsuite \
  134. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
  135. -DBUILD_SHARED_LIBS=OFF \
  136. -DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" \
  137. -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \
  138. -DHAVE_${SIMD}=1 \
  139. -DCHECK_MPI=0 \
  140. ..
  141. make -j $(nproc --all)
  142. make install
  143. cd ${BUILD_SOURCESDIRECTORY}
  144. cp LICENSE README.md hhsuite
  145. tar -czvf hhsuite-linux-${ARCHIVE_NAME}.tar.gz hhsuite
  146. displayName: Build HHsuite
  147. - script: |
  148. cd ${BUILD_SOURCESDIRECTORY}/data
  149. PATH="${BUILD_SOURCESDIRECTORY}/hhsuite/bin:$PATH"
  150. ./test.sh
  151. displayName: Run regression in QEMU
  152. # POWER9 test needs at least qemu 5.2 as GCC emits lxvwsx instructions
  153. # https://bugs.launchpad.net/qemu/+bug/1793608
  154. condition: and(eq(variables['regression'], 1), ne(variables['SIMD'], 'POWER9'))
  155. - task: PublishPipelineArtifact@0
  156. inputs:
  157. targetPath: $(Build.SourcesDirectory)/hhsuite-linux-$(ARCHIVE_NAME).tar.gz
  158. artifactName: hhsuite-linux-$(ARCHIVE_NAME)
  159. - job: build_macos_1015
  160. displayName: macOS 1015
  161. pool:
  162. vmImage: 'macos-10.15'
  163. steps:
  164. - script: |
  165. cd ${BUILD_SOURCESDIRECTORY}
  166. ./scripts/build_darwin_universal.sh . build_osx
  167. cp ${BUILD_SOURCESDIRECTORY}/LICENSE ${BUILD_SOURCESDIRECTORY}/README.md ${BUILD_SOURCESDIRECTORY}/build_osx/hhsuite/
  168. tar -czvf ${BUILD_SOURCESDIRECTORY}/hhsuite-osx-universal.tar.gz -C ${BUILD_SOURCESDIRECTORY}/build_osx hhsuite
  169. displayName: Build HHsuite
  170. - script: |
  171. cd ${BUILD_SOURCESDIRECTORY}/data
  172. PATH="${BUILD_SOURCESDIRECTORY}/build_osx/hhsuite/bin:$PATH"
  173. ./test.sh
  174. displayName: Run regression
  175. condition: eq(variables['regression'], 1)
  176. - task: PublishPipelineArtifact@0
  177. inputs:
  178. targetPath: $(Build.SourcesDirectory)/hhsuite-osx-universal.tar.gz
  179. artifactName: hhsuite-osx-universal
  180. - job: upload_artifacts
  181. displayName: Upload Artifacts
  182. condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
  183. pool:
  184. vmImage: 'Ubuntu-18.04'
  185. dependsOn:
  186. - build_macos_1015
  187. - build_ubuntu_1804
  188. - build_ubuntu_cross_2004
  189. steps:
  190. - checkout: none
  191. - task: DownloadPipelineArtifact@1
  192. inputs:
  193. targetPath: $(Build.SourcesDirectory)
  194. - task: DownloadSecureFile@1
  195. inputs:
  196. secureFile: secretKeyPleaseDontSteal
  197. displayName: Get Deployment Key
  198. - script: |
  199. mkdir ~/.ssh && mv $DOWNLOADSECUREFILE_SECUREFILEPATH ~/.ssh/id_rsa
  200. chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
  201. ssh-keyscan -t rsa uniclust.mmseqs.com >> ~/.ssh/known_hosts
  202. cd "${BUILD_SOURCESDIRECTORY}"
  203. ssh [email protected] "mkdir -p \"/home/mirdita/repositories/mmseqs-webserver/archive/${BUILD_SOURCEVERSION}\""
  204. scp hhsuite-*/*.tar.gz [email protected]:"/home/mirdita/repositories/mmseqs-webserver/archive/${BUILD_SOURCEVERSION}"
  205. ssh [email protected] "update-latest-hhsuite.sh \"${BUILD_SOURCEVERSION}\""