Commit 41b3c727 authored by quicksilver's avatar quicksilver
Browse files

Merge branch 'branch-0.5.0' of http://192.168.1.105:6060/megasearch/milvus into branch-0.5.0


Former-commit-id: 1836fdcdcf6e802ee4077bcce8b05a02845091fc
parents a5a96d0c 1f56bf33
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-569 - Complete the NOTICE.md
- MS-575 - Add Clang-format & Clang-tidy & Cpplint
- MS-586 - Remove BUILD_FAISS_WITH_MKL option
- MS-590 - Refine cmake code to support cpplint

# Milvus 0.4.0 (2019-09-12)

+7 −10
Original line number Diff line number Diff line
@@ -44,13 +44,7 @@ set(MILVUS_VERSION "${GIT_BRANCH_NAME}")
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]" MILVUS_VERSION "${MILVUS_VERSION}")

find_package(ClangTools)
if("$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" STREQUAL "1" OR CLANG_TIDY_FOUND)
  # Generate a Clang compile_commands.json "compilation database" file for use
  # with various development tools, such as Vim's YouCompleteMe plugin.
  # See http://clang.llvm.org/docs/JSONCompilationDatabase.html
  set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
endif()

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support")

if(CMAKE_BUILD_TYPE STREQUAL "Release")
@@ -182,6 +176,9 @@ endif()
find_program(CPPLINT_BIN NAMES cpplint cpplint.py HINTS ${BUILD_SUPPORT_DIR})
message(STATUS "Found cpplint executable at ${CPPLINT_BIN}")

#
# "make lint" targets
#
add_custom_target(lint
                  ${PYTHON_EXECUTABLE}
                  ${BUILD_SUPPORT_DIR}/run_cpplint.py
@@ -194,11 +191,11 @@ add_custom_target(lint
                  ${MILVUS_LINT_QUIET})

#
# "make format" and "make check-format" targets
# "make clang-format" and "make check-clang-format" targets
#
if(${CLANG_FORMAT_FOUND})
  # runs clang format and updates files in place.
  add_custom_target(format
  add_custom_target(clang-format
                    ${PYTHON_EXECUTABLE}
                    ${BUILD_SUPPORT_DIR}/run_clang_format.py
                    --clang_format_binary
@@ -211,7 +208,7 @@ if(${CLANG_FORMAT_FOUND})
                    ${MILVUS_LINT_QUIET})

  # runs clang format and exits with a non-zero exit code if any files need to be reformatted
  add_custom_target(check-format
  add_custom_target(check-clang-format
                    ${PYTHON_EXECUTABLE}
                    ${BUILD_SUPPORT_DIR}/run_clang_format.py
                    --clang_format_binary
+16 −5
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ Keep up-to-date with newest releases and latest updates by reading [Releases](ht
  The data is stored and computed on a distributed architecture. This lets you scale data sizes up and down without redesigning the system.

## Architecture
![Milvus_arch](https://www.milvus-io/docs/master/assets/milvus_arch.png)
![Milvus_arch](https://milvus.io/docs/assets/milvus_arch.png)

## Get started

@@ -44,10 +44,12 @@ Use Docker to install Milvus is a breeze. See the [Milvus install guide](https:/
```shell
# Install tools
Centos7 : 
$ yum install gfortran qt4 flex bison mysql-devel mysql
$ yum install gfortran qt4 flex bison 
$ yum install mysql-devel mysql
    
Ubuntu16.04 : 
$ sudo apt-get install gfortran qt4-qmake flex bison libmysqlclient-dev mysql-client
$ sudo apt-get install gfortran qt4-qmake flex bison 
$ sudo apt-get install libmysqlclient-dev mysql-client
       
```

@@ -96,12 +98,21 @@ please reinstall CMake with curl:
   $ sudo make install
   ```

##### code format and linting

```shell
CentOS 7:   
$ yum install clang
Ubuntu 16.04: 
$ sudo apt-get install clang-format clang-tidy
    
$ ./build.sh -l
```

##### Run unit test

```shell
$ ./build.sh -u
or
$ ./build.sh --unittest
```

##### Run code coverage
+6 −0
Original line number Diff line number Diff line
*cmake-build-debug*
*cmake-build-release*
*cmake_build*
*src/thirdparty*
*src/core/thirdparty*
*src/grpc*
 No newline at end of file
+65 −37
Original line number Diff line number Diff line
@@ -8,10 +8,18 @@ BUILD_COVERAGE="OFF"
DB_PATH="/opt/milvus"
PROFILING="OFF"
USE_JFROG_CACHE="OFF"
RUN_CPPLINT="OFF"
CUDA_COMPILER=/usr/local/cuda/bin/nvcc

while getopts "p:d:t:uhrcgj" arg
while getopts "p:d:t:ulrcgjh" arg
do
        case $arg in
             p)
                INSTALL_PREFIX=$OPTARG
                ;;
             d)
                DB_PATH=$OPTARG
                ;;
             t)
                BUILD_TYPE=$OPTARG # BUILD_TYPE
                ;;
@@ -19,11 +27,8 @@ do
                echo "Build and run unittest cases" ;
                BUILD_UNITTEST="ON";
                ;;
             p)
                INSTALL_PREFIX=$OPTARG
                ;;
             d)
                DB_PATH=$OPTARG
             l)
                RUN_CPPLINT="ON"
                ;;
             r)
                if [[ -d cmake_build ]]; then
@@ -44,22 +49,24 @@ do
                echo "

parameter:
-t: build type(default: Debug)
-u: building unit test options(default: OFF)
-p: install prefix(default: $(pwd)/milvus)
-d: db path(default: /opt/milvus)
-t: build type(default: Debug)
-u: building unit test options(default: OFF)
-l: run cpplint, clang-format and clang-tidy(default: OFF)
-r: remove previous build directory(default: OFF)
-c: code coverage(default: OFF)
-g: profiling(default: OFF)
-j: use jfrog cache build directory
-j: use jfrog cache build directory(default: OFF)
-h: help

usage:
./build.sh -t \${BUILD_TYPE} [-u] [-h] [-g] [-r] [-c] [-k] [-j]
./build.sh -p \${INSTALL_PREFIX} -t \${BUILD_TYPE} [-u] [-l] [-r] [-c] [-g] [-j] [-h]
                "
                exit 0
                ;;
             ?)
                echo "unknown argument"
                echo "ERROR! unknown argument"
        exit 1
        ;;
        esac
@@ -67,15 +74,12 @@ done

if [[ ! -d cmake_build ]]; then
    mkdir cmake_build
	MAKE_CLEAN="ON"
fi

cd cmake_build

CUDA_COMPILER=/usr/local/cuda/bin/nvcc

if [[ ${MAKE_CLEAN} == "ON" ]]; then
    CMAKE_CMD="cmake -DBUILD_UNIT_TEST=${BUILD_UNITTEST} \
CMAKE_CMD="cmake \
-DBUILD_UNIT_TEST=${BUILD_UNITTEST} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CUDA_COMPILER=${CUDA_COMPILER} \
@@ -83,24 +87,48 @@ if [[ ${MAKE_CLEAN} == "ON" ]]; then
-DMILVUS_DB_PATH=${DB_PATH} \
-DMILVUS_ENABLE_PROFILING=${PROFILING} \
-DUSE_JFROG_CACHE=${USE_JFROG_CACHE} \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
../"
echo ${CMAKE_CMD}

${CMAKE_CMD}

if [[ ${MAKE_CLEAN} == "ON" ]]; then
    make clean
fi

if [[ ${RUN_CPPLINT} == "ON" ]]; then
    # cpplint check
    make lint
    if [ $? -ne 0 ]; then
        echo "ERROR! cpplint check not pass"
        exit 1
    fi
    # clang-format check
    make check-clang-format
    if [ $? -ne 0 ]; then
        echo "ERROR! clang-format check failed"
        exit 1
    fi
    # clang-tidy check
    make check-clang-tidy
    if [ $? -ne 0 ]; then
        echo "ERROR! clang-tidy check failed"
        exit 1
    fi
else
    # compile and build
    make -j 4 || exit 1

    # strip binary symbol
    if [[ ${BUILD_TYPE} != "Debug" ]]; then
        strip src/milvus_server
    fi

    make install || exit 1

    # evaluate code coverage
    if [[ ${BUILD_COVERAGE} == "ON" ]]; then
        cd -
        bash `pwd`/coverage.sh
        cd -
    fi
fi
 No newline at end of file
Loading