未验证 提交 ff9fe6fa 编写于 作者: Q quicksilver 提交者: GitHub

Milvus build stage parallel processing (#3423)

* Milvus build stage parallel processing
Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>

* Milvus build stage parallel processing
Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>

* Milvus build stage parallel processing
Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>

* Milvus build stage parallel processing
Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>

* Milvus build stage parallel processing
Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>

* Milvus build stage parallel processing
Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>
上级 ed1195ed
name: Cpplint
# This workflow is triggered on pushes or pull request to the repository.
on:
push:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'ci/**'
- 'core/**'
- 'docker/build_env/cpu/**'
- '.github/workflows/cpplint.yml'
- docker-compose.yml
- '!**.md'
- '!ci/jenkins/**'
pull_request:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'ci/**'
- 'core/**'
- '.github/workflows/cpplint.yml'
- docker-compose.yml
- '!**.md'
- '!ci/jenkins/**'
jobs:
centos:
name: ${{ matrix.title }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- cpplint
- cpplint-gpu
include:
- name: cpplint
service: cpplint
title: Milvus CppLint
- name: cpplint-gpu
service: cpplint-gpu
title: Milvus GPU Version CppLint
steps:
# This step checks out a copy of your repository.
- name: Checkout Milvus
uses: actions/checkout@v2
- name: Docker Pull
shell: bash
run: |
docker-compose pull --ignore-pull-failures ${{ matrix.service }}
- name: Docker Build
shell: bash
run: |
docker-compose build ${{ matrix.service }}
- name: Docker Run
run: |
docker-compose run ${{ matrix.service }}
- name: Docker Push
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
continue-on-error: true
shell: bash
run: |
docker login -u ${{ secrets.DOCKERHUB_USER }} \
-p ${{ secrets.DOCKERHUB_TOKEN }}
docker-compose push ${{ matrix.service }}
...@@ -3,11 +3,11 @@ timeout(time: 60, unit: 'MINUTES') { ...@@ -3,11 +3,11 @@ timeout(time: 60, unit: 'MINUTES') {
def isTimeTriggeredBuild = currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').size() != 0 def isTimeTriggeredBuild = currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').size() != 0
if (!isTimeTriggeredBuild) { if (!isTimeTriggeredBuild) {
sh ". ./before-install.sh && ./check_cache.sh -l ${params.JFROG_ARTFACTORY_URL}/ccache --cache_dir=\${CCACHE_DIR} -f \${CCACHE_COMPRESS_PACKAGE_FILE} || echo \"ccache files not found!\"" sh ". ./before-install.sh && ./check_cache.sh -l ${params.JFROG_ARTFACTORY_URL}/ccache --cache_dir=\${CCACHE_DIR} -f \${CCACHE_COMPRESS_PACKAGE_FILE} || echo \"ccache files not found!\""
sh ". ./before-install.sh && ./check_cache.sh -l ${params.JFROG_ARTFACTORY_URL}/thirdparty --cache_dir=\${CUSTOM_THIRDPARTY_DOWNLOAD_PATH} -f \${THIRDPARTY_COMPRESS_PACKAGE_FILE} || echo \"thirdparty files not found!\"" sh ". ./before-install.sh && ./check_cache.sh -l ${params.JFROG_ARTFACTORY_URL}/thirdparty --cache_dir=\${CUSTOM_THIRDPARTY_DOWNLOAD_PATH} -f \${THIRDPARTY_COMPRESS_PACKAGE_FILE} || echo \"thirdparty files not found!\""
} }
if ("${BINARY_VERSION}" == "gpu") { if ("${BINARY_VERSION}" == "gpu") {
sh "/bin/bash --login -c \". ./before-install.sh && ./build.sh -t ${params.BUILD_TYPE} -j4 -i ${env.MILVUS_INSTALL_PREFIX} --coverage -l -g -u\"" sh "/bin/bash --login -c \". ./before-install.sh && ./build.sh -t ${params.BUILD_TYPE} -j4 -i ${env.MILVUS_INSTALL_PREFIX} --coverage -g -l -u\""
} else { } else {
sh "/bin/bash --login -c \". ./before-install.sh && ./build.sh -t ${params.BUILD_TYPE} -j4 -i ${env.MILVUS_INSTALL_PREFIX} --coverage -l -u\"" sh "/bin/bash --login -c \". ./before-install.sh && ./build.sh -t ${params.BUILD_TYPE} -j4 -i ${env.MILVUS_INSTALL_PREFIX} --coverage -l -u\""
} }
......
...@@ -31,6 +31,7 @@ Usage: ...@@ -31,6 +31,7 @@ Usage:
-g Building for the architecture of the GPU in the system -g Building for the architecture of the GPU in the system
--with_mkl Build with MKL (default: OFF) --with_mkl Build with MKL (default: OFF)
--with_fiu Build with FIU (default: OFF) --with_fiu Build with FIU (default: OFF)
--tidy Run clang-tidy
-c or --coverage Build Code Coverage -c or --coverage Build Code Coverage
-u or --tests Build unittest case -u or --tests Build unittest case
-p or --privileges Install command with elevated privileges -p or --privileges Install command with elevated privileges
...@@ -41,7 +42,7 @@ Usage: ...@@ -41,7 +42,7 @@ Usage:
Use \"$0 --help\" for more information about a given command. Use \"$0 --help\" for more information about a given command.
" "
ARGS=`getopt -o "i:t:s:j::lngcupvh" -l "install_prefix::,build_type::,custom_thirdparty::,jobs::,with_mkl,with_fiu,coverage,tests,privileges,help" -n "$0" -- "$@"` ARGS=`getopt -o "i:t:s:j::lngcupvh" -l "install_prefix::,build_type::,custom_thirdparty::,jobs::,tidy,with_mkl,with_fiu,coverage,tests,privileges,help" -n "$0" -- "$@"`
eval set -- "${ARGS}" eval set -- "${ARGS}"
...@@ -73,6 +74,7 @@ while true ; do ...@@ -73,6 +74,7 @@ while true ; do
-g) echo "Building for the architecture of the GPU in the system..." ; GPU_VERSION="ON" ; shift ;; -g) echo "Building for the architecture of the GPU in the system..." ; GPU_VERSION="ON" ; shift ;;
--with_mkl) echo "Build with MKL" ; WITH_MKL="ON" ; shift ;; --with_mkl) echo "Build with MKL" ; WITH_MKL="ON" ; shift ;;
--with_fiu) echo "Build with FIU" ; FIU_ENABLE="ON" ; shift ;; --with_fiu) echo "Build with FIU" ; FIU_ENABLE="ON" ; shift ;;
--tidy) echo "Run clang-tidy" ; RUN_CLANG_TIDY="ON" ; shift ;;
--coverage) echo "Build code coverage" ; BUILD_COVERAGE="ON" ; shift ;; --coverage) echo "Build code coverage" ; BUILD_COVERAGE="ON" ; shift ;;
-u|--tests) echo "Build unittest cases" ; BUILD_UNITTEST="ON" ; shift ;; -u|--tests) echo "Build unittest cases" ; BUILD_UNITTEST="ON" ; shift ;;
-n) echo "No build and install step" ; COMPILE_BUILD="OFF" ; shift ;; -n) echo "No build and install step" ; COMPILE_BUILD="OFF" ; shift ;;
...@@ -101,6 +103,7 @@ COMPILE_BUILD=${COMPILE_BUILD:="ON"} ...@@ -101,6 +103,7 @@ COMPILE_BUILD=${COMPILE_BUILD:="ON"}
GPU_VERSION=${GPU_VERSION:="OFF"} GPU_VERSION=${GPU_VERSION:="OFF"}
CUDA_ARCH=${CUDA_ARCH:="DEFAULT"} CUDA_ARCH=${CUDA_ARCH:="DEFAULT"}
RUN_CPPLINT=${RUN_CPPLINT:="OFF"} RUN_CPPLINT=${RUN_CPPLINT:="OFF"}
RUN_CLANG_TIDY=${RUN_CLANG_TIDY:="OFF"}
WITH_MKL=${WITH_MKL:="OFF"} WITH_MKL=${WITH_MKL:="OFF"}
FIU_ENABLE=${FIU_ENABLE:="OFF"} FIU_ENABLE=${FIU_ENABLE:="OFF"}
PRIVILEGES=${PRIVILEGES:="OFF"} PRIVILEGES=${PRIVILEGES:="OFF"}
...@@ -159,19 +162,17 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then ...@@ -159,19 +162,17 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then
exit 1 exit 1
fi fi
echo "clang-format check passed!" echo "clang-format check passed!"
fi
if [[ ${RUN_CLANG_TIDY} == "ON" ]]; then
# clang-tidy check # clang-tidy check
if [[ ${GPU_VERSION} == "ON" ]]; then make check-clang-tidy
make check-clang-tidy if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then echo "ERROR! clang-tidy check failed"
echo "ERROR! clang-tidy check failed" rm -f CMakeCache.txt
rm -f CMakeCache.txt exit 1
exit 1
fi
echo "clang-tidy check passed!"
else
echo "CPU version skip clang-tidy check!"
fi fi
echo "clang-tidy check passed!"
fi fi
if [[ ${COMPILE_BUILD} == "ON" ]];then if [[ ${COMPILE_BUILD} == "ON" ]];then
......
...@@ -3,6 +3,7 @@ version: '3.5' ...@@ -3,6 +3,7 @@ version: '3.5'
volumes: volumes:
amd64-ubuntu-18.04-cache: amd64-ubuntu-18.04-cache:
amd64-centos-7-cache: amd64-centos-7-cache:
amd64-ubuntu-18.04-cuda-cache:
amd64-centos-7-cuda-cache: amd64-centos-7-cuda-cache:
x-ccache: &ccache x-ccache: &ccache
...@@ -40,7 +41,7 @@ services: ...@@ -40,7 +41,7 @@ services:
networks: networks:
- milvus - milvus
command: &ubuntu-command command: &ubuntu-command
["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} --with_fiu --coverage -l -u && ["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} --with_fiu --coverage -u &&
/milvus/ci/scripts/run_unittest.sh -i ${MILVUS_INSTALL_PREFIX} --mysql_user=root --mysql_password=123456 --mysql_host=mysql && /milvus/ci/scripts/run_unittest.sh -i ${MILVUS_INSTALL_PREFIX} --mysql_user=root --mysql_password=123456 --mysql_host=mysql &&
/milvus/ci/scripts/coverage.sh"] /milvus/ci/scripts/coverage.sh"]
...@@ -60,10 +61,28 @@ services: ...@@ -60,10 +61,28 @@ services:
networks: networks:
- milvus - milvus
command: &centos-command command: &centos-command
["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} --with_fiu --coverage -l -u && ["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} --with_fiu --coverage -u &&
/milvus/ci/scripts/run_unittest.sh -i ${MILVUS_INSTALL_PREFIX} --mysql_user=root --mysql_password=123456 --mysql_host=mysql && /milvus/ci/scripts/run_unittest.sh -i ${MILVUS_INSTALL_PREFIX} --mysql_user=root --mysql_password=123456 --mysql_host=mysql &&
/milvus/ci/scripts/coverage.sh"] /milvus/ci/scripts/coverage.sh"]
ubuntu-cuda-core:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cuda-core
build:
context: .
dockerfile: docker/build_env/gpu/ubuntu${UBUNTU}/Dockerfile
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cuda-core
shm_size: 2G
environment:
<<: *ccache
volumes: &ubuntu-cuda-volumes
- .:/milvus:delegated
- ${ARCH}-ubuntu-${UBUNTU}-cuda-cache:/build:delegated
networks:
- milvus
command: &ubuntu-cuda-command
["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} -g"]
centos-cuda-core: centos-cuda-core:
image: ${REPO}:${ARCH}-centos-${CENTOS}-cuda-core image: ${REPO}:${ARCH}-centos-${CENTOS}-cuda-core
build: build:
...@@ -80,7 +99,39 @@ services: ...@@ -80,7 +99,39 @@ services:
networks: networks:
- milvus - milvus
command: &centos-cuda-command command: &centos-cuda-command
["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} -l -g"] ["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} -g"]
cpplint:
image: ${REPO}:${ARCH}-centos-${CENTOS}-core
build:
context: .
dockerfile: docker/build_env/cpu/centos${CENTOS}/Dockerfile
cache_from:
- ${REPO}:${ARCH}-centos-${CENTOS}-core
shm_size: 2G
volumes:
- .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cache:/build:delegated
networks:
- milvus
command:
["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} -l --tidy -n"]
cpplint-gpu:
image: ${REPO}:${ARCH}-centos-${CENTOS}-cuda-core
build:
context: .
dockerfile: docker/build_env/gpu/centos${CENTOS}/Dockerfile
cache_from:
- ${REPO}:${ARCH}-centos-${CENTOS}-cuda-core
shm_size: 2G
volumes:
- .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cuda-cache:/build:delegated
networks:
- milvus
command:
["/milvus/ci/scripts/build.sh -t Release -j2 -i ${MILVUS_INSTALL_PREFIX} -l -g --tidy -n"]
networks: networks:
milvus: milvus:
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册