From 0a2b77c363cc2012432746d59ad50592bbb87813 Mon Sep 17 00:00:00 2001 From: BossZou <40255591+BossZou@users.noreply.github.com> Date: Tue, 28 Apr 2020 23:57:51 +0800 Subject: [PATCH] Upgrade http thirdparty oatpp to v1.0.0 (fix #2153) (#2157) * Upgrade thirdparty oatpp to v1.0.0 (fix #2153) Signed-off-by: yhz <413554850@qq.com> * adjust header order Signed-off-by: Yhz --- CHANGELOG.md | 1 + core/cmake/ThirdPartyPackages.cmake | 8 +++++-- .../web_impl/component/AppComponent.hpp | 23 +++++++++---------- core/src/server/web_impl/dto/PartitionDto.hpp | 2 +- core/src/server/web_impl/dto/StatusDto.hpp | 2 +- core/src/server/web_impl/dto/TableDto.hpp | 2 +- core/thirdparty/versions.txt | 2 +- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 725989f9e2..9ece7a1c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Please mark all change in change log and use the issue from GitHub - \#221 Refactor LOG macro - \#2039 Support Milvus run on SSE CPUs - \#2149 Merge server_cpu_config.template and server_gpu_config.template +- \#2153 Upgrade thirdparty oatpp to v1.0.0 - \#2167 Merge config file ## Task diff --git a/core/cmake/ThirdPartyPackages.cmake b/core/cmake/ThirdPartyPackages.cmake index 4e5103e67d..09b8fafd11 100644 --- a/core/cmake/ThirdPartyPackages.cmake +++ b/core/cmake/ThirdPartyPackages.cmake @@ -315,7 +315,7 @@ else () endif () if (DEFINED ENV{MILVUS_FIU_URL}) - set(MILVUS_FIU_URL "$ENV{MILVUS_FIU_URL}") + set(FIU_SOURCE_URL "$ENV{MILVUS_FIU_URL}") else () set(FIU_SOURCE_URL "https://github.com/albertito/libfiu/archive/${FIU_VERSION}.tar.gz" "https://gitee.com/quicksilver/libfiu/repository/archive/${FIU_VERSION}.zip") @@ -325,7 +325,7 @@ if (DEFINED ENV{MILVUS_OATPP_URL}) set(OATPP_SOURCE_URL "$ENV{MILVUS_OATPP_URL}") else () # set(OATPP_SOURCE_URL "https://github.com/oatpp/oatpp/archive/${OATPP_VERSION}.tar.gz") - set(OATPP_SOURCE_URL "https://github.com/BossZou/oatpp/archive/master.zip") + set(OATPP_SOURCE_URL "https://github.com/BossZou/oatpp/archive/${OATPP_VERSION}.zip") endif () if (DEFINED ENV{MILVUS_AWS_URL}) @@ -1021,10 +1021,14 @@ macro(build_oatpp) set(OATPP_DIR_LIB "${OATPP_PREFIX}/lib") set(OATPP_CMAKE_ARGS + ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=${OATPP_PREFIX}" -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=OFF -DOATPP_BUILD_TESTS=OFF + -DOATPP_DISABLE_LOGV=ON + -DOATPP_DISABLE_LOGD=ON + -DOATPP_DISABLE_LOGI=ON ) diff --git a/core/src/server/web_impl/component/AppComponent.hpp b/core/src/server/web_impl/component/AppComponent.hpp index 33f735fe20..6b04c51ae7 100644 --- a/core/src/server/web_impl/component/AppComponent.hpp +++ b/core/src/server/web_impl/component/AppComponent.hpp @@ -11,15 +11,16 @@ #pragma once -#include -#include -#include +#include + +#include #include #include +#include +#include #include -#include - -#include "server/web_impl/handler/WebRequestHandler.h" +#include +#include namespace milvus { namespace server { @@ -41,10 +42,9 @@ class AppComponent { try { return oatpp::network::server::SimpleTCPConnectionProvider::createShared(this->port_); } catch (std::exception& e) { - std::string error_msg = "Cannot bind http port " + std::to_string(this->port_) + - ": " + e.what() + - " (errno:" + std::to_string(errno) + "details: " + strerror(errno) + ")."; - std::cout << error_msg << std::endl; + std::string error_msg = "Cannot bind http port " + std::to_string(this->port_) + ". " + e.what() + + "(errno: " + std::to_string(errno) + ", details: " + strerror(errno) + ")"; + std::cerr << error_msg << std::endl; throw std::runtime_error(error_msg); } }()); @@ -67,8 +67,7 @@ class AppComponent { auto serializerConfig = oatpp::parser::json::mapping::Serializer::Config::createShared(); auto deserializerConfig = oatpp::parser::json::mapping::Deserializer::Config::createShared(); deserializerConfig->allowUnknownFields = false; - return oatpp::parser::json::mapping::ObjectMapper::createShared(serializerConfig, - deserializerConfig); + return oatpp::parser::json::mapping::ObjectMapper::createShared(serializerConfig, deserializerConfig); }()); }; diff --git a/core/src/server/web_impl/dto/PartitionDto.hpp b/core/src/server/web_impl/dto/PartitionDto.hpp index 006999204b..01d6717eae 100644 --- a/core/src/server/web_impl/dto/PartitionDto.hpp +++ b/core/src/server/web_impl/dto/PartitionDto.hpp @@ -32,7 +32,7 @@ class PartitionListDto : public oatpp::data::mapping::type::Object { DTO_INIT(PartitionListDto, Object) DTO_FIELD(List::ObjectWrapper, partitions); - DTO_FIELD(Int64, count) = 0; + DTO_FIELD(Int64, count) = 0L; }; #include OATPP_CODEGEN_END(DTO) diff --git a/core/src/server/web_impl/dto/StatusDto.hpp b/core/src/server/web_impl/dto/StatusDto.hpp index a2f29ae074..d818afa3db 100644 --- a/core/src/server/web_impl/dto/StatusDto.hpp +++ b/core/src/server/web_impl/dto/StatusDto.hpp @@ -24,7 +24,7 @@ class StatusDto: public oatpp::data::mapping::type::Object { DTO_INIT(StatusDto, Object) DTO_FIELD(String, message) = "Success"; - DTO_FIELD(Int64, code) = 0; + DTO_FIELD(Int64, code) = 0L; }; #include OATPP_CODEGEN_END(DTO) diff --git a/core/src/server/web_impl/dto/TableDto.hpp b/core/src/server/web_impl/dto/TableDto.hpp index d5e533c737..981b82811f 100644 --- a/core/src/server/web_impl/dto/TableDto.hpp +++ b/core/src/server/web_impl/dto/TableDto.hpp @@ -53,7 +53,7 @@ class TableListFieldsDto : public OObject { DTO_INIT(TableListFieldsDto, Object) DTO_FIELD(List::ObjectWrapper, collections); - DTO_FIELD(Int64, count) = 0; + DTO_FIELD(Int64, count) = 0L; }; #include OATPP_CODEGEN_END(DTO) diff --git a/core/thirdparty/versions.txt b/core/thirdparty/versions.txt index a379020561..ad1ba3e299 100644 --- a/core/thirdparty/versions.txt +++ b/core/thirdparty/versions.txt @@ -11,7 +11,7 @@ GRPC_VERSION=master ZLIB_VERSION=v1.2.11 OPENTRACING_VERSION=v1.5.1 FIU_VERSION=1.00 -OATPP_VERSION=0.19.11 +OATPP_VERSION=1.0.0 AWS_VERSION=1.7.250 # vim: set filetype=sh: