mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Merge branch 'branch-0.3.0' into 'branch-0.3.0'
MS-86 remove old names from source code See merge request megasearch/vecwise_engine!93 Former-commit-id: 3c079e409b4a61f770f49569c3b000e283386db6
This commit is contained in:
commit
a5e3c5c96a
6
cpp/.gitignore
vendored
6
cpp/.gitignore
vendored
@ -1,7 +1,3 @@
|
||||
third_party/thrift-0.12.0/
|
||||
third_party/faiss-1.5.1/
|
||||
third_party/bzip2-1.0.6/
|
||||
third_party/sqlite3/
|
||||
megasearch/
|
||||
milvus/
|
||||
conf/server_config.yaml
|
||||
version.h
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
Please mark all change in change log and use the ticket from JIRA.
|
||||
|
||||
# MegaSearch 0.3.0 (TBD)
|
||||
# Milvus 0.3.0 (TBD)
|
||||
|
||||
## Bug
|
||||
- MS-80 - Fix server hang issue
|
||||
@ -34,7 +34,7 @@ Please mark all change in change log and use the ticket from JIRA.
|
||||
## Task
|
||||
- MS-74 - Change README.md in cpp
|
||||
|
||||
# MegaSearch 0.2.0 (2019-05-31)
|
||||
# Milvus 0.2.0 (2019-05-31)
|
||||
|
||||
## Bug
|
||||
|
||||
|
||||
@ -24,8 +24,8 @@ if(NOT GIT_BRANCH_NAME STREQUAL "")
|
||||
string(REGEX REPLACE "\n" "" GIT_BRANCH_NAME ${GIT_BRANCH_NAME})
|
||||
endif()
|
||||
|
||||
set(MEGASEARCH_VERSION "${GIT_BRANCH_NAME}")
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]" MEGASEARCH_VERSION "${MEGASEARCH_VERSION}")
|
||||
set(MILVUS_VERSION "${GIT_BRANCH_NAME}")
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]" MILVUS_VERSION "${MILVUS_VERSION}")
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
set(BUILD_TYPE "release")
|
||||
@ -34,8 +34,8 @@ else()
|
||||
endif()
|
||||
message(STATUS "Build type = ${BUILD_TYPE}")
|
||||
|
||||
project(megasearch VERSION "${MEGASEARCH_VERSION}")
|
||||
project(vecwise_engine LANGUAGES CUDA CXX)
|
||||
project(milvus VERSION "${MILVUS_VERSION}")
|
||||
project(milvus_engine LANGUAGES CUDA CXX)
|
||||
|
||||
# Ensure that a default make is set
|
||||
if("${MAKE}" STREQUAL "")
|
||||
@ -44,26 +44,26 @@ if("${MAKE}" STREQUAL "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(MEGASEARCH_VERSION_MAJOR "${megasearch_VERSION_MAJOR}")
|
||||
set(MEGASEARCH_VERSION_MINOR "${megasearch_VERSION_MINOR}")
|
||||
set(MEGASEARCH_VERSION_PATCH "${megasearch_VERSION_PATCH}")
|
||||
set(MILVUS_VERSION_MAJOR "${milvus_VERSION_MAJOR}")
|
||||
set(MILVUS_VERSION_MINOR "${milvus_VERSION_MINOR}")
|
||||
set(MILVUS_VERSION_PATCH "${milvus_VERSION_PATCH}")
|
||||
|
||||
if(MEGASEARCH_VERSION_MAJOR STREQUAL ""
|
||||
OR MEGASEARCH_VERSION_MINOR STREQUAL ""
|
||||
OR MEGASEARCH_VERSION_PATCH STREQUAL "")
|
||||
message(WARNING "Failed to determine MegaSearch version from '${MEGASEARCH_VERSION}'")
|
||||
set(MEGASEARCH_VERSION "unknown")
|
||||
if(MILVUS_VERSION_MAJOR STREQUAL ""
|
||||
OR MILVUS_VERSION_MINOR STREQUAL ""
|
||||
OR MILVUS_VERSION_PATCH STREQUAL "")
|
||||
message(WARNING "Failed to determine Milvus version from '${MILVUS_VERSION}'")
|
||||
set(MILVUS_VERSION "unknown")
|
||||
endif()
|
||||
|
||||
message(STATUS "Build version = ${MEGASEARCH_VERSION}")
|
||||
message(STATUS "Build version = ${MILVUS_VERSION}")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.macro ${CMAKE_CURRENT_SOURCE_DIR}/version.h)
|
||||
|
||||
message(STATUS "MegaSearch version: "
|
||||
"${MEGASEARCH_VERSION_MAJOR}.${MEGASEARCH_VERSION_MINOR}.${MEGASEARCH_VERSION_PATCH} "
|
||||
"(full: '${MEGASEARCH_VERSION}')")
|
||||
message(STATUS "Milvus version: "
|
||||
"${MILVUS_VERSION_MAJOR}.${MILVUS_VERSION_MINOR}.${MILVUS_VERSION_PATCH} "
|
||||
"(full: '${MILVUS_VERSION}')")
|
||||
|
||||
set(MEGASEARCH_SOURCE_DIR ${PROJECT_SOURCE_DIR})
|
||||
set(MEGASEARCH_BINARY_DIR ${PROJECT_BINARY_DIR})
|
||||
set(MILVUS_SOURCE_DIR ${PROJECT_SOURCE_DIR})
|
||||
set(MILVUS_BINARY_DIR ${PROJECT_BINARY_DIR})
|
||||
|
||||
find_package(CUDA)
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -std=c++11 -D_FORCE_INLINES -arch sm_60 --expt-extended-lambda")
|
||||
@ -79,15 +79,15 @@ set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED on)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
|
||||
message("building vecwise_engine on x86 architecture")
|
||||
set(VECWISE_BUILD_ARCH x86_64)
|
||||
message("building milvus_engine on x86 architecture")
|
||||
set(MILVUS_BUILD_ARCH x86_64)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(ppc)")
|
||||
message("building vecwise_engine on ppc architecture")
|
||||
set(VECWISE_BUILD_ARCH ppc64le)
|
||||
message("building milvus_engine on ppc architecture")
|
||||
set(MILVUS_BUILD_ARCH ppc64le)
|
||||
else()
|
||||
message("unknown processor type")
|
||||
message("CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(VECWISE_BUILD_ARCH unknown)
|
||||
set(MILVUS_BUILD_ARCH unknown)
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
@ -104,34 +104,30 @@ endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
#if (BUILD_UNIT_TEST)
|
||||
# option(MEGASEARCH_BUILD_TESTS "Build the megasearch test suite" ON)
|
||||
#endif(BUILD_UNIT_TEST)
|
||||
|
||||
include(ExternalProject)
|
||||
include(DefineOptions)
|
||||
include(BuildUtils)
|
||||
include(ThirdPartyPackages)
|
||||
|
||||
include_directories(${MEGASEARCH_SOURCE_DIR})
|
||||
link_directories(${MEGASEARCH_BINARY_DIR})
|
||||
include_directories(${MILVUS_SOURCE_DIR})
|
||||
link_directories(${MILVUS_BINARY_DIR})
|
||||
|
||||
## Following should be check
|
||||
|
||||
set(VECWISE_ENGINE_INCLUDE ${PROJECT_SOURCE_DIR}/include)
|
||||
set(VECWISE_ENGINE_SRC ${PROJECT_SOURCE_DIR}/src)
|
||||
#set(VECWISE_THIRD_PARTY ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
|
||||
#set(VECWISE_THIRD_PARTY_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/third_party/build)
|
||||
set(MILVUS_ENGINE_INCLUDE ${PROJECT_SOURCE_DIR}/include)
|
||||
set(MILVUS_ENGINE_SRC ${PROJECT_SOURCE_DIR}/src)
|
||||
#set(MILVUS_THIRD_PARTY ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
|
||||
#set(MILVUS_THIRD_PARTY_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/third_party/build)
|
||||
|
||||
add_compile_definitions(PROFILER=${PROFILER})
|
||||
|
||||
include_directories(${VECWISE_ENGINE_INCLUDE})
|
||||
include_directories(${VECWISE_ENGINE_SRC})
|
||||
#include_directories(${VECWISE_THIRD_PARTY_BUILD}/include)
|
||||
include_directories(${MILVUS_ENGINE_INCLUDE})
|
||||
include_directories(${MILVUS_ENGINE_SRC})
|
||||
#include_directories(${MILVUS_THIRD_PARTY_BUILD}/include)
|
||||
|
||||
link_directories(${CMAKE_CURRRENT_BINARY_DIR})
|
||||
#link_directories(${VECWISE_THIRD_PARTY_BUILD}/lib)
|
||||
#link_directories(${VECWISE_THIRD_PARTY_BUILD}/lib64)
|
||||
#link_directories(${MILVUS_THIRD_PARTY_BUILD}/lib)
|
||||
#link_directories(${MILVUS_THIRD_PARTY_BUILD}/lib64)
|
||||
#execute_process(COMMAND bash build.sh
|
||||
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
|
||||
|
||||
@ -151,7 +147,7 @@ install(FILES
|
||||
scripts)
|
||||
install(FILES
|
||||
conf/server_config.yaml
|
||||
conf/vecwise_engine_log.conf
|
||||
conf/log_config.conf
|
||||
DESTINATION
|
||||
conf)
|
||||
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
sudo apt-get install gfortran flex bison
|
||||
|
||||
#### Step 2: build(output to cmake_build folder)
|
||||
cmake_build/src/vecwise_server is the server
|
||||
cmake_build/src/milvus_server is the server
|
||||
|
||||
cmake_build/src/libvecwise_engine.a is the static library
|
||||
cmake_build/src/libmilvus_engine.a is the static library
|
||||
|
||||
cd [sourcecode path]/cpp
|
||||
./build.sh -t Debug
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
BUILD_TYPE="Debug"
|
||||
BUILD_UNITTEST="off"
|
||||
BUILD_GPU="OFF"
|
||||
INSTALL_PREFIX=$(pwd)/megasearch
|
||||
INSTALL_PREFIX=$(pwd)/milvus
|
||||
MAKE_CLEAN="OFF"
|
||||
|
||||
while getopts "p:t:uhgr" arg
|
||||
@ -75,7 +75,7 @@ fi
|
||||
make -j 4 || exit 1
|
||||
|
||||
if [[ ${BUILD_TYPE} != "Debug" ]]; then
|
||||
strip src/vecwise_server
|
||||
strip src/milvus_server
|
||||
fi
|
||||
|
||||
make install
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
|
||||
macro(set_option_category name)
|
||||
set(MEGASEARCH_OPTION_CATEGORY ${name})
|
||||
list(APPEND "MEGASEARCH_OPTION_CATEGORIES" ${name})
|
||||
set(MILVUS_OPTION_CATEGORY ${name})
|
||||
list(APPEND "MILVUS_OPTION_CATEGORIES" ${name})
|
||||
endmacro()
|
||||
|
||||
macro(define_option name description default)
|
||||
option(${name} ${description} ${default})
|
||||
list(APPEND "MEGASEARCH_${MEGASEARCH_OPTION_CATEGORY}_OPTION_NAMES" ${name})
|
||||
list(APPEND "MILVUS_${MILVUS_OPTION_CATEGORY}_OPTION_NAMES" ${name})
|
||||
set("${name}_OPTION_DESCRIPTION" ${description})
|
||||
set("${name}_OPTION_DEFAULT" ${default})
|
||||
set("${name}_OPTION_TYPE" "bool")
|
||||
@ -28,7 +28,7 @@ endfunction()
|
||||
|
||||
macro(define_option_string name description default)
|
||||
set(${name} ${default} CACHE STRING ${description})
|
||||
list(APPEND "MEGASEARCH_${MEGASEARCH_OPTION_CATEGORY}_OPTION_NAMES" ${name})
|
||||
list(APPEND "MILVUS_${MILVUS_OPTION_CATEGORY}_OPTION_NAMES" ${name})
|
||||
set("${name}_OPTION_DESCRIPTION" ${description})
|
||||
set("${name}_OPTION_DEFAULT" "\"${default}\"")
|
||||
set("${name}_OPTION_TYPE" "string")
|
||||
@ -43,69 +43,69 @@ endmacro()
|
||||
#----------------------------------------------------------------------
|
||||
set_option_category("Thirdparty")
|
||||
|
||||
set(MEGASEARCH_DEPENDENCY_SOURCE_DEFAULT "AUTO")
|
||||
set(MILVUS_DEPENDENCY_SOURCE_DEFAULT "AUTO")
|
||||
|
||||
define_option_string(MEGASEARCH_DEPENDENCY_SOURCE
|
||||
"Method to use for acquiring MEGASEARCH's build dependencies"
|
||||
"${MEGASEARCH_DEPENDENCY_SOURCE_DEFAULT}"
|
||||
define_option_string(MILVUS_DEPENDENCY_SOURCE
|
||||
"Method to use for acquiring MILVUS's build dependencies"
|
||||
"${MILVUS_DEPENDENCY_SOURCE_DEFAULT}"
|
||||
"AUTO"
|
||||
"BUNDLED"
|
||||
"SYSTEM")
|
||||
|
||||
define_option(MEGASEARCH_VERBOSE_THIRDPARTY_BUILD
|
||||
define_option(MILVUS_VERBOSE_THIRDPARTY_BUILD
|
||||
"Show output from ExternalProjects rather than just logging to files" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_ARROW "Build with ARROW" OFF)
|
||||
define_option(MILVUS_WITH_ARROW "Build with ARROW" OFF)
|
||||
|
||||
define_option(MEGASEARCH_BOOST_USE_SHARED "Rely on boost shared libraries where relevant" OFF)
|
||||
define_option(MILVUS_BOOST_USE_SHARED "Rely on boost shared libraries where relevant" OFF)
|
||||
|
||||
define_option(MEGASEARCH_BOOST_VENDORED "Use vendored Boost instead of existing Boost. \
|
||||
define_option(MILVUS_BOOST_VENDORED "Use vendored Boost instead of existing Boost. \
|
||||
Note that this requires linking Boost statically" ON)
|
||||
|
||||
define_option(MEGASEARCH_BOOST_HEADER_ONLY "Use only BOOST headers" OFF)
|
||||
define_option(MILVUS_BOOST_HEADER_ONLY "Use only BOOST headers" OFF)
|
||||
|
||||
define_option(MEGASEARCH_WITH_BZ2 "Build with BZ2 compression" ON)
|
||||
define_option(MILVUS_WITH_BZ2 "Build with BZ2 compression" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_EASYLOGGINGPP "Build with Easylogging++ library" ON)
|
||||
define_option(MILVUS_WITH_EASYLOGGINGPP "Build with Easylogging++ library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_FAISS "Build with FAISS library" ON)
|
||||
define_option(MILVUS_WITH_FAISS "Build with FAISS library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_FAISS_GPU_VERSION "Build with FAISS GPU version" ON)
|
||||
define_option(MILVUS_WITH_FAISS_GPU_VERSION "Build with FAISS GPU version" ON)
|
||||
|
||||
#define_option_string(MEGASEARCH_FAISS_GPU_ARCH "Specifying which GPU architectures to build against"
|
||||
#define_option_string(MILVUS_FAISS_GPU_ARCH "Specifying which GPU architectures to build against"
|
||||
# "-gencode=arch=compute_35,code=compute_35 -gencode=arch=compute_52,code=compute_52 -gencode=arch=compute_60,code=compute_60 -gencode=arch=compute_61,code=compute_61")
|
||||
|
||||
define_option(MEGASEARCH_WITH_LAPACK "Build with LAPACK library" ON)
|
||||
define_option(MILVUS_WITH_LAPACK "Build with LAPACK library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_LZ4 "Build with lz4 compression" ON)
|
||||
define_option(MILVUS_WITH_LZ4 "Build with lz4 compression" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_JSONCONS "Build with JSONCONS" OFF)
|
||||
define_option(MILVUS_WITH_JSONCONS "Build with JSONCONS" OFF)
|
||||
|
||||
define_option(MEGASEARCH_WITH_OPENBLAS "Build with OpenBLAS library" ON)
|
||||
define_option(MILVUS_WITH_OPENBLAS "Build with OpenBLAS library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_PROMETHEUS "Build with PROMETHEUS library" ON)
|
||||
define_option(MILVUS_WITH_PROMETHEUS "Build with PROMETHEUS library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_ROCKSDB "Build with RocksDB library" OFF)
|
||||
define_option(MILVUS_WITH_ROCKSDB "Build with RocksDB library" OFF)
|
||||
|
||||
define_option(MEGASEARCH_WITH_SNAPPY "Build with Snappy compression" ON)
|
||||
define_option(MILVUS_WITH_SNAPPY "Build with Snappy compression" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_SQLITE "Build with SQLite library" ON)
|
||||
define_option(MILVUS_WITH_SQLITE "Build with SQLite library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_SQLITE_ORM "Build with SQLite ORM library" ON)
|
||||
define_option(MILVUS_WITH_SQLITE_ORM "Build with SQLite ORM library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_THRIFT "Build with Apache Thrift library" ON)
|
||||
define_option(MILVUS_WITH_THRIFT "Build with Apache Thrift library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_YAMLCPP "Build with yaml-cpp library" ON)
|
||||
define_option(MILVUS_WITH_YAMLCPP "Build with yaml-cpp library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_ZLIB "Build with zlib compression" ON)
|
||||
define_option(MILVUS_WITH_ZLIB "Build with zlib compression" ON)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.7)
|
||||
set(MEGASEARCH_WITH_ZSTD_DEFAULT OFF)
|
||||
set(MILVUS_WITH_ZSTD_DEFAULT OFF)
|
||||
else()
|
||||
# ExternalProject_Add(SOURCE_SUBDIR) is available since CMake 3.7.
|
||||
set(MEGASEARCH_WITH_ZSTD_DEFAULT ON)
|
||||
set(MILVUS_WITH_ZSTD_DEFAULT ON)
|
||||
endif()
|
||||
define_option(MEGASEARCH_WITH_ZSTD "Build with zstd compression" ${MEGASEARCH_WITH_ZSTD_DEFAULT})
|
||||
define_option(MILVUS_WITH_ZSTD "Build with zstd compression" ${MILVUS_WITH_ZSTD_DEFAULT})
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
if(MSVC)
|
||||
@ -115,7 +115,7 @@ if(MSVC)
|
||||
"Pass verbose linking options when linking libraries and executables"
|
||||
OFF)
|
||||
|
||||
define_option(MEGASEARCH_USE_STATIC_CRT "Build MEGASEARCH with statically linked CRT" OFF)
|
||||
define_option(MILVUS_USE_STATIC_CRT "Build MILVUS with statically linked CRT" OFF)
|
||||
endif()
|
||||
|
||||
|
||||
@ -123,15 +123,15 @@ endif()
|
||||
set_option_category("Test and benchmark")
|
||||
|
||||
if (BUILD_UNIT_TEST)
|
||||
define_option(MEGASEARCH_BUILD_TESTS "Build the MEGASEARCH googletest unit tests" ON)
|
||||
define_option(MILVUS_BUILD_TESTS "Build the MILVUS googletest unit tests" ON)
|
||||
else()
|
||||
define_option(MEGASEARCH_BUILD_TESTS "Build the MEGASEARCH googletest unit tests" OFF)
|
||||
define_option(MILVUS_BUILD_TESTS "Build the MILVUS googletest unit tests" OFF)
|
||||
endif(BUILD_UNIT_TEST)
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
macro(config_summary)
|
||||
message(STATUS "---------------------------------------------------------------------")
|
||||
message(STATUS "MEGASEARCH version: ${MEGASEARCH_VERSION}")
|
||||
message(STATUS "MILVUS version: ${MILVUS_VERSION}")
|
||||
message(STATUS)
|
||||
message(STATUS "Build configuration summary:")
|
||||
|
||||
@ -143,12 +143,12 @@ macro(config_summary)
|
||||
STATUS " Compile commands: ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json")
|
||||
endif()
|
||||
|
||||
foreach(category ${MEGASEARCH_OPTION_CATEGORIES})
|
||||
foreach(category ${MILVUS_OPTION_CATEGORIES})
|
||||
|
||||
message(STATUS)
|
||||
message(STATUS "${category} options:")
|
||||
|
||||
set(option_names ${MEGASEARCH_${category}_OPTION_NAMES})
|
||||
set(option_names ${MILVUS_${category}_OPTION_NAMES})
|
||||
|
||||
set(max_value_length 0)
|
||||
foreach(name ${option_names})
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
set(MEGASEARCH_THIRDPARTY_DEPENDENCIES
|
||||
set(MILVUS_THIRDPARTY_DEPENDENCIES
|
||||
|
||||
ARROW
|
||||
BOOST
|
||||
@ -37,12 +37,12 @@ set(MEGASEARCH_THIRDPARTY_DEPENDENCIES
|
||||
ZLIB
|
||||
ZSTD)
|
||||
|
||||
message(STATUS "Using ${MEGASEARCH_DEPENDENCY_SOURCE} approach to find dependencies")
|
||||
message(STATUS "Using ${MILVUS_DEPENDENCY_SOURCE} approach to find dependencies")
|
||||
|
||||
# For each dependency, set dependency source to global default, if unset
|
||||
foreach(DEPENDENCY ${MEGASEARCH_THIRDPARTY_DEPENDENCIES})
|
||||
foreach(DEPENDENCY ${MILVUS_THIRDPARTY_DEPENDENCIES})
|
||||
if("${${DEPENDENCY}_SOURCE}" STREQUAL "")
|
||||
set(${DEPENDENCY}_SOURCE ${MEGASEARCH_DEPENDENCY_SOURCE})
|
||||
set(${DEPENDENCY}_SOURCE ${MILVUS_DEPENDENCY_SOURCE})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@ -145,7 +145,7 @@ set(EP_COMMON_CMAKE_ARGS
|
||||
-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}
|
||||
-DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS})
|
||||
|
||||
if(NOT MEGASEARCH_VERBOSE_THIRDPARTY_BUILD)
|
||||
if(NOT MILVUS_VERBOSE_THIRDPARTY_BUILD)
|
||||
set(EP_LOG_OPTIONS LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_DOWNLOAD 1)
|
||||
else()
|
||||
set(EP_LOG_OPTIONS)
|
||||
@ -161,7 +161,6 @@ endif()
|
||||
set(MAKE_BUILD_ARGS "-j4")
|
||||
|
||||
## Using make -j in sub-make is fragile
|
||||
## see discussion https://github.com/apache/MEGASEARCH/pull/2779
|
||||
#if(${CMAKE_GENERATOR} MATCHES "Makefiles")
|
||||
# set(MAKE_BUILD_ARGS "")
|
||||
#else()
|
||||
@ -180,7 +179,7 @@ find_package(Threads REQUIRED)
|
||||
# offline builds
|
||||
|
||||
# Read toolchain versions from cpp/thirdparty/versions.txt
|
||||
set(THIRDPARTY_DIR "${MEGASEARCH_SOURCE_DIR}/thirdparty")
|
||||
set(THIRDPARTY_DIR "${MILVUS_SOURCE_DIR}/thirdparty")
|
||||
file(STRINGS "${THIRDPARTY_DIR}/versions.txt" TOOLCHAIN_VERSIONS_TXT)
|
||||
foreach(_VERSION_ENTRY ${TOOLCHAIN_VERSIONS_TXT})
|
||||
# Exclude comments
|
||||
@ -202,16 +201,16 @@ foreach(_VERSION_ENTRY ${TOOLCHAIN_VERSIONS_TXT})
|
||||
set(${_LIB_NAME} "${_LIB_VERSION}")
|
||||
endforeach()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_ARROW_URL})
|
||||
set(ARROW_SOURCE_URL "$ENV{MEGASEARCH_ARROW_URL}")
|
||||
if(DEFINED ENV{MILVUS_ARROW_URL})
|
||||
set(ARROW_SOURCE_URL "$ENV{MILVUS_ARROW_URL}")
|
||||
else()
|
||||
set(ARROW_SOURCE_URL
|
||||
"https://github.com/youny626/arrow.git"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_BOOST_URL})
|
||||
set(BOOST_SOURCE_URL "$ENV{MEGASEARCH_BOOST_URL}")
|
||||
if(DEFINED ENV{MILVUS_BOOST_URL})
|
||||
set(BOOST_SOURCE_URL "$ENV{MILVUS_BOOST_URL}")
|
||||
else()
|
||||
string(REPLACE "." "_" BOOST_VERSION_UNDERSCORES ${BOOST_VERSION})
|
||||
set(BOOST_SOURCE_URL
|
||||
@ -219,58 +218,58 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_BZIP2_URL})
|
||||
set(BZIP2_SOURCE_URL "$ENV{MEGASEARCH_BZIP2_URL}")
|
||||
if(DEFINED ENV{MILVUS_BZIP2_URL})
|
||||
set(BZIP2_SOURCE_URL "$ENV{MILVUS_BZIP2_URL}")
|
||||
else()
|
||||
set(BZIP2_SOURCE_URL "https://fossies.org/linux/misc/bzip2-${BZIP2_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_EASYLOGGINGPP_URL})
|
||||
set(EASYLOGGINGPP_SOURCE_URL "$ENV{MEGASEARCH_EASYLOGGINGPP_URL}")
|
||||
if(DEFINED ENV{MILVUS_EASYLOGGINGPP_URL})
|
||||
set(EASYLOGGINGPP_SOURCE_URL "$ENV{MILVUS_EASYLOGGINGPP_URL}")
|
||||
else()
|
||||
set(EASYLOGGINGPP_SOURCE_URL "https://github.com/zuhd-org/easyloggingpp/archive/${EASYLOGGINGPP_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_FAISS_URL})
|
||||
set(FAISS_SOURCE_URL "$ENV{MEGASEARCH_FAISS_URL}")
|
||||
if(DEFINED ENV{MILVUS_FAISS_URL})
|
||||
set(FAISS_SOURCE_URL "$ENV{MILVUS_FAISS_URL}")
|
||||
else()
|
||||
set(FAISS_SOURCE_URL "https://github.com/facebookresearch/faiss/archive/${FAISS_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{MEGASEARCH_GTEST_URL})
|
||||
set(GTEST_SOURCE_URL "$ENV{MEGASEARCH_GTEST_URL}")
|
||||
if (DEFINED ENV{MILVUS_GTEST_URL})
|
||||
set(GTEST_SOURCE_URL "$ENV{MILVUS_GTEST_URL}")
|
||||
else ()
|
||||
set(GTEST_SOURCE_URL
|
||||
"https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{MEGASEARCH_JSONCONS_URL})
|
||||
set(JSONCONS_SOURCE_URL "$ENV{MEGASEARCH_JSONCONS_URL}")
|
||||
if (DEFINED ENV{MILVUS_JSONCONS_URL})
|
||||
set(JSONCONS_SOURCE_URL "$ENV{MILVUS_JSONCONS_URL}")
|
||||
else ()
|
||||
set(JSONCONS_SOURCE_URL
|
||||
"https://github.com/danielaparker/jsoncons/archive/v${JSONCONS_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_LAPACK_URL})
|
||||
set(LAPACK_SOURCE_URL "$ENV{MEGASEARCH_LAPACK_URL}")
|
||||
if(DEFINED ENV{MILVUS_LAPACK_URL})
|
||||
set(LAPACK_SOURCE_URL "$ENV{MILVUS_LAPACK_URL}")
|
||||
else()
|
||||
set(LAPACK_SOURCE_URL "https://github.com/Reference-LAPACK/lapack/archive/${LAPACK_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_LZ4_URL})
|
||||
set(LZ4_SOURCE_URL "$ENV{MEGASEARCH_LZ4_URL}")
|
||||
if(DEFINED ENV{MILVUS_LZ4_URL})
|
||||
set(LZ4_SOURCE_URL "$ENV{MILVUS_LZ4_URL}")
|
||||
else()
|
||||
set(LZ4_SOURCE_URL "https://github.com/lz4/lz4/archive/${LZ4_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{MEGASEARCH_OPENBLAS_URL})
|
||||
set(OPENBLAS_SOURCE_URL "$ENV{MEGASEARCH_OPENBLAS_URL}")
|
||||
if (DEFINED ENV{MILVUS_OPENBLAS_URL})
|
||||
set(OPENBLAS_SOURCE_URL "$ENV{MILVUS_OPENBLAS_URL}")
|
||||
else ()
|
||||
set(OPENBLAS_SOURCE_URL
|
||||
"https://github.com/xianyi/OpenBLAS/archive/${OPENBLAS_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{MEGASEARCH_PROMETHEUS_URL})
|
||||
if (DEFINED ENV{MILVUS_PROMETHEUS_URL})
|
||||
set(PROMETHEUS_SOURCE_URL "$ENV{PROMETHEUS_OPENBLAS_URL}")
|
||||
else ()
|
||||
set(PROMETHEUS_SOURCE_URL
|
||||
@ -278,55 +277,55 @@ else ()
|
||||
https://github.com/jupp0r/prometheus-cpp.git)
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{MEGASEARCH_ROCKSDB_URL})
|
||||
set(ROCKSDB_SOURCE_URL "$ENV{MEGASEARCH_ROCKSDB_URL}")
|
||||
if (DEFINED ENV{MILVUS_ROCKSDB_URL})
|
||||
set(ROCKSDB_SOURCE_URL "$ENV{MILVUS_ROCKSDB_URL}")
|
||||
else ()
|
||||
set(ROCKSDB_SOURCE_URL
|
||||
"https://github.com/facebook/rocksdb/archive/${ROCKSDB_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_SNAPPY_URL})
|
||||
set(SNAPPY_SOURCE_URL "$ENV{MEGASEARCH_SNAPPY_URL}")
|
||||
if(DEFINED ENV{MILVUS_SNAPPY_URL})
|
||||
set(SNAPPY_SOURCE_URL "$ENV{MILVUS_SNAPPY_URL}")
|
||||
else()
|
||||
set(SNAPPY_SOURCE_URL
|
||||
"https://github.com/google/snappy/archive/${SNAPPY_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_SQLITE_URL})
|
||||
set(SQLITE_SOURCE_URL "$ENV{MEGASEARCH_SQLITE_URL}")
|
||||
if(DEFINED ENV{MILVUS_SQLITE_URL})
|
||||
set(SQLITE_SOURCE_URL "$ENV{MILVUS_SQLITE_URL}")
|
||||
else()
|
||||
set(SQLITE_SOURCE_URL
|
||||
"https://www.sqlite.org/2019/sqlite-autoconf-${SQLITE_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_SQLITE_ORM_URL})
|
||||
set(SQLITE_ORM_SOURCE_URL "$ENV{MEGASEARCH_SQLITE_ORM_URL}")
|
||||
if(DEFINED ENV{MILVUS_SQLITE_ORM_URL})
|
||||
set(SQLITE_ORM_SOURCE_URL "$ENV{MILVUS_SQLITE_ORM_URL}")
|
||||
else()
|
||||
set(SQLITE_ORM_SOURCE_URL
|
||||
"https://github.com/fnc12/sqlite_orm/archive/${SQLITE_ORM_VERSION}.zip")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_THRIFT_URL})
|
||||
set(THRIFT_SOURCE_URL "$ENV{MEGASEARCH_THRIFT_URL}")
|
||||
if(DEFINED ENV{MILVUS_THRIFT_URL})
|
||||
set(THRIFT_SOURCE_URL "$ENV{MILVUS_THRIFT_URL}")
|
||||
else()
|
||||
set(THRIFT_SOURCE_URL
|
||||
"https://github.com/apache/thrift/archive/${THRIFT_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_YAMLCPP_URL})
|
||||
set(YAMLCPP_SOURCE_URL "$ENV{MEGASEARCH_YAMLCPP_URL}")
|
||||
if(DEFINED ENV{MILVUS_YAMLCPP_URL})
|
||||
set(YAMLCPP_SOURCE_URL "$ENV{MILVUS_YAMLCPP_URL}")
|
||||
else()
|
||||
set(YAMLCPP_SOURCE_URL "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-${YAMLCPP_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_ZLIB_URL})
|
||||
set(ZLIB_SOURCE_URL "$ENV{MEGASEARCH_ZLIB_URL}")
|
||||
if(DEFINED ENV{MILVUS_ZLIB_URL})
|
||||
set(ZLIB_SOURCE_URL "$ENV{MILVUS_ZLIB_URL}")
|
||||
else()
|
||||
set(ZLIB_SOURCE_URL "https://github.com/madler/zlib/archive/${ZLIB_VERSION}.tar.gz")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{MEGASEARCH_ZSTD_URL})
|
||||
set(ZSTD_SOURCE_URL "$ENV{MEGASEARCH_ZSTD_URL}")
|
||||
if(DEFINED ENV{MILVUS_ZSTD_URL})
|
||||
set(ZSTD_SOURCE_URL "$ENV{MILVUS_ZSTD_URL}")
|
||||
else()
|
||||
set(ZSTD_SOURCE_URL "https://github.com/facebook/zstd/archive/${ZSTD_VERSION}.tar.gz")
|
||||
endif()
|
||||
@ -410,7 +409,7 @@ macro(build_arrow)
|
||||
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_ARROW)
|
||||
if(MILVUS_WITH_ARROW)
|
||||
|
||||
resolve_dependency(ARROW)
|
||||
|
||||
@ -422,7 +421,7 @@ endif()
|
||||
# Add Boost dependencies (code adapted from Apache Kudu (incubating))
|
||||
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
if(MSVC AND MEGASEARCH_USE_STATIC_CRT)
|
||||
if(MSVC AND MILVUS_USE_STATIC_CRT)
|
||||
set(Boost_USE_STATIC_RUNTIME ON)
|
||||
endif()
|
||||
set(Boost_ADDITIONAL_VERSIONS
|
||||
@ -449,7 +448,7 @@ set(Boost_ADDITIONAL_VERSIONS
|
||||
"1.60.0"
|
||||
"1.60")
|
||||
|
||||
if(MEGASEARCH_BOOST_VENDORED)
|
||||
if(MILVUS_BOOST_VENDORED)
|
||||
set(BOOST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/boost_ep-prefix/src/boost_ep")
|
||||
set(BOOST_LIB_DIR "${BOOST_PREFIX}/stage/lib")
|
||||
set(BOOST_BUILD_LINK "static")
|
||||
@ -466,7 +465,7 @@ if(MEGASEARCH_BOOST_VENDORED)
|
||||
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_static)
|
||||
set(BOOST_SERIALIZATION_LIBRARY boost_serialization_static)
|
||||
|
||||
if(MEGASEARCH_BOOST_HEADER_ONLY)
|
||||
if(MILVUS_BOOST_HEADER_ONLY)
|
||||
set(BOOST_BUILD_PRODUCTS)
|
||||
set(BOOST_CONFIGURE_COMMAND "")
|
||||
set(BOOST_BUILD_COMMAND "")
|
||||
@ -492,7 +491,7 @@ if(MEGASEARCH_BOOST_VENDORED)
|
||||
|
||||
add_thirdparty_lib(boost_serialization STATIC_LIB "${BOOST_STATIC_SERIALIZATION_LIBRARY}")
|
||||
|
||||
set(MEGASEARCH_BOOST_LIBS ${BOOST_SYSTEM_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY} ${BOOST_STATIC_SERIALIZATION_LIBRARY})
|
||||
set(MILVUS_BOOST_LIBS ${BOOST_SYSTEM_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY} ${BOOST_STATIC_SERIALIZATION_LIBRARY})
|
||||
endif()
|
||||
externalproject_add(boost_ep
|
||||
URL
|
||||
@ -526,7 +525,7 @@ else()
|
||||
# set(Boost_NO_SYSTEM_PATHS ON)
|
||||
# endif()
|
||||
|
||||
if(MEGASEARCH_BOOST_USE_SHARED)
|
||||
if(MILVUS_BOOST_USE_SHARED)
|
||||
# Find shared Boost libraries.
|
||||
set(Boost_USE_STATIC_LIBS OFF)
|
||||
set(BUILD_SHARED_LIBS_KEEP ${BUILD_SHARED_LIBS})
|
||||
@ -537,14 +536,14 @@ else()
|
||||
add_definitions(-DBOOST_ALL_DYN_LINK)
|
||||
endif()
|
||||
|
||||
if(MEGASEARCH_BOOST_HEADER_ONLY)
|
||||
if(MILVUS_BOOST_HEADER_ONLY)
|
||||
find_package(Boost REQUIRED)
|
||||
else()
|
||||
find_package(Boost COMPONENTS serialization system filesystem REQUIRED)
|
||||
set(BOOST_SYSTEM_LIBRARY Boost::system)
|
||||
set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem)
|
||||
set(BOOST_SERIALIZATION_LIBRARY Boost::serialization)
|
||||
set(MEGASEARCH_BOOST_LIBS ${BOOST_SYSTEM_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY})
|
||||
set(MILVUS_BOOST_LIBS ${BOOST_SYSTEM_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY})
|
||||
endif()
|
||||
set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_KEEP})
|
||||
unset(BUILD_SHARED_LIBS_KEEP)
|
||||
@ -552,14 +551,14 @@ else()
|
||||
# Find static boost headers and libs
|
||||
# TODO Differentiate here between release and debug builds
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
if(MEGASEARCH_BOOST_HEADER_ONLY)
|
||||
if(MILVUS_BOOST_HEADER_ONLY)
|
||||
find_package(Boost REQUIRED)
|
||||
else()
|
||||
find_package(Boost COMPONENTS serialization system filesystem REQUIRED)
|
||||
set(BOOST_SYSTEM_LIBRARY Boost::system)
|
||||
set(BOOST_FILESYSTEM_LIBRARY Boost::filesystem)
|
||||
set(BOOST_SERIALIZATION_LIBRARY Boost::serialization)
|
||||
set(MEGASEARCH_BOOST_LIBS ${BOOST_SYSTEM_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY})
|
||||
set(MILVUS_BOOST_LIBS ${BOOST_SYSTEM_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -612,7 +611,7 @@ macro(build_bzip2)
|
||||
add_dependencies(bzip2 bzip2_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_BZ2)
|
||||
if(MILVUS_WITH_BZ2)
|
||||
resolve_dependency(BZip2)
|
||||
|
||||
if(NOT TARGET bzip2)
|
||||
@ -664,7 +663,7 @@ macro(build_easyloggingpp)
|
||||
add_dependencies(easyloggingpp easyloggingpp_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_EASYLOGGINGPP)
|
||||
if(MILVUS_WITH_EASYLOGGINGPP)
|
||||
resolve_dependency(Easylogging++)
|
||||
|
||||
get_target_property(EASYLOGGINGPP_INCLUDE_DIR easyloggingpp INTERFACE_INCLUDE_DIRECTORIES)
|
||||
@ -710,7 +709,7 @@ macro(build_openblas)
|
||||
add_dependencies(openblas openblas_ep)
|
||||
endmacro()
|
||||
|
||||
#if(MEGASEARCH_WITH_OPENBLAS)
|
||||
#if(MILVUS_WITH_OPENBLAS)
|
||||
# resolve_dependency(OpenBLAS)
|
||||
#
|
||||
# get_target_property(OPENBLAS_INCLUDE_DIR openblas INTERFACE_INCLUDE_DIRECTORIES)
|
||||
@ -754,7 +753,7 @@ macro(build_lapack)
|
||||
add_dependencies(lapack lapack_ep)
|
||||
endmacro()
|
||||
|
||||
#if(MEGASEARCH_WITH_LAPACK)
|
||||
#if(MILVUS_WITH_LAPACK)
|
||||
# resolve_dependency(LAPACK)
|
||||
#
|
||||
# get_target_property(LAPACK_INCLUDE_DIR lapack INTERFACE_INCLUDE_DIRECTORIES)
|
||||
@ -791,7 +790,7 @@ macro(build_faiss)
|
||||
# endif()
|
||||
# set(FAISS_DEPENDENCIES ${FAISS_DEPENDENCIES} ${OPENBLAS_LIBRARY})
|
||||
|
||||
if(${MEGASEARCH_WITH_FAISS_GPU_VERSION} STREQUAL "ON")
|
||||
if(${MILVUS_WITH_FAISS_GPU_VERSION} STREQUAL "ON")
|
||||
set(FAISS_CONFIGURE_ARGS ${FAISS_CONFIGURE_ARGS}
|
||||
"--with-cuda=${CUDA_TOOLKIT_ROOT_DIR}"
|
||||
# "with_cuda_arch=\"-gencode=arch=compute_35,code=compute_35 \\
|
||||
@ -852,7 +851,7 @@ macro(build_faiss)
|
||||
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_FAISS)
|
||||
if(MILVUS_WITH_FAISS)
|
||||
|
||||
resolve_dependency(OpenBLAS)
|
||||
get_target_property(OPENBLAS_INCLUDE_DIR openblas INTERFACE_INCLUDE_DIRECTORIES)
|
||||
@ -944,7 +943,7 @@ macro(build_gtest)
|
||||
|
||||
endmacro()
|
||||
|
||||
if (MEGASEARCH_BUILD_TESTS)
|
||||
if (MILVUS_BUILD_TESTS)
|
||||
#message(STATUS "Resolving gtest dependency")
|
||||
resolve_dependency(GTest)
|
||||
|
||||
@ -976,7 +975,7 @@ macro(build_jsoncons)
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_JSONCONS)
|
||||
if(MILVUS_WITH_JSONCONS)
|
||||
resolve_dependency(JSONCONS)
|
||||
include_directories(SYSTEM "${JSONCONS_INCLUDE_DIR}")
|
||||
endif()
|
||||
@ -990,7 +989,7 @@ macro(build_lz4)
|
||||
set(LZ4_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/lz4_ep-prefix/")
|
||||
|
||||
if(MSVC)
|
||||
if(MEGASEARCH_USE_STATIC_CRT)
|
||||
if(MILVUS_USE_STATIC_CRT)
|
||||
if(${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG")
|
||||
set(LZ4_RUNTIME_LIBRARY_LINKAGE "/p:RuntimeLibrary=MultiThreadedDebug")
|
||||
else()
|
||||
@ -1046,7 +1045,7 @@ macro(build_lz4)
|
||||
add_dependencies(lz4 lz4_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_LZ4)
|
||||
if(MILVUS_WITH_LZ4)
|
||||
resolve_dependency(Lz4)
|
||||
|
||||
# TODO: Don't use global includes but rather target_include_directories
|
||||
@ -1129,7 +1128,7 @@ macro(build_prometheus)
|
||||
add_dependencies(prometheus-cpp-core prometheus_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_PROMETHEUS)
|
||||
if(MILVUS_WITH_PROMETHEUS)
|
||||
|
||||
resolve_dependency(Prometheus)
|
||||
|
||||
@ -1191,7 +1190,7 @@ macro(build_rocksdb)
|
||||
add_dependencies(rocksdb rocksdb_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_ROCKSDB)
|
||||
if(MILVUS_WITH_ROCKSDB)
|
||||
|
||||
resolve_dependency(RocksDB)
|
||||
|
||||
@ -1244,7 +1243,7 @@ macro(build_snappy)
|
||||
add_dependencies(snappy snappy_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_SNAPPY)
|
||||
if(MILVUS_WITH_SNAPPY)
|
||||
# if(Snappy_SOURCE STREQUAL "AUTO")
|
||||
# # Normally *Config.cmake files reside in /usr/lib/cmake but Snappy
|
||||
# # errornously places them in ${CMAKE_ROOT}/Modules/
|
||||
@ -1320,7 +1319,7 @@ macro(build_sqlite)
|
||||
add_dependencies(sqlite sqlite_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_SQLITE)
|
||||
if(MILVUS_WITH_SQLITE)
|
||||
resolve_dependency(SQLite)
|
||||
include_directories(SYSTEM "${SQLITE_INCLUDE_DIR}")
|
||||
link_directories(SYSTEM ${SQLITE_PREFIX}/lib/)
|
||||
@ -1407,7 +1406,7 @@ macro(build_sqlite_orm)
|
||||
# add_dependencies(sqlite_orm sqlite_orm_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_SQLITE_ORM)
|
||||
if(MILVUS_WITH_SQLITE_ORM)
|
||||
resolve_dependency(SQLite_ORM)
|
||||
# ExternalProject_Get_Property(sqlite_orm_ep source_dir)
|
||||
# set(SQLITE_ORM_INCLUDE_DIR ${source_dir}/sqlite_orm_ep)
|
||||
@ -1451,7 +1450,7 @@ macro(build_thrift)
|
||||
|
||||
set(THRIFT_STATIC_LIB_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}thrift")
|
||||
if(MSVC)
|
||||
if(MEGASEARCH_USE_STATIC_CRT)
|
||||
if(MILVUS_USE_STATIC_CRT)
|
||||
set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}")
|
||||
set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DWITH_MT=ON")
|
||||
else()
|
||||
@ -1550,7 +1549,7 @@ macro(build_thrift)
|
||||
add_dependencies(thrift thrift_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_THRIFT)
|
||||
if(MILVUS_WITH_THRIFT)
|
||||
resolve_dependency(Thrift)
|
||||
# TODO: Don't use global includes but rather target_include_directories
|
||||
# MESSAGE(STATUS ${THRIFT_PREFIX}/lib/)
|
||||
@ -1594,7 +1593,7 @@ macro(build_yamlcpp)
|
||||
add_dependencies(yaml-cpp yaml-cpp_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_YAMLCPP)
|
||||
if(MILVUS_WITH_YAMLCPP)
|
||||
resolve_dependency(yaml-cpp)
|
||||
|
||||
# TODO: Don't use global includes but rather target_include_directories
|
||||
@ -1644,7 +1643,7 @@ macro(build_zlib)
|
||||
add_dependencies(zlib zlib_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_ZLIB)
|
||||
if(MILVUS_WITH_ZLIB)
|
||||
resolve_dependency(ZLIB)
|
||||
|
||||
# TODO: Don't use global includes but rather target_include_directories
|
||||
@ -1671,7 +1670,7 @@ macro(build_zstd)
|
||||
|
||||
if(MSVC)
|
||||
set(ZSTD_STATIC_LIB "${ZSTD_PREFIX}/lib/zstd_static.lib")
|
||||
if(MEGASEARCH_USE_STATIC_CRT)
|
||||
if(MILVUS_USE_STATIC_CRT)
|
||||
set(ZSTD_CMAKE_ARGS ${ZSTD_CMAKE_ARGS} "-DZSTD_USE_STATIC_RUNTIME=on")
|
||||
endif()
|
||||
else()
|
||||
@ -1716,7 +1715,7 @@ macro(build_zstd)
|
||||
add_dependencies(zstd zstd_ep)
|
||||
endmacro()
|
||||
|
||||
if(MEGASEARCH_WITH_ZSTD)
|
||||
if(MILVUS_WITH_ZSTD)
|
||||
resolve_dependency(ZSTD)
|
||||
|
||||
# TODO: Don't use global includes but rather target_include_directories
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
* GLOBAL:
|
||||
FORMAT = "%datetime | %level | %logger | %msg"
|
||||
FILENAME = "/tmp/milvus/logs/vecwise_engine-%datetime{%H:%m}-global.log"
|
||||
FILENAME = "/tmp/milvus/logs/milvus-%datetime{%H:%m}-global.log"
|
||||
ENABLED = true
|
||||
TO_FILE = true
|
||||
TO_STANDARD_OUTPUT = true
|
||||
@ -8,12 +8,12 @@
|
||||
PERFORMANCE_TRACKING = false
|
||||
MAX_LOG_FILE_SIZE = 2097152 ## Throw log files away after 2MB
|
||||
* DEBUG:
|
||||
FILENAME = "/tmp/milvus/logs/vecwise_engine-%datetime{%H:%m}-debug.log"
|
||||
FILENAME = "/tmp/milvus/logs/milvus-%datetime{%H:%m}-debug.log"
|
||||
ENABLED = true
|
||||
* WARNING:
|
||||
FILENAME = "/tmp/milvus/logs/vecwise_engine-%datetime{%H:%m}-warning.log"
|
||||
FILENAME = "/tmp/milvus/logs/milvus-%datetime{%H:%m}-warning.log"
|
||||
* TRACE:
|
||||
FILENAME = "/tmp/milvus/logs/vecwise_engine-%datetime{%H:%m}-trace.log"
|
||||
FILENAME = "/tmp/milvus/logs/milvus-%datetime{%H:%m}-trace.log"
|
||||
* VERBOSE:
|
||||
FORMAT = "%datetime{%d/%M/%y} | %level-%vlevel | %msg"
|
||||
TO_FILE = false
|
||||
@ -21,7 +21,7 @@
|
||||
## Error logs
|
||||
* ERROR:
|
||||
ENABLED = false
|
||||
FILENAME = "/tmp/milvus/logs/vecwise_engine-%datetime{%H:%m}-error.log"
|
||||
FILENAME = "/tmp/milvus/logs/milvus-%datetime{%H:%m}-error.log"
|
||||
* FATAL:
|
||||
ENABLED = false
|
||||
FILENAME = "/tmp/milvus/logs/vecwise_engine-%datetime{%H:%m}-fatal.log"
|
||||
FILENAME = "/tmp/milvus/logs/milvus-%datetime{%H:%m}-fatal.log"
|
||||
@ -15,7 +15,7 @@ metric_config:
|
||||
is_startup: true # true is on, false is off
|
||||
collector: prometheus # prometheus, now we only have prometheus
|
||||
prometheus_config:
|
||||
collect_type: pull # pull means prometheus pull the message from megasearch, push means megasearch push metric to push gateway
|
||||
collect_type: pull # pull means prometheus pull the message from server, push means server push metric to push gateway
|
||||
port: 8080
|
||||
push_gateway_ip_address: 127.0.0.1
|
||||
push_gateway_port: 9091
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
server_config:
|
||||
address: 0.0.0.0
|
||||
port: 33001
|
||||
transfer_protocol: binary #optional: binary, compact, json
|
||||
transfer_protocol: binary #optional: binary, compact, json
|
||||
server_mode: thread_pool #optional: simple, thread_pool
|
||||
gpu_index: 0 #which gpu to be used
|
||||
|
||||
@ -11,9 +11,18 @@ db_config:
|
||||
db_flush_interval: 5 #unit: second
|
||||
idmapper_max_open_file: 128
|
||||
|
||||
metric_config:
|
||||
is_startup: true # true is on, false is off
|
||||
collector: prometheus # prometheus, now we only have prometheus
|
||||
prometheus_config:
|
||||
collect_type: pull # pull means prometheus pull the message from server, push means server push metric to push gateway
|
||||
port: 8080
|
||||
push_gateway_ip_address: 127.0.0.1
|
||||
push_gateway_port: 9091
|
||||
|
||||
license_config:
|
||||
license_path: "/tmp/system.license"
|
||||
|
||||
cache_config:
|
||||
cpu_cache_capacity: 16 # unit: GB
|
||||
gpu_cache_capacity: 2 # unit: GB
|
||||
cpu_cache_capacity: 16 # unit: GB
|
||||
gpu_cache_capacity: 2 # unit: GB
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
../bin/vecwise_server -c ../conf/server_config.yaml -l ../conf/vecwise_engine_log.conf
|
||||
../bin/milvus_server -c ../conf/server_config.yaml -l ../conf/log_config.conf
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ function kill_progress()
|
||||
sleep 2
|
||||
}
|
||||
|
||||
STATUS=$(kill_progress "vecwise_server" )
|
||||
STATUS=$(kill_progress "milvus_server" )
|
||||
|
||||
if [[ ${STATUS} == "false" ]];then
|
||||
echo "Milvus server closed abnormally!"
|
||||
|
||||
@ -31,16 +31,16 @@ set(license_generator_files
|
||||
)
|
||||
|
||||
set(service_files
|
||||
thrift/gen-cpp/MegasearchService.cpp
|
||||
thrift/gen-cpp/megasearch_constants.cpp
|
||||
thrift/gen-cpp/megasearch_types.cpp
|
||||
thrift/gen-cpp/MilvusService.cpp
|
||||
thrift/gen-cpp/milvus_constants.cpp
|
||||
thrift/gen-cpp/milvus_types.cpp
|
||||
metrics/SystemInfo.cpp
|
||||
metrics/SystemInfo.h
|
||||
server/MegasearchThreadPoolServer.cpp
|
||||
server/MegasearchThreadPoolServer.h
|
||||
server/ThreadPoolServer.cpp
|
||||
server/ThreadPoolServer.h
|
||||
)
|
||||
|
||||
set(vecwise_engine_files
|
||||
set(engine_files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
|
||||
${cache_files}
|
||||
${db_files}
|
||||
@ -58,7 +58,6 @@ include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include")
|
||||
include_directories(thrift/gen-cpp)
|
||||
|
||||
set(third_party_libs
|
||||
#arrow
|
||||
easyloggingpp
|
||||
sqlite
|
||||
thrift
|
||||
@ -117,14 +116,14 @@ endif ()
|
||||
|
||||
|
||||
|
||||
cuda_add_library(vecwise_engine STATIC ${vecwise_engine_files})
|
||||
target_link_libraries(vecwise_engine ${engine_libs} ${third_party_libs})
|
||||
cuda_add_library(milvus_engine STATIC ${engine_files})
|
||||
target_link_libraries(milvus_engine ${engine_libs} ${third_party_libs})
|
||||
|
||||
add_library(metrics STATIC ${metrics_files})
|
||||
|
||||
if (ENABLE_LICENSE STREQUAL "ON")
|
||||
add_library(vecwise_license STATIC ${license_check_files})
|
||||
target_link_libraries(vecwise_license ${license_libs} ${third_party_libs})
|
||||
add_library(license_check STATIC ${license_check_files})
|
||||
target_link_libraries(license_check ${license_libs} ${third_party_libs})
|
||||
endif ()
|
||||
|
||||
set(metrics_lib
|
||||
@ -133,17 +132,16 @@ set(metrics_lib
|
||||
prometheus-cpp-core
|
||||
)
|
||||
|
||||
#add_library(vecwise_engine STATIC ${metrics_files} )
|
||||
target_link_libraries(metrics ${metrics_lib})
|
||||
|
||||
set(server_libs
|
||||
vecwise_engine
|
||||
milvus_engine
|
||||
pthread
|
||||
dl
|
||||
metrics
|
||||
)
|
||||
|
||||
add_executable(vecwise_server
|
||||
add_executable(milvus_server
|
||||
${config_files}
|
||||
${server_files}
|
||||
${utils_files}
|
||||
@ -153,23 +151,23 @@ add_executable(vecwise_server
|
||||
)
|
||||
|
||||
if (ENABLE_LICENSE STREQUAL "ON")
|
||||
target_link_libraries(vecwise_server ${server_libs} vecwise_license ${third_party_libs})
|
||||
target_link_libraries(milvus_server ${server_libs} license_check ${third_party_libs})
|
||||
else ()
|
||||
target_link_libraries(vecwise_server ${server_libs} ${third_party_libs})
|
||||
target_link_libraries(milvus_server ${server_libs} ${third_party_libs})
|
||||
endif()
|
||||
|
||||
if (ENABLE_LICENSE STREQUAL "ON")
|
||||
add_executable(get_sys_info ${get_sys_info_files})
|
||||
add_executable(license_generator ${license_generator_files})
|
||||
|
||||
target_link_libraries(get_sys_info ${license_libs} vecwise_license ${third_party_libs})
|
||||
target_link_libraries(get_sys_info ${license_libs} license_check ${third_party_libs})
|
||||
target_link_libraries(license_generator ${license_libs} ${third_party_libs})
|
||||
|
||||
install(TARGETS get_sys_info DESTINATION bin)
|
||||
install(TARGETS license_generator DESTINATION bin)
|
||||
endif ()
|
||||
|
||||
install(TARGETS vecwise_server DESTINATION bin)
|
||||
install(TARGETS milvus_server DESTINATION bin)
|
||||
|
||||
add_subdirectory(sdk)
|
||||
#target_link_libraries(
|
||||
|
||||
@ -455,7 +455,8 @@ Status DBMetaImpl::FilesToSearch(const std::string &table_id,
|
||||
&TableFileSchema::file_id_,
|
||||
&TableFileSchema::file_type_,
|
||||
&TableFileSchema::size_,
|
||||
&TableFileSchema::date_),
|
||||
&TableFileSchema::date_,
|
||||
&TableFileSchema::engine_type_),
|
||||
where(c(&TableFileSchema::table_id_) == table_id and
|
||||
in(&TableFileSchema::date_, partition) and
|
||||
(c(&TableFileSchema::file_type_) == (int) TableFileSchema::RAW or
|
||||
@ -482,6 +483,7 @@ Status DBMetaImpl::FilesToSearch(const std::string &table_id,
|
||||
table_file.file_type_ = std::get<3>(file);
|
||||
table_file.size_ = std::get<4>(file);
|
||||
table_file.date_ = std::get<5>(file);
|
||||
table_file.engine_type_ = std::get<6>(file);
|
||||
table_file.dimension_ = table_schema.dimension_;
|
||||
GetTableFilePath(table_file);
|
||||
auto dateItr = files.find(table_file.date_);
|
||||
|
||||
@ -27,7 +27,7 @@ using namespace zilliz::milvus;
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
printf("\nWelcome to use Milvus by Zillz!\n");
|
||||
printf("Milvus %s version: v%s built at %s\n", BUILD_TYPE, MEGASEARCH_VERSION, BUILD_TIME);
|
||||
printf("Milvus %s version: v%s built at %s\n", BUILD_TYPE, MILVUS_VERSION, BUILD_TIME);
|
||||
|
||||
signal(SIGINT, server::SignalUtil::HandleSignal);
|
||||
signal(SIGSEGV, server::SignalUtil::HandleSignal);
|
||||
|
||||
@ -14,19 +14,19 @@ include_directories(/usr/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp)
|
||||
|
||||
set(service_files
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/MegasearchService.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/megasearch_constants.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/megasearch_types.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/MilvusService.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/milvus_constants.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/thrift/gen-cpp/milvus_types.cpp
|
||||
)
|
||||
|
||||
add_library(megasearch_sdk STATIC
|
||||
add_library(milvus_sdk STATIC
|
||||
${interface_files}
|
||||
${client_files}
|
||||
${util_files}
|
||||
${service_files}
|
||||
)
|
||||
|
||||
target_link_libraries(megasearch_sdk
|
||||
target_link_libraries(milvus_sdk
|
||||
${third_party_libs}
|
||||
)
|
||||
|
||||
|
||||
@ -7,9 +7,9 @@
|
||||
aux_source_directory(src src_files)
|
||||
|
||||
include_directories(src)
|
||||
include_directories(../../megasearch_sdk/include)
|
||||
include_directories(../../include)
|
||||
|
||||
link_directories(${CMAKE_BINARY_DIR}/megasearch_sdk)
|
||||
link_directories(${CMAKE_BINARY_DIR})
|
||||
|
||||
add_executable(sdk_simple
|
||||
./main.cpp
|
||||
@ -17,6 +17,6 @@ add_executable(sdk_simple
|
||||
)
|
||||
|
||||
target_link_libraries(sdk_simple
|
||||
megasearch_sdk
|
||||
milvus_sdk
|
||||
pthread
|
||||
)
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "ClientTest.h"
|
||||
#include "MegaSearch.h"
|
||||
#include "MilvusApi.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace megasearch;
|
||||
using namespace ::milvus;
|
||||
|
||||
namespace {
|
||||
std::string GetTableName();
|
||||
@ -23,7 +23,7 @@ namespace {
|
||||
|
||||
#define BLOCK_SPLITER std::cout << "===========================================" << std::endl;
|
||||
|
||||
void PrintTableSchema(const megasearch::TableSchema& tb_schema) {
|
||||
void PrintTableSchema(const TableSchema& tb_schema) {
|
||||
BLOCK_SPLITER
|
||||
std::cout << "Table name: " << tb_schema.table_name << std::endl;
|
||||
std::cout << "Table index type: " << (int)tb_schema.index_type << std::endl;
|
||||
@ -134,7 +134,7 @@ ClientTest::Test(const std::string& address, const std::string& port) {
|
||||
|
||||
{//server version
|
||||
std::string version = conn->ServerVersion();
|
||||
std::cout << "MegaSearch server version: " << version << std::endl;
|
||||
std::cout << "Server version: " << version << std::endl;
|
||||
}
|
||||
|
||||
{//sdk version
|
||||
@ -194,10 +194,10 @@ ClientTest::Test(const std::string& address, const std::string& port) {
|
||||
PrintSearchResult(topk_query_result_array);
|
||||
}
|
||||
|
||||
{//delete table
|
||||
Status stat = conn->DeleteTable(TABLE_NAME);
|
||||
std::cout << "DeleteTable function call status: " << stat.ToString() << std::endl;
|
||||
}
|
||||
// {//delete table
|
||||
// Status stat = conn->DeleteTable(TABLE_NAME);
|
||||
// std::cout << "DeleteTable function call status: " << stat.ToString() << std::endl;
|
||||
// }
|
||||
|
||||
{//server status
|
||||
std::string status = conn->ServerStatus();
|
||||
|
||||
@ -6,9 +6,9 @@
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
/** \brief MegaSearch SDK namespace
|
||||
/** \brief Milvus SDK namespace
|
||||
*/
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
|
||||
/**
|
||||
@ -119,7 +119,7 @@ public:
|
||||
* Connect function should be called before any operations
|
||||
* Server will be connected after Connect return OK
|
||||
*
|
||||
* @param uri, use to provide server information, example: megasearch://ipaddress:port
|
||||
* @param uri, use to provide server information, example: milvus://ipaddress:port
|
||||
*
|
||||
* @return Indicate if connect is successful
|
||||
*/
|
||||
@ -3,9 +3,9 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
/** \brief MegaSearch SDK namespace
|
||||
/** \brief Milvus SDK namespace
|
||||
*/
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
/**
|
||||
* @brief Status Code for SDK interface return
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "ClientProxy.h"
|
||||
#include "util/ConvertUtil.h"
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
std::shared_ptr<ThriftClient>&
|
||||
ClientProxy::ClientPtr() const {
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "MegaSearch.h"
|
||||
#include "MilvusApi.h"
|
||||
#include "ThriftClient.h"
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
class ClientProxy : public Connection {
|
||||
public:
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
******************************************************************************/
|
||||
#include "ThriftClient.h"
|
||||
|
||||
#include "megasearch_types.h"
|
||||
#include "megasearch_constants.h"
|
||||
#include "milvus_types.h"
|
||||
#include "milvus_constants.h"
|
||||
|
||||
#include <exception>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include <thrift/transport/TBufferTransports.h>
|
||||
#include <thrift/concurrency/PosixThreadFactory.h>
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
using namespace ::apache::thrift;
|
||||
using namespace ::apache::thrift::protocol;
|
||||
@ -36,7 +36,7 @@ ThriftClient::~ThriftClient() {
|
||||
|
||||
}
|
||||
|
||||
MegasearchServiceClientPtr
|
||||
ServiceClientPtr
|
||||
ThriftClient::interface() {
|
||||
if(client_ == nullptr) {
|
||||
throw std::exception();
|
||||
@ -62,10 +62,10 @@ ThriftClient::Connect(const std::string& address, int32_t port, const std::strin
|
||||
}
|
||||
|
||||
transport_ptr->open();
|
||||
client_ = std::make_shared<thrift::MegasearchServiceClient>(protocol_ptr);
|
||||
client_ = std::make_shared<thrift::MilvusServiceClient>(protocol_ptr);
|
||||
} catch ( std::exception& ex) {
|
||||
//CLIENT_LOG_ERROR << "connect encounter exception: " << ex.what();
|
||||
return Status(StatusCode::NotConnected, "failed to connect megasearch server" + std::string(ex.what()));
|
||||
return Status(StatusCode::NotConnected, "failed to connect server" + std::string(ex.what()));
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
|
||||
@ -5,14 +5,14 @@
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "MegasearchService.h"
|
||||
#include "MilvusService.h"
|
||||
#include "Status.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
using MegasearchServiceClientPtr = std::shared_ptr<megasearch::thrift::MegasearchServiceClient>;
|
||||
using ServiceClientPtr = std::shared_ptr<::milvus::thrift::MilvusServiceClient>;
|
||||
|
||||
static const std::string THRIFT_PROTOCOL_JSON = "json";
|
||||
static const std::string THRIFT_PROTOCOL_BINARY = "binary";
|
||||
@ -23,13 +23,13 @@ public:
|
||||
ThriftClient();
|
||||
virtual ~ThriftClient();
|
||||
|
||||
MegasearchServiceClientPtr interface();
|
||||
ServiceClientPtr interface();
|
||||
|
||||
Status Connect(const std::string& address, int32_t port, const std::string& protocol);
|
||||
Status Disconnect();
|
||||
|
||||
private:
|
||||
MegasearchServiceClientPtr client_;
|
||||
ServiceClientPtr client_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "ConnectionImpl.h"
|
||||
#include "version.h"
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
std::shared_ptr<Connection>
|
||||
Connection::Create() {
|
||||
@ -14,7 +14,7 @@ Connection::Create() {
|
||||
}
|
||||
|
||||
Status
|
||||
Connection::Destroy(std::shared_ptr<megasearch::Connection> connection_ptr) {
|
||||
Connection::Destroy(std::shared_ptr<milvus::Connection> connection_ptr) {
|
||||
if(connection_ptr != nullptr) {
|
||||
return connection_ptr->Disconnect();
|
||||
}
|
||||
@ -48,7 +48,7 @@ ConnectionImpl::Disconnect() {
|
||||
|
||||
std::string
|
||||
ConnectionImpl::ClientVersion() const {
|
||||
return MEGASEARCH_VERSION;
|
||||
return MILVUS_VERSION;
|
||||
}
|
||||
|
||||
Status
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "MegaSearch.h"
|
||||
#include "MilvusApi.h"
|
||||
#include "client/ClientProxy.h"
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
class ConnectionImpl : public Connection {
|
||||
public:
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "Status.h"
|
||||
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
Status::~Status() noexcept {
|
||||
if (state_ != nullptr) {
|
||||
|
||||
@ -8,15 +8,15 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
static const std::string INDEX_RAW = "raw";
|
||||
static const std::string INDEX_IVFFLAT = "ivfflat";
|
||||
|
||||
std::string ConvertUtil::IndexType2Str(megasearch::IndexType index) {
|
||||
static const std::map<megasearch::IndexType, std::string> s_index2str = {
|
||||
{megasearch::IndexType::cpu_idmap, INDEX_RAW},
|
||||
{megasearch::IndexType::gpu_ivfflat, INDEX_IVFFLAT}
|
||||
std::string ConvertUtil::IndexType2Str(IndexType index) {
|
||||
static const std::map<IndexType, std::string> s_index2str = {
|
||||
{IndexType::cpu_idmap, INDEX_RAW},
|
||||
{IndexType::gpu_ivfflat, INDEX_IVFFLAT}
|
||||
};
|
||||
|
||||
const auto& iter = s_index2str.find(index);
|
||||
@ -27,10 +27,10 @@ std::string ConvertUtil::IndexType2Str(megasearch::IndexType index) {
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
megasearch::IndexType ConvertUtil::Str2IndexType(const std::string& type) {
|
||||
static const std::map<std::string, megasearch::IndexType> s_str2index = {
|
||||
{INDEX_RAW, megasearch::IndexType::cpu_idmap},
|
||||
{INDEX_IVFFLAT, megasearch::IndexType::gpu_ivfflat}
|
||||
IndexType ConvertUtil::Str2IndexType(const std::string& type) {
|
||||
static const std::map<std::string, IndexType> s_str2index = {
|
||||
{INDEX_RAW, IndexType::cpu_idmap},
|
||||
{INDEX_IVFFLAT, IndexType::gpu_ivfflat}
|
||||
};
|
||||
|
||||
const auto& iter = s_str2index.find(type);
|
||||
|
||||
@ -5,14 +5,14 @@
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "MegaSearch.h"
|
||||
#include "MilvusApi.h"
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
|
||||
class ConvertUtil {
|
||||
public:
|
||||
static std::string IndexType2Str(megasearch::IndexType index);
|
||||
static megasearch::IndexType Str2IndexType(const std::string& type);
|
||||
static std::string IndexType2Str(IndexType index);
|
||||
static IndexType Str2IndexType(const std::string& type);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace megasearch {
|
||||
namespace milvus {
|
||||
class Exception : public std::exception {
|
||||
public:
|
||||
Exception(StatusCode error_code,
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "metrics/Metrics.h"
|
||||
#include "MegasearchThreadPoolServer.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
void
|
||||
MegasearchThreadPoolServer::onClientConnected(const std::shared_ptr<apache::thrift::server::TConnectedClient> &pClient) {
|
||||
server::Metrics::GetInstance().ConnectionGaugeIncrement();
|
||||
TThreadPoolServer::onClientConnected(pClient);
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchThreadPoolServer::onClientDisconnected(apache::thrift::server::TConnectedClient *pClient) {
|
||||
server::Metrics::GetInstance().ConnectionGaugeDecrement();
|
||||
TThreadPoolServer::onClientDisconnected(pClient);
|
||||
}
|
||||
zilliz::milvus::server::MegasearchThreadPoolServer::MegasearchThreadPoolServer(const std::shared_ptr<apache::thrift::TProcessor> &processor,
|
||||
const std::shared_ptr<apache::thrift::transport::TServerTransport> &serverTransport,
|
||||
const std::shared_ptr<apache::thrift::transport::TTransportFactory> &transportFactory,
|
||||
const std::shared_ptr<apache::thrift::protocol::TProtocolFactory> &protocolFactory,
|
||||
const std::shared_ptr<apache::thrift::concurrency::ThreadManager> &threadManager)
|
||||
: TThreadPoolServer(processor, serverTransport, transportFactory, protocolFactory, threadManager) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,12 +3,13 @@
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "MegasearchServer.h"
|
||||
#include "MegasearchHandler.h"
|
||||
#include "megasearch_types.h"
|
||||
#include "megasearch_constants.h"
|
||||
#include "MilvusServer.h"
|
||||
#include "RequestHandler.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "MegasearchThreadPoolServer.h"
|
||||
#include "ThreadPoolServer.h"
|
||||
|
||||
#include "milvus_types.h"
|
||||
#include "milvus_constants.h"
|
||||
|
||||
#include <thrift/protocol/TBinaryProtocol.h>
|
||||
#include <thrift/protocol/TJSONProtocol.h>
|
||||
@ -26,7 +27,7 @@ namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
using namespace megasearch::thrift;
|
||||
using namespace ::milvus::thrift;
|
||||
using namespace ::apache::thrift;
|
||||
using namespace ::apache::thrift::protocol;
|
||||
using namespace ::apache::thrift::transport;
|
||||
@ -36,7 +37,7 @@ using namespace ::apache::thrift::concurrency;
|
||||
static stdcxx::shared_ptr<TServer> s_server;
|
||||
|
||||
void
|
||||
MegasearchServer::StartService() {
|
||||
MilvusServer::StartService() {
|
||||
if(s_server != nullptr){
|
||||
StopService();
|
||||
}
|
||||
@ -50,8 +51,8 @@ MegasearchServer::StartService() {
|
||||
std::string mode = server_config.GetValue(CONFIG_SERVER_MODE, "thread_pool");
|
||||
|
||||
try {
|
||||
stdcxx::shared_ptr<MegasearchServiceHandler> handler(new MegasearchServiceHandler());
|
||||
stdcxx::shared_ptr<TProcessor> processor(new MegasearchServiceProcessor(handler));
|
||||
stdcxx::shared_ptr<RequestHandler> handler(new RequestHandler());
|
||||
stdcxx::shared_ptr<TProcessor> processor(new MilvusServiceProcessor(handler));
|
||||
stdcxx::shared_ptr<TServerTransport> server_transport(new TServerSocket(address, port));
|
||||
stdcxx::shared_ptr<TTransportFactory> transport_factory(new TBufferedTransportFactory());
|
||||
|
||||
@ -77,7 +78,7 @@ MegasearchServer::StartService() {
|
||||
threadManager->threadFactory(threadFactory);
|
||||
threadManager->start();
|
||||
|
||||
s_server.reset(new MegasearchThreadPoolServer(processor,
|
||||
s_server.reset(new ThreadPoolServer(processor,
|
||||
server_transport,
|
||||
transport_factory,
|
||||
protocol_factory,
|
||||
@ -93,7 +94,7 @@ MegasearchServer::StartService() {
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchServer::StopService() {
|
||||
MilvusServer::StopService() {
|
||||
auto stop_server_worker = [&]{
|
||||
if(s_server != nullptr) {
|
||||
s_server->stop();
|
||||
@ -12,7 +12,7 @@ namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
class MegasearchServer {
|
||||
class MilvusServer {
|
||||
public:
|
||||
static void StartService();
|
||||
static void StopService();
|
||||
@ -4,62 +4,62 @@
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
|
||||
#include "MegasearchHandler.h"
|
||||
#include "MegasearchTask.h"
|
||||
#include "RequestHandler.h"
|
||||
#include "RequestTask.h"
|
||||
#include "utils/TimeRecorder.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
using namespace megasearch;
|
||||
using namespace ::milvus;
|
||||
|
||||
MegasearchServiceHandler::MegasearchServiceHandler() {
|
||||
RequestHandler::RequestHandler() {
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchServiceHandler::CreateTable(const thrift::TableSchema ¶m) {
|
||||
RequestHandler::CreateTable(const thrift::TableSchema ¶m) {
|
||||
BaseTaskPtr task_ptr = CreateTableTask::Create(param);
|
||||
MegasearchScheduler::ExecTask(task_ptr);
|
||||
RequestScheduler::ExecTask(task_ptr);
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchServiceHandler::DeleteTable(const std::string &table_name) {
|
||||
RequestHandler::DeleteTable(const std::string &table_name) {
|
||||
BaseTaskPtr task_ptr = DeleteTableTask::Create(table_name);
|
||||
MegasearchScheduler::ExecTask(task_ptr);
|
||||
RequestScheduler::ExecTask(task_ptr);
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchServiceHandler::AddVector(std::vector<int64_t> &_return,
|
||||
RequestHandler::AddVector(std::vector<int64_t> &_return,
|
||||
const std::string &table_name,
|
||||
const std::vector<thrift::RowRecord> &record_array) {
|
||||
BaseTaskPtr task_ptr = AddVectorTask::Create(table_name, record_array, _return);
|
||||
MegasearchScheduler::ExecTask(task_ptr);
|
||||
RequestScheduler::ExecTask(task_ptr);
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchServiceHandler::SearchVector(std::vector<megasearch::thrift::TopKQueryResult> & _return,
|
||||
RequestHandler::SearchVector(std::vector<thrift::TopKQueryResult> & _return,
|
||||
const std::string& table_name,
|
||||
const std::vector<megasearch::thrift::RowRecord> & query_record_array,
|
||||
const std::vector<megasearch::thrift::Range> & query_range_array,
|
||||
const std::vector<thrift::RowRecord> & query_record_array,
|
||||
const std::vector<thrift::Range> & query_range_array,
|
||||
const int64_t topk) {
|
||||
BaseTaskPtr task_ptr = SearchVectorTask::Create(table_name, query_record_array, query_range_array, topk, _return);
|
||||
MegasearchScheduler::ExecTask(task_ptr);
|
||||
RequestScheduler::ExecTask(task_ptr);
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchServiceHandler::DescribeTable(thrift::TableSchema &_return, const std::string &table_name) {
|
||||
RequestHandler::DescribeTable(thrift::TableSchema &_return, const std::string &table_name) {
|
||||
BaseTaskPtr task_ptr = DescribeTableTask::Create(table_name, _return);
|
||||
MegasearchScheduler::ExecTask(task_ptr);
|
||||
RequestScheduler::ExecTask(task_ptr);
|
||||
}
|
||||
|
||||
int64_t
|
||||
MegasearchServiceHandler::GetTableRowCount(const std::string& table_name) {
|
||||
RequestHandler::GetTableRowCount(const std::string& table_name) {
|
||||
int64_t row_count = 0;
|
||||
{
|
||||
BaseTaskPtr task_ptr = GetTableRowCountTask::Create(table_name, row_count);
|
||||
MegasearchScheduler::ExecTask(task_ptr);
|
||||
RequestScheduler::ExecTask(task_ptr);
|
||||
task_ptr->WaitToFinish();
|
||||
}
|
||||
|
||||
@ -67,15 +67,15 @@ MegasearchServiceHandler::GetTableRowCount(const std::string& table_name) {
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchServiceHandler::ShowTables(std::vector<std::string> &_return) {
|
||||
RequestHandler::ShowTables(std::vector<std::string> &_return) {
|
||||
BaseTaskPtr task_ptr = ShowTablesTask::Create(_return);
|
||||
MegasearchScheduler::ExecTask(task_ptr);
|
||||
RequestScheduler::ExecTask(task_ptr);
|
||||
}
|
||||
|
||||
void
|
||||
MegasearchServiceHandler::Ping(std::string& _return, const std::string& cmd) {
|
||||
RequestHandler::Ping(std::string& _return, const std::string& cmd) {
|
||||
BaseTaskPtr task_ptr = PingTask::Create(cmd, _return);
|
||||
MegasearchScheduler::ExecTask(task_ptr);
|
||||
RequestScheduler::ExecTask(task_ptr);
|
||||
}
|
||||
|
||||
}
|
||||
@ -8,15 +8,15 @@
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "MegasearchService.h"
|
||||
#include "MilvusService.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
class MegasearchServiceHandler : virtual public megasearch::thrift::MegasearchServiceIf {
|
||||
class RequestHandler : virtual public ::milvus::thrift::MilvusServiceIf {
|
||||
public:
|
||||
MegasearchServiceHandler();
|
||||
RequestHandler();
|
||||
|
||||
/**
|
||||
* @brief Create table method
|
||||
@ -28,7 +28,7 @@ public:
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
void CreateTable(const megasearch::thrift::TableSchema& param);
|
||||
void CreateTable(const ::milvus::thrift::TableSchema& param);
|
||||
|
||||
/**
|
||||
* @brief Delete table method
|
||||
@ -57,7 +57,7 @@ public:
|
||||
*/
|
||||
void AddVector(std::vector<int64_t> & _return,
|
||||
const std::string& table_name,
|
||||
const std::vector<megasearch::thrift::RowRecord> & record_array);
|
||||
const std::vector<::milvus::thrift::RowRecord> & record_array);
|
||||
|
||||
/**
|
||||
* @brief Query vector
|
||||
@ -76,10 +76,10 @@ public:
|
||||
* @param query_range_array
|
||||
* @param topk
|
||||
*/
|
||||
void SearchVector(std::vector<megasearch::thrift::TopKQueryResult> & _return,
|
||||
void SearchVector(std::vector<::milvus::thrift::TopKQueryResult> & _return,
|
||||
const std::string& table_name,
|
||||
const std::vector<megasearch::thrift::RowRecord> & query_record_array,
|
||||
const std::vector<megasearch::thrift::Range> & query_range_array,
|
||||
const std::vector<::milvus::thrift::RowRecord> & query_record_array,
|
||||
const std::vector<::milvus::thrift::Range> & query_range_array,
|
||||
const int64_t topk);
|
||||
|
||||
/**
|
||||
@ -93,7 +93,7 @@ public:
|
||||
*
|
||||
* @param table_name
|
||||
*/
|
||||
void DescribeTable(megasearch::thrift::TableSchema& _return, const std::string& table_name);
|
||||
void DescribeTable(::milvus::thrift::TableSchema& _return, const std::string& table_name);
|
||||
|
||||
/**
|
||||
* @brief Get table row count
|
||||
@ -3,17 +3,17 @@
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "MegasearchScheduler.h"
|
||||
#include "RequestScheduler.h"
|
||||
#include "utils/Log.h"
|
||||
|
||||
#include "megasearch_types.h"
|
||||
#include "megasearch_constants.h"
|
||||
#include "milvus_types.h"
|
||||
#include "milvus_constants.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
using namespace megasearch;
|
||||
using namespace ::milvus;
|
||||
|
||||
namespace {
|
||||
const std::map<ServerError, thrift::ErrorCode::type> &ErrorMap() {
|
||||
@ -77,21 +77,21 @@ ServerError BaseTask::WaitToFinish() {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
MegasearchScheduler::MegasearchScheduler()
|
||||
RequestScheduler::RequestScheduler()
|
||||
: stopped_(false) {
|
||||
Start();
|
||||
}
|
||||
|
||||
MegasearchScheduler::~MegasearchScheduler() {
|
||||
RequestScheduler::~RequestScheduler() {
|
||||
Stop();
|
||||
}
|
||||
|
||||
void MegasearchScheduler::ExecTask(BaseTaskPtr& task_ptr) {
|
||||
void RequestScheduler::ExecTask(BaseTaskPtr& task_ptr) {
|
||||
if(task_ptr == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
MegasearchScheduler& scheduler = MegasearchScheduler::GetInstance();
|
||||
RequestScheduler& scheduler = RequestScheduler::GetInstance();
|
||||
scheduler.ExecuteTask(task_ptr);
|
||||
|
||||
if(!task_ptr->IsAsync()) {
|
||||
@ -110,7 +110,7 @@ void MegasearchScheduler::ExecTask(BaseTaskPtr& task_ptr) {
|
||||
}
|
||||
}
|
||||
|
||||
void MegasearchScheduler::Start() {
|
||||
void RequestScheduler::Start() {
|
||||
if(!stopped_) {
|
||||
return;
|
||||
}
|
||||
@ -118,7 +118,7 @@ void MegasearchScheduler::Start() {
|
||||
stopped_ = false;
|
||||
}
|
||||
|
||||
void MegasearchScheduler::Stop() {
|
||||
void RequestScheduler::Stop() {
|
||||
if(stopped_) {
|
||||
return;
|
||||
}
|
||||
@ -143,7 +143,7 @@ void MegasearchScheduler::Stop() {
|
||||
SERVER_LOG_INFO << "Scheduler stopped";
|
||||
}
|
||||
|
||||
ServerError MegasearchScheduler::ExecuteTask(const BaseTaskPtr& task_ptr) {
|
||||
ServerError RequestScheduler::ExecuteTask(const BaseTaskPtr& task_ptr) {
|
||||
if(task_ptr == nullptr) {
|
||||
return SERVER_NULL_POINTER;
|
||||
}
|
||||
@ -184,7 +184,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
ServerError MegasearchScheduler::PutTaskToQueue(const BaseTaskPtr& task_ptr) {
|
||||
ServerError RequestScheduler::PutTaskToQueue(const BaseTaskPtr& task_ptr) {
|
||||
std::lock_guard<std::mutex> lock(queue_mtx_);
|
||||
|
||||
std::string group_name = task_ptr->TaskGroup();
|
||||
@ -50,10 +50,10 @@ using TaskQueue = BlockingQueue<BaseTaskPtr>;
|
||||
using TaskQueuePtr = std::shared_ptr<TaskQueue>;
|
||||
using ThreadPtr = std::shared_ptr<std::thread>;
|
||||
|
||||
class MegasearchScheduler {
|
||||
class RequestScheduler {
|
||||
public:
|
||||
static MegasearchScheduler& GetInstance() {
|
||||
static MegasearchScheduler scheduler;
|
||||
static RequestScheduler& GetInstance() {
|
||||
static RequestScheduler scheduler;
|
||||
return scheduler;
|
||||
}
|
||||
|
||||
@ -65,8 +65,8 @@ public:
|
||||
static void ExecTask(BaseTaskPtr& task_ptr);
|
||||
|
||||
protected:
|
||||
MegasearchScheduler();
|
||||
virtual ~MegasearchScheduler();
|
||||
RequestScheduler();
|
||||
virtual ~RequestScheduler();
|
||||
|
||||
ServerError PutTaskToQueue(const BaseTaskPtr& task_ptr);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "MegasearchTask.h"
|
||||
#include "RequestTask.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "utils/CommonUtil.h"
|
||||
#include "utils/Log.h"
|
||||
@ -17,6 +17,8 @@ namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
using namespace ::milvus;
|
||||
|
||||
static const std::string DQL_TASK_GROUP = "dql";
|
||||
static const std::string DDL_DML_TASK_GROUP = "ddl_dml";
|
||||
static const std::string PING_TASK_GROUP = "ping";
|
||||
@ -122,7 +124,7 @@ namespace {
|
||||
static constexpr long DAY_SECONDS = 86400;
|
||||
|
||||
ServerError
|
||||
ConvertTimeRangeToDBDates(const std::vector<megasearch::thrift::Range> &range_array,
|
||||
ConvertTimeRangeToDBDates(const std::vector<thrift::Range> &range_array,
|
||||
std::vector<DB_DATE>& dates) {
|
||||
dates.clear();
|
||||
ServerError error_code;
|
||||
@ -411,7 +413,7 @@ ServerError AddVectorTask::OnExecute() {
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
SearchVectorTask::SearchVectorTask(const std::string& table_name,
|
||||
const std::vector<thrift::RowRecord> & query_record_array,
|
||||
const std::vector<megasearch::thrift::Range> & query_range_array,
|
||||
const std::vector<thrift::Range> & query_range_array,
|
||||
const int64_t top_k,
|
||||
std::vector<thrift::TopKQueryResult>& result_array)
|
||||
: BaseTask(DQL_TASK_GROUP),
|
||||
@ -425,7 +427,7 @@ SearchVectorTask::SearchVectorTask(const std::string& table_name,
|
||||
|
||||
BaseTaskPtr SearchVectorTask::Create(const std::string& table_name,
|
||||
const std::vector<thrift::RowRecord> & query_record_array,
|
||||
const std::vector<megasearch::thrift::Range> & query_range_array,
|
||||
const std::vector<thrift::Range> & query_range_array,
|
||||
const int64_t top_k,
|
||||
std::vector<thrift::TopKQueryResult>& result_array) {
|
||||
return std::shared_ptr<BaseTask>(new SearchVectorTask(table_name,
|
||||
@ -582,7 +584,7 @@ BaseTaskPtr PingTask::Create(const std::string& cmd, std::string& result) {
|
||||
|
||||
ServerError PingTask::OnExecute() {
|
||||
if(cmd_ == "version") {
|
||||
result_ = MEGASEARCH_VERSION;
|
||||
result_ = MILVUS_VERSION;
|
||||
}
|
||||
|
||||
return SERVER_SUCCESS;
|
||||
@ -5,12 +5,12 @@
|
||||
******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "MegasearchScheduler.h"
|
||||
#include "RequestScheduler.h"
|
||||
#include "utils/Error.h"
|
||||
#include "utils/AttributeSerializer.h"
|
||||
#include "db/Types.h"
|
||||
|
||||
#include "megasearch_types.h"
|
||||
#include "milvus_types.h"
|
||||
|
||||
#include <condition_variable>
|
||||
#include <memory>
|
||||
@ -19,35 +19,34 @@ namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
using namespace megasearch;
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class CreateTableTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const thrift::TableSchema& schema);
|
||||
static BaseTaskPtr Create(const ::milvus::thrift::TableSchema& schema);
|
||||
|
||||
protected:
|
||||
CreateTableTask(const thrift::TableSchema& schema);
|
||||
CreateTableTask(const ::milvus::thrift::TableSchema& schema);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
private:
|
||||
const thrift::TableSchema& schema_;
|
||||
const ::milvus::thrift::TableSchema& schema_;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class DescribeTableTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const std::string& table_name, thrift::TableSchema& schema);
|
||||
static BaseTaskPtr Create(const std::string& table_name, ::milvus::thrift::TableSchema& schema);
|
||||
|
||||
protected:
|
||||
DescribeTableTask(const std::string& table_name, thrift::TableSchema& schema);
|
||||
DescribeTableTask(const std::string& table_name, ::milvus::thrift::TableSchema& schema);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
|
||||
private:
|
||||
std::string table_name_;
|
||||
thrift::TableSchema& schema_;
|
||||
::milvus::thrift::TableSchema& schema_;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -83,19 +82,19 @@ private:
|
||||
class AddVectorTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const std::string& table_name,
|
||||
const std::vector<thrift::RowRecord>& record_array,
|
||||
const std::vector<::milvus::thrift::RowRecord>& record_array,
|
||||
std::vector<int64_t>& record_ids_);
|
||||
|
||||
protected:
|
||||
AddVectorTask(const std::string& table_name,
|
||||
const std::vector<thrift::RowRecord>& record_array,
|
||||
const std::vector<::milvus::thrift::RowRecord>& record_array,
|
||||
std::vector<int64_t>& record_ids_);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
private:
|
||||
std::string table_name_;
|
||||
const std::vector<thrift::RowRecord>& record_array_;
|
||||
const std::vector<::milvus::thrift::RowRecord>& record_array_;
|
||||
std::vector<int64_t>& record_ids_;
|
||||
};
|
||||
|
||||
@ -103,26 +102,26 @@ private:
|
||||
class SearchVectorTask : public BaseTask {
|
||||
public:
|
||||
static BaseTaskPtr Create(const std::string& table_name,
|
||||
const std::vector<thrift::RowRecord> & query_record_array,
|
||||
const std::vector<megasearch::thrift::Range> & query_range_array,
|
||||
const std::vector<::milvus::thrift::RowRecord> & query_record_array,
|
||||
const std::vector<::milvus::thrift::Range> & query_range_array,
|
||||
const int64_t top_k,
|
||||
std::vector<thrift::TopKQueryResult>& result_array);
|
||||
std::vector<::milvus::thrift::TopKQueryResult>& result_array);
|
||||
|
||||
protected:
|
||||
SearchVectorTask(const std::string& table_name,
|
||||
const std::vector<thrift::RowRecord> & query_record_array,
|
||||
const std::vector<megasearch::thrift::Range> & query_range_array,
|
||||
const std::vector<::milvus::thrift::RowRecord> & query_record_array,
|
||||
const std::vector<::milvus::thrift::Range> & query_range_array,
|
||||
const int64_t top_k,
|
||||
std::vector<thrift::TopKQueryResult>& result_array);
|
||||
std::vector<::milvus::thrift::TopKQueryResult>& result_array);
|
||||
|
||||
ServerError OnExecute() override;
|
||||
|
||||
private:
|
||||
std::string table_name_;
|
||||
int64_t top_k_;
|
||||
const std::vector<thrift::RowRecord>& record_array_;
|
||||
const std::vector<megasearch::thrift::Range>& range_array_;
|
||||
std::vector<thrift::TopKQueryResult>& result_array_;
|
||||
const std::vector<::milvus::thrift::RowRecord>& record_array_;
|
||||
const std::vector<::milvus::thrift::Range>& range_array_;
|
||||
std::vector<::milvus::thrift::TopKQueryResult>& result_array_;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -5,7 +5,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include "Server.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "MegasearchServer.h"
|
||||
#include "MilvusServer.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/SignalUtil.h"
|
||||
#include "utils/TimeRecorder.h"
|
||||
@ -232,12 +232,12 @@ Server::LoadConfig() {
|
||||
|
||||
void
|
||||
Server::StartService() {
|
||||
MegasearchServer::StartService();
|
||||
MilvusServer::StartService();
|
||||
}
|
||||
|
||||
void
|
||||
Server::StopService() {
|
||||
MegasearchServer::StopService();
|
||||
MilvusServer::StopService();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
36
cpp/src/server/ThreadPoolServer.cpp
Normal file
36
cpp/src/server/ThreadPoolServer.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
#include "metrics/Metrics.h"
|
||||
#include "ThreadPoolServer.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
void
|
||||
ThreadPoolServer::onClientConnected(const std::shared_ptr<apache::thrift::server::TConnectedClient> &pClient) {
|
||||
server::Metrics::GetInstance().ConnectionGaugeIncrement();
|
||||
TThreadPoolServer::onClientConnected(pClient);
|
||||
}
|
||||
|
||||
void
|
||||
ThreadPoolServer::onClientDisconnected(apache::thrift::server::TConnectedClient *pClient) {
|
||||
server::Metrics::GetInstance().ConnectionGaugeDecrement();
|
||||
TThreadPoolServer::onClientDisconnected(pClient);
|
||||
}
|
||||
|
||||
zilliz::milvus::server::ThreadPoolServer::ThreadPoolServer(const std::shared_ptr<apache::thrift::TProcessor> &processor,
|
||||
const std::shared_ptr<apache::thrift::transport::TServerTransport> &serverTransport,
|
||||
const std::shared_ptr<apache::thrift::transport::TTransportFactory> &transportFactory,
|
||||
const std::shared_ptr<apache::thrift::protocol::TProtocolFactory> &protocolFactory,
|
||||
const std::shared_ptr<apache::thrift::concurrency::ThreadManager> &threadManager)
|
||||
: TThreadPoolServer(processor, serverTransport, transportFactory, protocolFactory, threadManager) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -13,9 +13,9 @@ namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
class MegasearchThreadPoolServer : public apache::thrift::server::TThreadPoolServer {
|
||||
class ThreadPoolServer : public apache::thrift::server::TThreadPoolServer {
|
||||
public:
|
||||
MegasearchThreadPoolServer(
|
||||
ThreadPoolServer(
|
||||
const std::shared_ptr<apache::thrift::TProcessor>& processor,
|
||||
const std::shared_ptr<apache::thrift::transport::TServerTransport>& serverTransport,
|
||||
const std::shared_ptr<apache::thrift::transport::TTransportFactory>& transportFactory,
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
thrift -r --gen cpp ./megasearch.thrift
|
||||
thrift -r --gen cpp ./milvus.thrift
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
// This autogenerated skeleton file illustrates how to build a server.
|
||||
// You should copy it to another filename to avoid overwriting it.
|
||||
|
||||
#include "MegasearchService.h"
|
||||
#include "MilvusService.h"
|
||||
#include <thrift/protocol/TBinaryProtocol.h>
|
||||
#include <thrift/server/TSimpleServer.h>
|
||||
#include <thrift/transport/TServerSocket.h>
|
||||
@ -12,11 +12,11 @@ using namespace ::apache::thrift::protocol;
|
||||
using namespace ::apache::thrift::transport;
|
||||
using namespace ::apache::thrift::server;
|
||||
|
||||
using namespace ::megasearch::thrift;
|
||||
using namespace ::milvus::thrift;
|
||||
|
||||
class MegasearchServiceHandler : virtual public MegasearchServiceIf {
|
||||
class MilvusServiceHandler : virtual public MilvusServiceIf {
|
||||
public:
|
||||
MegasearchServiceHandler() {
|
||||
MilvusServiceHandler() {
|
||||
// Your initialization goes here
|
||||
}
|
||||
|
||||
@ -153,8 +153,8 @@ class MegasearchServiceHandler : virtual public MegasearchServiceIf {
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int port = 9090;
|
||||
::apache::thrift::stdcxx::shared_ptr<MegasearchServiceHandler> handler(new MegasearchServiceHandler());
|
||||
::apache::thrift::stdcxx::shared_ptr<TProcessor> processor(new MegasearchServiceProcessor(handler));
|
||||
::apache::thrift::stdcxx::shared_ptr<MilvusServiceHandler> handler(new MilvusServiceHandler());
|
||||
::apache::thrift::stdcxx::shared_ptr<TProcessor> processor(new MilvusServiceProcessor(handler));
|
||||
::apache::thrift::stdcxx::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
|
||||
::apache::thrift::stdcxx::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
|
||||
::apache::thrift::stdcxx::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
|
||||
@ -1,17 +0,0 @@
|
||||
/**
|
||||
* Autogenerated by Thrift Compiler (0.12.0)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
#include "megasearch_constants.h"
|
||||
|
||||
namespace megasearch { namespace thrift {
|
||||
|
||||
const megasearchConstants g_megasearch_constants;
|
||||
|
||||
megasearchConstants::megasearchConstants() {
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
/**
|
||||
* Autogenerated by Thrift Compiler (0.12.0)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
#ifndef megasearch_CONSTANTS_H
|
||||
#define megasearch_CONSTANTS_H
|
||||
|
||||
#include "megasearch_types.h"
|
||||
|
||||
namespace megasearch { namespace thrift {
|
||||
|
||||
class megasearchConstants {
|
||||
public:
|
||||
megasearchConstants();
|
||||
|
||||
};
|
||||
|
||||
extern const megasearchConstants g_megasearch_constants;
|
||||
|
||||
}} // namespace
|
||||
|
||||
#endif
|
||||
17
cpp/src/thrift/gen-cpp/milvus_constants.cpp
Normal file
17
cpp/src/thrift/gen-cpp/milvus_constants.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Autogenerated by Thrift Compiler (0.12.0)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
#include "milvus_constants.h"
|
||||
|
||||
namespace milvus { namespace thrift {
|
||||
|
||||
const milvusConstants g_milvus_constants;
|
||||
|
||||
milvusConstants::milvusConstants() {
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
|
||||
24
cpp/src/thrift/gen-cpp/milvus_constants.h
Normal file
24
cpp/src/thrift/gen-cpp/milvus_constants.h
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Autogenerated by Thrift Compiler (0.12.0)
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
#ifndef milvus_CONSTANTS_H
|
||||
#define milvus_CONSTANTS_H
|
||||
|
||||
#include "milvus_types.h"
|
||||
|
||||
namespace milvus { namespace thrift {
|
||||
|
||||
class milvusConstants {
|
||||
public:
|
||||
milvusConstants();
|
||||
|
||||
};
|
||||
|
||||
extern const milvusConstants g_milvus_constants;
|
||||
|
||||
}} // namespace
|
||||
|
||||
#endif
|
||||
@ -4,14 +4,14 @@
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
#include "megasearch_types.h"
|
||||
#include "milvus_types.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ostream>
|
||||
|
||||
#include <thrift/TToString.h>
|
||||
|
||||
namespace megasearch { namespace thrift {
|
||||
namespace milvus { namespace thrift {
|
||||
|
||||
int _kErrorCodeValues[] = {
|
||||
ErrorCode::SUCCESS,
|
||||
@ -4,8 +4,8 @@
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
* @generated
|
||||
*/
|
||||
#ifndef megasearch_TYPES_H
|
||||
#define megasearch_TYPES_H
|
||||
#ifndef milvus_TYPES_H
|
||||
#define milvus_TYPES_H
|
||||
|
||||
#include <iosfwd>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
#include <thrift/stdcxx.h>
|
||||
|
||||
|
||||
namespace megasearch { namespace thrift {
|
||||
namespace milvus { namespace thrift {
|
||||
|
||||
struct ErrorCode {
|
||||
enum type {
|
||||
@ -3,15 +3,15 @@
|
||||
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
||||
* Proprietary and confidential.
|
||||
******************************************************************************/
|
||||
namespace cpp megasearch.thrift
|
||||
namespace py megasearch.thrift
|
||||
namespace d megasearch.thrift
|
||||
namespace dart megasearch.thrift
|
||||
namespace java megasearch.thrift
|
||||
namespace perl megasearch.thrift
|
||||
namespace php megasearch.thrift
|
||||
namespace haxe megasearch.thrift
|
||||
namespace netcore megasearch.thrift
|
||||
namespace cpp milvus.thrift
|
||||
namespace py milvus.thrift
|
||||
namespace d milvus.thrift
|
||||
namespace dart milvus.thrift
|
||||
namespace java milvus.thrift
|
||||
namespace perl milvus.thrift
|
||||
namespace php milvus.thrift
|
||||
namespace haxe milvus.thrift
|
||||
namespace netcore milvus.thrift
|
||||
|
||||
enum ErrorCode {
|
||||
SUCCESS = 0,
|
||||
@ -69,7 +69,7 @@ struct TopKQueryResult {
|
||||
1: list<QueryResult> query_result_arrays; ///< TopK query result
|
||||
}
|
||||
|
||||
service MegasearchService {
|
||||
service MilvusService {
|
||||
/**
|
||||
* @brief Create table method
|
||||
*
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
./cmake_build/src/vecwise_server -c ./conf/server_config.yaml -l ./conf/vecwise_engine_log.conf &
|
||||
./cmake_build/src/milvus_server -c ./conf/server_config.yaml -l ./conf/log_config.conf &
|
||||
|
||||
|
||||
@ -7,10 +7,10 @@ function kill_progress()
|
||||
sleep 2
|
||||
}
|
||||
|
||||
STATUS=$(kill_progress "vecwise_server" )
|
||||
STATUS=$(kill_progress "milvus_server" )
|
||||
|
||||
if [[ ${STATUS} == "false" ]];then
|
||||
echo "vecwise_server closed abnormally!"
|
||||
echo "Milvus server closed abnormally!"
|
||||
else
|
||||
echo "vecwise_server closed successfully!"
|
||||
echo "Milvus server closed successfully!"
|
||||
fi
|
||||
|
||||
@ -5,14 +5,13 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
link_directories(
|
||||
"${CMAKE_BINARY_DIR}/lib"
|
||||
#"${VECWISE_THIRD_PARTY_BUILD}/lib"
|
||||
"${GTEST_PREFIX}/lib/"
|
||||
|
||||
)
|
||||
message(STATUS "GTEST LIB: ${GTEST_PREFIX}/lib")
|
||||
|
||||
set(unittest_srcs
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vecwise_test.cpp)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
|
||||
#${EASYLOGGINGPP_INCLUDE_DIR}/easylogging++.cc)
|
||||
|
||||
set(unittest_libs
|
||||
|
||||
@ -93,7 +93,7 @@ TEST_F(MetaTest, table_file_TEST) {
|
||||
TEST_F(MetaTest, ARCHIVE_TEST_DAYS) {
|
||||
srand(time(0));
|
||||
DBMetaOptions options;
|
||||
options.path = "/tmp/vecwise_test";
|
||||
options.path = "/tmp/milvus_test";
|
||||
int days_num = rand() % 100;
|
||||
std::stringstream ss;
|
||||
ss << "days:" << days_num;
|
||||
@ -142,7 +142,7 @@ TEST_F(MetaTest, ARCHIVE_TEST_DAYS) {
|
||||
|
||||
TEST_F(MetaTest, ARCHIVE_TEST_DISK) {
|
||||
DBMetaOptions options;
|
||||
options.path = "/tmp/vecwise_test";
|
||||
options.path = "/tmp/milvus_test";
|
||||
options.archive_conf = ArchiveConf("delete", "disk:11");
|
||||
|
||||
auto impl = meta::DBMetaImpl(options);
|
||||
|
||||
@ -31,7 +31,7 @@ void DBTest::InitLog() {
|
||||
|
||||
engine::Options DBTest::GetOptions() {
|
||||
auto options = engine::OptionsFactory::Build();
|
||||
options.meta.path = "/tmp/vecwise_test";
|
||||
options.meta.path = "/tmp/milvus_test";
|
||||
return options;
|
||||
}
|
||||
|
||||
@ -43,12 +43,12 @@ void DBTest::SetUp() {
|
||||
|
||||
void DBTest::TearDown() {
|
||||
delete db_;
|
||||
boost::filesystem::remove_all("/tmp/vecwise_test");
|
||||
boost::filesystem::remove_all("/tmp/milvus_test");
|
||||
}
|
||||
|
||||
engine::Options DBTest2::GetOptions() {
|
||||
auto options = engine::OptionsFactory::Build();
|
||||
options.meta.path = "/tmp/vecwise_test";
|
||||
options.meta.path = "/tmp/milvus_test";
|
||||
options.meta.archive_conf = engine::ArchiveConf("delete", "disk:1");
|
||||
return options;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ TEST(LicenseLibraryTest, CHECK_TEST) {
|
||||
|
||||
server::ServerError err;
|
||||
// 1. Set license file name
|
||||
std::string license_file_path("/tmp/megasearch/abc.license");
|
||||
std::string license_file_path("/tmp/milvus/abc.license");
|
||||
|
||||
// 2. Legality check
|
||||
err = server::LicenseCheck::LegalityCheck(license_file_path);
|
||||
@ -29,7 +29,7 @@ TEST(LicenseLibraryTest, CHECK_ERROR1_TEST){
|
||||
|
||||
server::ServerError err;
|
||||
// 1. Set license file name
|
||||
std::string license_file_path("/tmp/megasearch/abc");
|
||||
std::string license_file_path("/tmp/milvus/abc");
|
||||
|
||||
// 2. Legality check
|
||||
err = server::LicenseCheck::LegalityCheck(license_file_path);
|
||||
@ -40,7 +40,7 @@ TEST(LicenseLibraryTest, CHECK_ERROR2_TEST){
|
||||
|
||||
server::ServerError err;
|
||||
// 1. Set license file name
|
||||
std::string license_file_path("/tmp/megasearch/abc.license");
|
||||
std::string license_file_path("/tmp/milvus/abc.license");
|
||||
|
||||
// 2. Define output var
|
||||
int device_count;
|
||||
@ -74,7 +74,7 @@ TEST(LicenseLibraryTest, CHECK_ERROR3_TEST){
|
||||
|
||||
server::ServerError err;
|
||||
// 1. Set license file name
|
||||
std::string license_file_path("/tmp/megasearch/abc.license");
|
||||
std::string license_file_path("/tmp/milvus/abc.license");
|
||||
|
||||
// 2. Define output var
|
||||
int device_count;
|
||||
@ -108,7 +108,7 @@ TEST(LicenseLibraryTest, CHECK_ERROR4_1_TEST){
|
||||
|
||||
server::ServerError err;
|
||||
// 1. Set license file name
|
||||
std::string license_file_path("/tmp/megasearch/abc.license");
|
||||
std::string license_file_path("/tmp/milvus/abc.license");
|
||||
|
||||
// 2. Define output var
|
||||
int device_count;
|
||||
@ -147,7 +147,7 @@ TEST(LicenseLibraryTest, CHECK_ERROR4_2_TEST){
|
||||
|
||||
server::ServerError err;
|
||||
// 1. Set license file name
|
||||
std::string license_file_path("/tmp/megasearch/abc.license");
|
||||
std::string license_file_path("/tmp/milvus/abc.license");
|
||||
|
||||
// 2. Define output var
|
||||
int device_count;
|
||||
|
||||
@ -93,7 +93,7 @@ TEST(LicenseLibraryTest, LICENSE_FILE_TEST) {
|
||||
}
|
||||
|
||||
// 5.GPU_info File
|
||||
std::string GPU_info_file_path("/tmp/megasearch.info");
|
||||
std::string GPU_info_file_path("/tmp/milvus.info");
|
||||
|
||||
|
||||
// 6. Generate GPU_info File
|
||||
@ -118,7 +118,7 @@ TEST(LicenseLibraryTest, LICENSE_FILE_TEST) {
|
||||
}
|
||||
|
||||
// 9. Set license file name
|
||||
std::string license_file_path("/tmp/megasearch.license");
|
||||
std::string license_file_path("/tmp/milvus.license");
|
||||
|
||||
// 10. Get System Time/starting_time ans End Time
|
||||
time_t sysyem_time;
|
||||
@ -179,7 +179,7 @@ TEST(LicenseLibraryTest, LICENSE_FILE_TEST) {
|
||||
|
||||
|
||||
// // 17. Generate Secret File
|
||||
// std::string secret_file_path("/tmp/megasearch.secret");
|
||||
// std::string secret_file_path("/tmp/milvus.secret");
|
||||
// err = server::LicenseLibrary::SecretFileSerialization(secret_file_path,
|
||||
// update_time,
|
||||
// file_size,
|
||||
|
||||
@ -11,7 +11,7 @@ using namespace zilliz::milvus;
|
||||
|
||||
|
||||
TEST(CommonTest, COMMON_TEST) {
|
||||
std::string path1 = "/tmp/vecwise_test/";
|
||||
std::string path1 = "/tmp/milvus_test/";
|
||||
std::string path2 = path1 + "common_test_12345/";
|
||||
std::string path3 = path2 + "abcdef";
|
||||
server::ServerError err = server::CommonUtil::CreateDirectory(path3);
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
class LogTest: public testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
el::Configurations conf("../../../conf/vecwise_engine_log.conf");
|
||||
el::Configurations conf("../../../conf/log_config.conf");
|
||||
el::Loggers::reconfigureAllLoggers(conf);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#define MEGASEARCH_VERSION "@MEGASEARCH_VERSION@"
|
||||
#define MILVUS_VERSION "@MILVUS_VERSION@"
|
||||
#define BUILD_TYPE "@BUILD_TYPE@"
|
||||
#define BUILD_TIME @BUILD_TIME@
|
||||
Loading…
x
Reference in New Issue
Block a user