diff --git a/cpp/conf/server_config.template b/cpp/conf/server_config.template index 360c1b52a6b7c3bcdf2cecaf6136558aa04bb727..f1615b360c8d995bd54c925ceb2d00b06de3a723 100644 --- a/cpp/conf/server_config.template +++ b/cpp/conf/server_config.template @@ -1,7 +1,6 @@ server_config: address: 0.0.0.0 # milvus server ip address (IPv4) port: 19530 # the port milvus listen to, default: 19530, range: 1025 ~ 65534 - gpu_index: 0 # the gpu milvus use, default: 0, range: 0 ~ gpu number - 1 mode: single # milvus deployment type: single, cluster, read_only time_zone: UTC+8 # Use the UTC-x or UTC+x to specify a time zone. eg. UTC+8 for China Standard Time @@ -18,6 +17,7 @@ db_config: archive_days_threshold: 0 # files older than x days will be archived, 0 means no limit, unit: day insert_buffer_size: 4 # maximum insert buffer size allowed, default: 4, unit: GB, should be at least 1 GB. # the sum of insert_buffer_size and cpu_cache_capacity should be less than total memory, unit: GB + build_index_gpu: 0 # which gpu is used to build index, default: 0, range: 0 ~ gpu number - 1 metric_config: is_startup: off # if monitoring start: on, off @@ -33,8 +33,6 @@ cache_config: insert_cache_immediately: false # insert data will be load into cache immediately for hot query gpu_cache_capacity: 5 # how many memory are used as cache in gpu, unit: GB, RANGE: 0 ~ less than total memory gpu_cache_free_percent: 0.85 # old data will be erased from cache when cache is full, this value specify how much memory should be kept, range: greater than zero ~ 1.0 - gpu_ids: # gpu id - - 0 engine_config: use_blas_threshold: 20 diff --git a/cpp/src/cache/GpuCacheMgr.cpp b/cpp/src/cache/GpuCacheMgr.cpp index ef2f307c30b81dd62cc3c5375cfa80501ad76742..0b6a6132d80665bd5deb6a2f0e7e61ef9eb42168 100644 --- a/cpp/src/cache/GpuCacheMgr.cpp +++ b/cpp/src/cache/GpuCacheMgr.cpp @@ -17,36 +17,14 @@ std::mutex GpuCacheMgr::mutex_; std::unordered_map GpuCacheMgr::instance_; namespace { - constexpr int64_t unit = 1024 * 1024 * 1024; - - std::vector load() { - server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); - auto conf_gpu_ids = config.GetSequence(server::CONFIG_GPU_IDS); - - std::vector gpu_ids; - - for (auto gpu_id : conf_gpu_ids) { - gpu_ids.push_back(std::atoi(gpu_id.c_str())); - } - - return gpu_ids; - } -} - - -bool GpuCacheMgr::GpuIdInConfig(uint64_t gpu_id) { - static std::vector ids = load(); - for (auto id : ids) { - if (gpu_id == id) return true; - } - return false; + constexpr int64_t G_BYTE = 1024 * 1024 * 1024; } GpuCacheMgr::GpuCacheMgr() { server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); int64_t cap = config.GetInt64Value(server::CONFIG_GPU_CACHE_CAPACITY, 2); - cap *= unit; + cap *= G_BYTE; cache_ = std::make_shared(cap, 1UL<<32); double free_percent = config.GetDoubleValue(server::GPU_CACHE_FREE_PERCENT, 0.85); @@ -58,6 +36,19 @@ GpuCacheMgr::GpuCacheMgr() { } } +CacheMgr* GpuCacheMgr::GetInstance(uint64_t gpu_id) { + if (instance_.find(gpu_id) == instance_.end()) { + std::lock_guard lock(mutex_); + if (instance_.find(gpu_id) == instance_.end()) { + instance_.insert(std::pair(gpu_id, std::make_shared())); + } + return instance_[gpu_id].get(); + } else { + std::lock_guard lock(mutex_); + return instance_[gpu_id].get(); + } +} + void GpuCacheMgr::InsertItem(const std::string& key, const DataObjPtr& data) { //TODO: copy data to gpu if (cache_ == nullptr) { diff --git a/cpp/src/cache/GpuCacheMgr.h b/cpp/src/cache/GpuCacheMgr.h index f26dfaa1b7912c607f0befef008dbfe58c9d1551..35756733f0a93e3abee6d57bbc258647228d3fbb 100644 --- a/cpp/src/cache/GpuCacheMgr.h +++ b/cpp/src/cache/GpuCacheMgr.h @@ -19,21 +19,7 @@ class GpuCacheMgr : public CacheMgr { public: GpuCacheMgr(); - static bool GpuIdInConfig(uint64_t gpu_id); - - static CacheMgr* GetInstance(uint64_t gpu_id) { - if (instance_.find(gpu_id) == instance_.end()) { - std::lock_guard lock(mutex_); - if (instance_.find(gpu_id) == instance_.end()) { - if (GpuIdInConfig(gpu_id)) { - instance_.insert(std::pair(gpu_id, std::make_shared())); - } else { - return nullptr; - } - } - } - return instance_[gpu_id].get(); - } + static CacheMgr* GetInstance(uint64_t gpu_id); void InsertItem(const std::string& key, const DataObjPtr& data) override; diff --git a/cpp/src/metrics/PrometheusMetrics.cpp b/cpp/src/metrics/PrometheusMetrics.cpp index d12acca87d4837052e88998eb33f0039317df74a..07ca9aa3011464c662c29b6021bddad9493bd8f0 100644 --- a/cpp/src/metrics/PrometheusMetrics.cpp +++ b/cpp/src/metrics/PrometheusMetrics.cpp @@ -168,22 +168,13 @@ void PrometheusMetrics::CPUTemperature() { } void PrometheusMetrics::GpuCacheUsageGaugeSet() { - if(!startup_) return; - server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); - auto conf_gpu_ids = config.GetSequence(server::CONFIG_GPU_IDS); - - std::vector gpu_ids; - - for (auto gpu_id : conf_gpu_ids) { - gpu_ids.push_back(std::atoi(gpu_id.c_str())); - } - - for(auto i = 0; i < gpu_ids.size(); ++i) { - uint64_t cache_usage = cache::GpuCacheMgr::GetInstance(gpu_ids[i])->CacheUsage(); - uint64_t cache_capacity = cache::GpuCacheMgr::GetInstance(gpu_ids[i])->CacheCapacity(); - prometheus::Gauge &gpu_cache = gpu_cache_usage_.Add({{"GPU_Cache", std::to_string(i)}}); - gpu_cache.Set(cache_usage * 100 / cache_capacity); - } +// std::vector gpu_ids = {0}; +// for(auto i = 0; i < gpu_ids.size(); ++i) { +// uint64_t cache_usage = cache::GpuCacheMgr::GetInstance(gpu_ids[i])->CacheUsage(); +// uint64_t cache_capacity = cache::GpuCacheMgr::GetInstance(gpu_ids[i])->CacheCapacity(); +// prometheus::Gauge &gpu_cache = gpu_cache_usage_.Add({{"GPU_Cache", std::to_string(i)}}); +// gpu_cache.Set(cache_usage * 100 / cache_capacity); +// } } } diff --git a/cpp/src/server/ServerConfig.cpp b/cpp/src/server/ServerConfig.cpp index f476aa8eae646957602da2694fbd415ffca7f84b..da898d22390471cece804c6db15b2b7506ea46ac 100644 --- a/cpp/src/server/ServerConfig.cpp +++ b/cpp/src/server/ServerConfig.cpp @@ -113,18 +113,6 @@ ServerConfig::CheckServerConfig() { } } - std::string gpu_index_str = server_config.GetValue(CONFIG_GPU_INDEX, "0"); - if (ValidationUtil::ValidateStringIsNumber(gpu_index_str) != SERVER_SUCCESS) { - std::cerr << "ERROR: gpu_index " << gpu_index_str << " is not a number" << std::endl; - okay = false; - } else { - int32_t gpu_index = std::stol(gpu_index_str); - if (ValidationUtil::ValidateGpuIndex(gpu_index) != SERVER_SUCCESS) { - std::cerr << "ERROR: invalid gpu_index " << gpu_index_str << std::endl; - okay = false; - } - } - std::string mode = server_config.GetValue(CONFIG_CLUSTER_MODE, "single"); if (mode != "single" && mode != "cluster" && mode != "read_only") { std::cerr << "ERROR: mode " << mode << " is not one of ['single', 'cluster', 'read_only']" << std::endl; @@ -214,6 +202,18 @@ ServerConfig::CheckDBConfig() { } } + std::string gpu_index_str = db_config.GetValue(CONFIG_DB_BUILD_INDEX_GPU, "0"); + if (ValidationUtil::ValidateStringIsNumber(gpu_index_str) != SERVER_SUCCESS) { + std::cerr << "ERROR: gpu_index " << gpu_index_str << " is not a number" << std::endl; + okay = false; + } else { + int32_t gpu_index = std::stol(gpu_index_str); + if (ValidationUtil::ValidateGpuIndex(gpu_index) != SERVER_SUCCESS) { + std::cerr << "ERROR: invalid gpu_index " << gpu_index_str << std::endl; + okay = false; + } + } + return (okay ? SERVER_SUCCESS : SERVER_INVALID_ARGUMENT); } @@ -313,7 +313,7 @@ ServerConfig::CheckCacheConfig() { else { uint64_t gpu_cache_capacity = (uint64_t) std::stol(gpu_cache_capacity_str); gpu_cache_capacity *= GB; - int gpu_index = GetConfig(CONFIG_SERVER).GetInt32Value(CONFIG_GPU_INDEX, 0); + int gpu_index = GetConfig(CONFIG_DB).GetInt32Value(CONFIG_DB_BUILD_INDEX_GPU, 0); size_t gpu_memory; if (ValidationUtil::GetGpuMemory(gpu_index, gpu_memory) != SERVER_SUCCESS) { std::cerr << "ERROR: could not get gpu memory for device " << gpu_index << std::endl; @@ -340,19 +340,6 @@ ServerConfig::CheckCacheConfig() { okay = false; } - auto conf_gpu_ids = cache_config.GetSequence(server::CONFIG_GPU_IDS); - - for (std::string &gpu_id : conf_gpu_ids) { - if (ValidationUtil::ValidateStringIsNumber(gpu_id) != SERVER_SUCCESS) { - std::cerr << "ERROR: gpu_id " << gpu_id << " is not a number" << std::endl; - okay = false; - } - else if (ValidationUtil::ValidateGpuIndex(std::stol(gpu_id)) != SERVER_SUCCESS) { - std::cerr << "ERROR: gpu_id " << gpu_id << " is invalid" << std::endl; - okay = false; - } - } - return (okay ? SERVER_SUCCESS : SERVER_INVALID_ARGUMENT); } @@ -483,7 +470,7 @@ ServerConfig::CheckResourceConfig() { } } else if (type == "GPU") { - int build_index_gpu_index = GetConfig(CONFIG_SERVER).GetInt32Value(CONFIG_GPU_INDEX, 0); + int build_index_gpu_index = GetConfig(CONFIG_DB).GetInt32Value(CONFIG_DB_BUILD_INDEX_GPU, 0); if (device_id == build_index_gpu_index) { resource_valid_flag = true; } diff --git a/cpp/src/server/ServerConfig.h b/cpp/src/server/ServerConfig.h index f9b43fdba41ccc411ea4262285b4f3e9e6b5fec2..a8d906f710aee50b00aa598c7a650ef57b4e6cc0 100644 --- a/cpp/src/server/ServerConfig.h +++ b/cpp/src/server/ServerConfig.h @@ -18,7 +18,6 @@ static const char* CONFIG_SERVER = "server_config"; static const char* CONFIG_SERVER_ADDRESS = "address"; static const char* CONFIG_SERVER_PORT = "port"; static const char* CONFIG_CLUSTER_MODE = "mode"; -static const char* CONFIG_GPU_INDEX = "gpu_index"; static const char* CONFIG_TIME_ZONE = "time_zone"; static const char* CONFIG_DB = "db_config"; @@ -29,6 +28,7 @@ static const char* CONFIG_DB_ARCHIVE_DISK = "archive_disk_threshold"; static const char* CONFIG_DB_ARCHIVE_DAYS = "archive_days_threshold"; static const char* CONFIG_DB_INSERT_BUFFER_SIZE = "insert_buffer_size"; static const char* CONFIG_DB_PARALLEL_REDUCE = "parallel_reduce"; +static const char* CONFIG_DB_BUILD_INDEX_GPU = "build_index_gpu"; static const char* CONFIG_LOG = "log_config"; @@ -37,7 +37,6 @@ static const char* CONFIG_CPU_CACHE_CAPACITY = "cpu_cache_capacity"; static const char* CONFIG_GPU_CACHE_CAPACITY = "gpu_cache_capacity"; static const char* CACHE_FREE_PERCENT = "cpu_cache_free_percent"; static const char* CONFIG_INSERT_CACHE_IMMEDIATELY = "insert_cache_immediately"; -static const char* CONFIG_GPU_IDS = "gpu_ids"; static const char *GPU_CACHE_FREE_PERCENT = "gpu_cache_free_percent"; static const char* CONFIG_METRIC = "metric_config"; diff --git a/cpp/unittest/db/db_tests.cpp b/cpp/unittest/db/db_tests.cpp index 50724eddc3d513ab084b217f3f4e0cc0a5a9e41a..91b68210719f98a4ab95d0590bef18e04a10735e 100644 --- a/cpp/unittest/db/db_tests.cpp +++ b/cpp/unittest/db/db_tests.cpp @@ -25,8 +25,8 @@ namespace { static const char* TABLE_NAME = "test_group"; static constexpr int64_t TABLE_DIM = 256; - static constexpr int64_t VECTOR_COUNT = 250000; - static constexpr int64_t INSERT_LOOP = 10000; + static constexpr int64_t VECTOR_COUNT = 25000; + static constexpr int64_t INSERT_LOOP = 1000; static constexpr int64_t SECONDS_EACH_HOUR = 3600; static constexpr int64_t DAY_SECONDS = 24 * 60 * 60; diff --git a/cpp/unittest/db/engine_test.cpp b/cpp/unittest/db/engine_test.cpp index 68ad4d761f27eb5b2334136c00c65097b8bdfae7..5cdad9f121942fc8d03cfe1ff970dceafb20d831 100644 --- a/cpp/unittest/db/engine_test.cpp +++ b/cpp/unittest/db/engine_test.cpp @@ -105,9 +105,6 @@ TEST_F(EngineTest, ENGINE_IMPL_TEST) { ASSERT_EQ(engine_ptr->Dimension(), dimension); ASSERT_EQ(engine_ptr->Count(), ids.size()); -// server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); -// config.AddSequenceItem(server::CONFIG_GPU_IDS, "0"); -// // status = engine_ptr->CopyToGpu(0); // //ASSERT_TRUE(status.ok()); // diff --git a/cpp/unittest/db/mem_test.cpp b/cpp/unittest/db/mem_test.cpp index a612be2bb314802053f3b6886ccff61fe8e0ead3..1429038a2ba216347f3eeb8c0cb16c3e5b8a7090 100644 --- a/cpp/unittest/db/mem_test.cpp +++ b/cpp/unittest/db/mem_test.cpp @@ -24,8 +24,6 @@ namespace { static std::string TABLE_NAME = "test_group"; static constexpr int64_t TABLE_DIM = 256; -static constexpr int64_t VECTOR_COUNT = 250000; -static constexpr int64_t INSERT_LOOP = 10000; std::string GenTableName() { auto now = std::chrono::system_clock::now(); @@ -212,7 +210,7 @@ TEST_F(MemManagerTest2, SERIAL_INSERT_SEARCH_TEST) { std::map> search_vectors; { engine::IDNumbers vector_ids; - int64_t nb = 1024000; + int64_t nb = 100000; std::vector xb; BuildVectors(nb, xb); engine::Status status = db_->InsertVectors(TABLE_NAME, nb, xb.data(), vector_ids); @@ -224,7 +222,7 @@ TEST_F(MemManagerTest2, SERIAL_INSERT_SEARCH_TEST) { std::mt19937 gen(rd()); std::uniform_int_distribution dis(0, nb - 1); - int64_t num_query = 20; + int64_t num_query = 10; for (int64_t i = 0; i < num_query; ++i) { int64_t index = dis(gen); std::vector search; diff --git a/cpp/unittest/db/mysql_db_test.cpp b/cpp/unittest/db/mysql_db_test.cpp index a98959ed9783b5732567983ea9f2d09c6d122e9e..677b310a600ab8ff6fbbb961e96198dd19ba1bb9 100644 --- a/cpp/unittest/db/mysql_db_test.cpp +++ b/cpp/unittest/db/mysql_db_test.cpp @@ -22,8 +22,8 @@ namespace { static const char* TABLE_NAME = "test_group"; static constexpr int64_t TABLE_DIM = 256; - static constexpr int64_t VECTOR_COUNT = 250000; - static constexpr int64_t INSERT_LOOP = 10000; + static constexpr int64_t VECTOR_COUNT = 25000; + static constexpr int64_t INSERT_LOOP = 1000; engine::meta::TableSchema BuildTableSchema() { engine::meta::TableSchema table_info; diff --git a/cpp/unittest/db/search_test.cpp b/cpp/unittest/db/search_test.cpp index b8e0ffafffdd2ca3cc4581abc4a6e4e9a10ab4a2..2eb3300bc1f1dab5e38c97bbcbe1248d1808f734 100644 --- a/cpp/unittest/db/search_test.cpp +++ b/cpp/unittest/db/search_test.cpp @@ -288,7 +288,7 @@ TEST(DBSearchTest, PARALLEL_TOPK_TEST) { DoTopk(5, 10, 4, false); DoTopk(20005, 998, 123, true); - DoTopk(9987, 12, 10, false); - DoTopk(77777, 1000, 1, false); - DoTopk(5432, 8899, 8899, true); +// DoTopk(9987, 12, 10, false); +// DoTopk(77777, 1000, 1, false); +// DoTopk(5432, 8899, 8899, true); } \ No newline at end of file diff --git a/cpp/unittest/db/utils.cpp b/cpp/unittest/db/utils.cpp index cc2f3cb367e8b63e9971a3f4d69d5fe9768d7b8c..873028b65a8837618acab7a02e1b8658c761dd67 100644 --- a/cpp/unittest/db/utils.cpp +++ b/cpp/unittest/db/utils.cpp @@ -66,9 +66,6 @@ engine::Options BaseTest::GetOptions() { void DBTest::SetUp() { BaseTest::SetUp(); - server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); - config.AddSequenceItem(server::CONFIG_GPU_IDS, "0"); - auto res_mgr = engine::ResMgrInst::GetInstance(); res_mgr->Clear(); res_mgr->Add(engine::ResourceFactory::Create("disk", "DISK", 0, true, false)); diff --git a/cpp/unittest/knowhere/knowhere_test.cpp b/cpp/unittest/knowhere/knowhere_test.cpp index 85373a0adc3c4b4c33632d4de38ae567e94b1cd1..8096b2821a3658c8fd321009fac4eb342e42b6eb 100644 --- a/cpp/unittest/knowhere/knowhere_test.cpp +++ b/cpp/unittest/knowhere/knowhere_test.cpp @@ -142,7 +142,7 @@ INSTANTIATE_TEST_CASE_P(WrapperParam, KnowhereWrapperTest, ) ); -TEST_P(KnowhereWrapperTest, base_test) { +TEST_P(KnowhereWrapperTest, BASE_TEST) { EXPECT_EQ(index_->GetType(), index_type); auto elems = nq * k; @@ -154,7 +154,7 @@ TEST_P(KnowhereWrapperTest, base_test) { AssertResult(res_ids, res_dis); } -TEST_P(KnowhereWrapperTest, to_gpu_test) { +TEST_P(KnowhereWrapperTest, TO_GPU_TEST) { EXPECT_EQ(index_->GetType(), index_type); auto elems = nq * k; @@ -174,7 +174,7 @@ TEST_P(KnowhereWrapperTest, to_gpu_test) { } { - std::string file_location = "/tmp/test_gpu_file"; + std::string file_location = "/tmp/knowhere_gpu_file"; write_index(index_, file_location); auto new_index = read_index(file_location); @@ -186,11 +186,11 @@ TEST_P(KnowhereWrapperTest, to_gpu_test) { } } -TEST_P(KnowhereWrapperTest, to_cpu_test) { +TEST_P(KnowhereWrapperTest, TO_CPU_TEST) { // dev } -TEST_P(KnowhereWrapperTest, serialize) { +TEST_P(KnowhereWrapperTest, SERIALIZE_TEST) { EXPECT_EQ(index_->GetType(), index_type); auto elems = nq * k; @@ -215,7 +215,7 @@ TEST_P(KnowhereWrapperTest, serialize) { } { - std::string file_location = "/tmp/whatever"; + std::string file_location = "/tmp/knowhere"; write_index(index_, file_location); auto new_index = read_index(file_location); EXPECT_EQ(new_index->GetType(), ConvertToCpuIndexType(index_type)); diff --git a/cpp/unittest/metrics/metrics_test.cpp b/cpp/unittest/metrics/metrics_test.cpp index d33ace6868bbcb4a445d096ced31cb4d66d41e53..edbbb5803572844136aaa2dfda82ddc1cd446b81 100644 --- a/cpp/unittest/metrics/metrics_test.cpp +++ b/cpp/unittest/metrics/metrics_test.cpp @@ -24,7 +24,7 @@ using namespace zilliz::milvus; -TEST_F(MetricTest, Metric_Tes) { +TEST_F(MetricTest, METRIC_TEST) { server::ConfigNode &configNode = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_METRIC); configNode.SetValue(server::CONFIG_METRIC_COLLECTOR, "zabbix"); server::Metrics::GetInstance(); @@ -122,7 +122,7 @@ TEST_F(MetricTest, Metric_Tes) { delete [] qxb; }; -TEST_F(MetricTest, Collector_Metrics_Test){ +TEST_F(MetricTest, COLLECTOR_METRICS_TEST){ engine::Status status = engine::Status::OK(); server::CollectInsertMetrics insert_metrics0(0, status); status = engine::Status(DB_ERROR, "error"); diff --git a/cpp/unittest/scheduler/algorithm_test.cpp b/cpp/unittest/scheduler/algorithm_test.cpp index 43e6c4eae2dd5dbf9152d5cef81238360d105cc2..eeb7fc64f3abd3a7e8a1049ba86e7cd7bd741201 100644 --- a/cpp/unittest/scheduler/algorithm_test.cpp +++ b/cpp/unittest/scheduler/algorithm_test.cpp @@ -53,7 +53,7 @@ class AlgorithmTest : public testing::Test { ResourceMgrPtr res_mgr_; }; -TEST_F(AlgorithmTest, ShortestPath_test) { +TEST_F(AlgorithmTest, SHORTESTPATH_TEST) { std::vector sp; uint64_t cost; cost = ShortestPath(disk_.lock(), gpu_0_.lock(), res_mgr_, sp); diff --git a/cpp/unittest/scheduler/event_test.cpp b/cpp/unittest/scheduler/event_test.cpp index d2814b4da1ef3114ac3e3cc8acc08b02a588f3a0..0c5ec21037525dac284bf91f335281f8807ef4ac 100644 --- a/cpp/unittest/scheduler/event_test.cpp +++ b/cpp/unittest/scheduler/event_test.cpp @@ -15,7 +15,7 @@ namespace zilliz { namespace milvus { namespace engine { -TEST(EventTest, start_up_event) { +TEST(EventTest, START_UP_EVENT) { ResourceWPtr res(ResourcePtr(nullptr)); auto event = std::make_shared(res); ASSERT_FALSE(event->Dump().empty()); @@ -23,7 +23,7 @@ TEST(EventTest, start_up_event) { std::cout << *EventPtr(event); } -TEST(EventTest, load_completed_event) { +TEST(EventTest, LOAD_COMPLETED_EVENT) { ResourceWPtr res(ResourcePtr(nullptr)); auto event = std::make_shared(res, nullptr); ASSERT_FALSE(event->Dump().empty()); @@ -31,7 +31,7 @@ TEST(EventTest, load_completed_event) { std::cout << *EventPtr(event); } -TEST(EventTest, finish_task_event) { +TEST(EventTest, FINISH_TASK_EVENT) { ResourceWPtr res(ResourcePtr(nullptr)); auto event = std::make_shared(res, nullptr); ASSERT_FALSE(event->Dump().empty()); @@ -40,7 +40,7 @@ TEST(EventTest, finish_task_event) { } -TEST(EventTest, tasktable_updated_event) { +TEST(EventTest, TASKTABLE_UPDATED_EVENT) { ResourceWPtr res(ResourcePtr(nullptr)); auto event = std::make_shared(res); ASSERT_FALSE(event->Dump().empty()); diff --git a/cpp/unittest/scheduler/node_test.cpp b/cpp/unittest/scheduler/node_test.cpp index 642bdce77352a4f8ccb46c573ba364b7cccca0c3..dfe0398d22ff66e40ca5497f3d34966d6d0f409b 100644 --- a/cpp/unittest/scheduler/node_test.cpp +++ b/cpp/unittest/scheduler/node_test.cpp @@ -28,7 +28,7 @@ protected: NodePtr isolated_node2_; }; -TEST_F(NodeTest, add_neighbour) { +TEST_F(NodeTest, ADD_NEIGHBOUR) { ASSERT_EQ(isolated_node1_->GetNeighbours().size(), 0); ASSERT_EQ(isolated_node2_->GetNeighbours().size(), 0); auto pcie = Connection("PCIe", 11.0); @@ -37,7 +37,7 @@ TEST_F(NodeTest, add_neighbour) { ASSERT_EQ(isolated_node2_->GetNeighbours().size(), 0); } -TEST_F(NodeTest, repeat_add_neighbour) { +TEST_F(NodeTest, REPEAT_ADD_NEIGHBOUR) { ASSERT_EQ(isolated_node1_->GetNeighbours().size(), 0); ASSERT_EQ(isolated_node2_->GetNeighbours().size(), 0); auto pcie = Connection("PCIe", 11.0); @@ -47,7 +47,7 @@ TEST_F(NodeTest, repeat_add_neighbour) { ASSERT_EQ(isolated_node2_->GetNeighbours().size(), 0); } -TEST_F(NodeTest, get_neighbours) { +TEST_F(NodeTest, GET_NEIGHBOURS) { { bool n2 = false, n3 = false; auto node1_neighbours = node1_->GetNeighbours(); @@ -72,7 +72,7 @@ TEST_F(NodeTest, get_neighbours) { } } -TEST_F(NodeTest, dump) { +TEST_F(NodeTest, DUMP) { std::cout << node1_->Dump(); ASSERT_FALSE(node1_->Dump().empty()); diff --git a/cpp/unittest/scheduler/normal_test.cpp b/cpp/unittest/scheduler/normal_test.cpp index c679a356bd8d5435dc623a3c2ca6df181eb6539d..8c096c4df8371cae53aa4baa3183e9b6c5f23e2d 100644 --- a/cpp/unittest/scheduler/normal_test.cpp +++ b/cpp/unittest/scheduler/normal_test.cpp @@ -11,7 +11,7 @@ using namespace zilliz::milvus::engine; -TEST(normal_test, inst_test) { +TEST(NormalTest, INST_TEST) { // ResourceMgr only compose resources, provide unified event auto res_mgr = ResMgrInst::GetInstance(); diff --git a/cpp/unittest/scheduler/resource_factory_test.cpp b/cpp/unittest/scheduler/resource_factory_test.cpp index fdd3a4d263204b60e9fe169c17a5f41e03a3579a..82b05f621532887ab29366a475b4896fe780c3fb 100644 --- a/cpp/unittest/scheduler/resource_factory_test.cpp +++ b/cpp/unittest/scheduler/resource_factory_test.cpp @@ -4,7 +4,7 @@ using namespace zilliz::milvus::engine; -TEST(resource_factory_test, create) { +TEST(ResourceFactoryTest, CREATE) { auto disk = ResourceFactory::Create("ssd", "DISK", 0); auto cpu = ResourceFactory::Create("cpu", "CPU", 0); auto gpu = ResourceFactory::Create("gpu", "GPU", 0); diff --git a/cpp/unittest/scheduler/resource_mgr_test.cpp b/cpp/unittest/scheduler/resource_mgr_test.cpp index c4a659bed308d621ddad66625ca16a0c4952b410..180072d87ef7e4e43a62abfb91d1c5c32473b888 100644 --- a/cpp/unittest/scheduler/resource_mgr_test.cpp +++ b/cpp/unittest/scheduler/resource_mgr_test.cpp @@ -44,19 +44,19 @@ protected: ResourcePtr gpu_res; }; -TEST_F(ResourceMgrBaseTest, add) { +TEST_F(ResourceMgrBaseTest, ADD) { auto resource = std::make_shared("test", 0, true, true); auto ret = empty_mgr_->Add(ResourcePtr(resource)); ASSERT_EQ(ret.lock(), resource); } -TEST_F(ResourceMgrBaseTest, add_disk) { +TEST_F(ResourceMgrBaseTest, ADD_DISK) { auto resource = std::make_shared("disk", 0, true, true); auto ret = empty_mgr_->Add(ResourcePtr(resource)); ASSERT_EQ(ret.lock(), resource); } -TEST_F(ResourceMgrBaseTest, connect) { +TEST_F(ResourceMgrBaseTest, CONNECT) { auto resource1 = std::make_shared("resource1", 0, true, true); auto resource2 = std::make_shared("resource2", 2, true, true); empty_mgr_->Add(resource1); @@ -66,7 +66,7 @@ TEST_F(ResourceMgrBaseTest, connect) { } -TEST_F(ResourceMgrBaseTest, invalid_connect) { +TEST_F(ResourceMgrBaseTest, INVALID_CONNECT) { auto resource1 = std::make_shared("resource1", 0, true, true); auto resource2 = std::make_shared("resource2", 2, true, true); empty_mgr_->Add(resource1); @@ -76,19 +76,19 @@ TEST_F(ResourceMgrBaseTest, invalid_connect) { } -TEST_F(ResourceMgrBaseTest, clear) { +TEST_F(ResourceMgrBaseTest, CLEAR) { ASSERT_EQ(mgr1_->GetNumOfResource(), 3); mgr1_->Clear(); ASSERT_EQ(mgr1_->GetNumOfResource(), 0); } -TEST_F(ResourceMgrBaseTest, get_disk_resources) { +TEST_F(ResourceMgrBaseTest, GET_DISK_RESOURCES) { auto disks = mgr1_->GetDiskResources(); ASSERT_EQ(disks.size(), 1); ASSERT_EQ(disks[0].lock(), disk_res); } -TEST_F(ResourceMgrBaseTest, get_all_resources) { +TEST_F(ResourceMgrBaseTest, GET_ALL_RESOURCES) { bool disk = false, cpu = false, gpu = false; auto resources = mgr1_->GetAllResources(); ASSERT_EQ(resources.size(), 3); @@ -103,13 +103,13 @@ TEST_F(ResourceMgrBaseTest, get_all_resources) { ASSERT_TRUE(gpu); } -TEST_F(ResourceMgrBaseTest, get_compute_resources) { +TEST_F(ResourceMgrBaseTest, GET_COMPUTE_RESOURCES) { auto compute_resources = mgr1_->GetComputeResources(); ASSERT_EQ(compute_resources.size(), 1); ASSERT_EQ(compute_resources[0], gpu_res); } -TEST_F(ResourceMgrBaseTest, get_resource_by_type_and_deviceid) { +TEST_F(ResourceMgrBaseTest, GET_RESOURCE_BY_TYPE_AND_DEVICEID) { auto cpu = mgr1_->GetResource(ResourceType::CPU, 1); ASSERT_EQ(cpu, cpu_res); @@ -117,7 +117,7 @@ TEST_F(ResourceMgrBaseTest, get_resource_by_type_and_deviceid) { ASSERT_EQ(invalid, nullptr); } -TEST_F(ResourceMgrBaseTest, get_resource_by_name) { +TEST_F(ResourceMgrBaseTest, GET_RESOURCE_BY_NAME) { auto disk = mgr1_->GetResource("disk"); ASSERT_EQ(disk, disk_res); @@ -125,26 +125,26 @@ TEST_F(ResourceMgrBaseTest, get_resource_by_name) { ASSERT_EQ(invalid, nullptr); } -TEST_F(ResourceMgrBaseTest, get_num_of_resource) { +TEST_F(ResourceMgrBaseTest, GET_NUM_OF_RESOURCE) { ASSERT_EQ(empty_mgr_->GetNumOfResource(), 0); ASSERT_EQ(mgr1_->GetNumOfResource(), 3); } -TEST_F(ResourceMgrBaseTest, get_num_of_compute_resource) { +TEST_F(ResourceMgrBaseTest, GET_NUM_OF_COMPUTE_RESOURCE) { ASSERT_EQ(empty_mgr_->GetNumOfComputeResource(), 0); ASSERT_EQ(mgr1_->GetNumOfComputeResource(), 1); } -TEST_F(ResourceMgrBaseTest, get_num_of_gpu_resource) { +TEST_F(ResourceMgrBaseTest, GET_NUM_OF_GPU_RESOURCE) { ASSERT_EQ(empty_mgr_->GetNumGpuResource(), 0); ASSERT_EQ(mgr1_->GetNumGpuResource(), 1); } -TEST_F(ResourceMgrBaseTest, dump) { +TEST_F(ResourceMgrBaseTest, DUMP) { ASSERT_FALSE(mgr1_->Dump().empty()); } -TEST_F(ResourceMgrBaseTest, dump_tasktables) { +TEST_F(ResourceMgrBaseTest, DUMP_TASKTABLES) { ASSERT_FALSE(mgr1_->DumpTaskTables().empty()); } @@ -169,7 +169,7 @@ class ResourceMgrAdvanceTest : public testing::Test { ResourcePtr disk_res; }; -TEST_F(ResourceMgrAdvanceTest, register_subscriber) { +TEST_F(ResourceMgrAdvanceTest, REGISTER_SUBSCRIBER) { bool flag = false; auto callback = [&](EventPtr event) { flag = true; diff --git a/cpp/unittest/scheduler/resource_test.cpp b/cpp/unittest/scheduler/resource_test.cpp index 8a51bac5f928ebb4c7c256b29b5f46d02de002d6..0eb2de8e33c970bed4efa7d84d99584d74a08674 100644 --- a/cpp/unittest/scheduler/resource_test.cpp +++ b/cpp/unittest/scheduler/resource_test.cpp @@ -46,42 +46,42 @@ protected: ResourcePtr both_disable_ = nullptr; }; -TEST_F(ResourceBaseTest, name) { +TEST_F(ResourceBaseTest, NAME) { ASSERT_EQ(only_loader_->name(), name1); ASSERT_EQ(only_executor_->name(), name2); ASSERT_EQ(both_enable_->name(), name3); ASSERT_EQ(both_disable_->name(), name4); } -TEST_F(ResourceBaseTest, type) { +TEST_F(ResourceBaseTest, TYPE) { ASSERT_EQ(only_loader_->type(), ResourceType::DISK); ASSERT_EQ(only_executor_->type(), ResourceType::CPU); ASSERT_EQ(both_enable_->type(), ResourceType::GPU); ASSERT_EQ(both_disable_->type(), ResourceType::TEST); } -TEST_F(ResourceBaseTest, device_id) { +TEST_F(ResourceBaseTest, DEVICE_ID) { ASSERT_EQ(only_loader_->device_id(), id1); ASSERT_EQ(only_executor_->device_id(), id2); ASSERT_EQ(both_enable_->device_id(), id3); ASSERT_EQ(both_disable_->device_id(), id4); } -TEST_F(ResourceBaseTest, has_loader) { +TEST_F(ResourceBaseTest, HAS_LOADER) { ASSERT_TRUE(only_loader_->HasLoader()); ASSERT_FALSE(only_executor_->HasLoader()); ASSERT_TRUE(both_enable_->HasLoader()); ASSERT_FALSE(both_disable_->HasLoader()); } -TEST_F(ResourceBaseTest, has_executor) { +TEST_F(ResourceBaseTest, HAS_EXECUTOR) { ASSERT_FALSE(only_loader_->HasExecutor()); ASSERT_TRUE(only_executor_->HasExecutor()); ASSERT_TRUE(both_enable_->HasExecutor()); ASSERT_FALSE(both_disable_->HasExecutor()); } -TEST_F(ResourceBaseTest, dump) { +TEST_F(ResourceBaseTest, DUMP) { ASSERT_FALSE(only_loader_->Dump().empty()); ASSERT_FALSE(only_executor_->Dump().empty()); ASSERT_FALSE(both_enable_->Dump().empty()); @@ -165,7 +165,7 @@ protected: std::condition_variable cv_; }; -TEST_F(ResourceAdvanceTest, disk_resource_test) { +TEST_F(ResourceAdvanceTest, DISK_RESOURCE_TEST) { const uint64_t NUM = 100; std::vector> tasks; TableFileSchemaPtr dummy = nullptr; @@ -190,7 +190,7 @@ TEST_F(ResourceAdvanceTest, disk_resource_test) { } } -TEST_F(ResourceAdvanceTest, cpu_resource_test) { +TEST_F(ResourceAdvanceTest, CPU_RESOURCE_TEST) { const uint64_t NUM = 100; std::vector> tasks; TableFileSchemaPtr dummy = nullptr; @@ -215,7 +215,7 @@ TEST_F(ResourceAdvanceTest, cpu_resource_test) { } } -TEST_F(ResourceAdvanceTest, gpu_resource_test) { +TEST_F(ResourceAdvanceTest, GPU_RESOURCE_TEST) { const uint64_t NUM = 100; std::vector> tasks; TableFileSchemaPtr dummy = nullptr; @@ -240,7 +240,7 @@ TEST_F(ResourceAdvanceTest, gpu_resource_test) { } } -TEST_F(ResourceAdvanceTest, test_resource_test) { +TEST_F(ResourceAdvanceTest, TEST_RESOURCE_TEST) { const uint64_t NUM = 100; std::vector> tasks; TableFileSchemaPtr dummy = nullptr; diff --git a/cpp/unittest/scheduler/schedinst_test.cpp b/cpp/unittest/scheduler/schedinst_test.cpp index ddb3bec4271a1b479eb43f63569f7c5f0dd051e5..b824c200222e39991c0b858a5affbfc60ee7682c 100644 --- a/cpp/unittest/scheduler/schedinst_test.cpp +++ b/cpp/unittest/scheduler/schedinst_test.cpp @@ -68,7 +68,7 @@ protected: const std::string CONFIG_FILE = "/tmp/milvus_sched_test/config.yaml"; }; -TEST_F(SchedInstTest, simple_gpu) { +TEST_F(SchedInstTest, SIMPLE_GPU) { StartSchedulerService(); } diff --git a/cpp/unittest/scheduler/scheduler_test.cpp b/cpp/unittest/scheduler/scheduler_test.cpp index f176311eb1fe4dfc13302ff73e7ca4de790c8adf..702e1a83b63cde7b522daf0ce720084a4fe396d1 100644 --- a/cpp/unittest/scheduler/scheduler_test.cpp +++ b/cpp/unittest/scheduler/scheduler_test.cpp @@ -94,10 +94,6 @@ class SchedulerTest : public testing::Test { protected: void SetUp() override { - server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); - config.AddSequenceItem(server::CONFIG_GPU_IDS, "0"); - config.AddSequenceItem(server::CONFIG_GPU_IDS, "1"); - ResourcePtr cpu = ResourceFactory::Create("cpu", "CPU", 0, true, false); ResourcePtr gpu_0 = ResourceFactory::Create("gpu0", "GPU", 0); ResourcePtr gpu_1 = ResourceFactory::Create("gpu1", "GPU", 1); @@ -142,7 +138,7 @@ insert_dummy_index_into_gpu_cache(uint64_t device_id) { cache::GpuCacheMgr::GetInstance(device_id)->InsertItem("location", obj); } -TEST_F(SchedulerTest, OnLoadCompleted) { +TEST_F(SchedulerTest, ON_LOAD_COMPLETED) { const uint64_t NUM = 10; std::vector> tasks; TableFileSchemaPtr dummy = std::make_shared(); @@ -162,7 +158,7 @@ TEST_F(SchedulerTest, OnLoadCompleted) { } -TEST_F(SchedulerTest, PushTaskToNeighbourRandomlyTest) { +TEST_F(SchedulerTest, PUSH_TASK_TO_NEIGHBOUR_RANDOMLY_TEST) { const uint64_t NUM = 10; std::vector> tasks; TableFileSchemaPtr dummy1 = std::make_shared(); @@ -233,7 +229,7 @@ protected: }; -TEST_F(SchedulerTest2, SpecifiedResourceTest) { +TEST_F(SchedulerTest2, SPECIFIED_RESOURCE_TEST) { const uint64_t NUM = 10; std::vector> tasks; TableFileSchemaPtr dummy = std::make_shared(); diff --git a/cpp/unittest/scheduler/task_test.cpp b/cpp/unittest/scheduler/task_test.cpp index f42006fc5269a839458a62df2ccdc6b2426b5674..04071dc0c9c81ab1ab12287b24bf5e1f71722a36 100644 --- a/cpp/unittest/scheduler/task_test.cpp +++ b/cpp/unittest/scheduler/task_test.cpp @@ -13,7 +13,7 @@ namespace milvus { namespace engine { -TEST(TaskTest, invalid_index) { +TEST(TaskTest, INVALID_INDEX) { auto search_task = std::make_shared(nullptr); search_task->Load(LoadType::TEST, 10); } diff --git a/cpp/unittest/scheduler/tasktable_test.cpp b/cpp/unittest/scheduler/tasktable_test.cpp index 8710aff5b55c829db1fb3a4307e713e09e35a6a5..f13ccaecf97ba3e5b486f729cac05a17d95d4fcb 100644 --- a/cpp/unittest/scheduler/tasktable_test.cpp +++ b/cpp/unittest/scheduler/tasktable_test.cpp @@ -32,18 +32,18 @@ protected: std::vector items_; }; -TEST_F(TaskTableItemTest, construct) { +TEST_F(TaskTableItemTest, CONSTRUCT) { ASSERT_EQ(default_.id, 0); ASSERT_EQ(default_.task, nullptr); ASSERT_EQ(default_.state, TaskTableItemState::INVALID); } -TEST_F(TaskTableItemTest, destruct) { +TEST_F(TaskTableItemTest, DESTRUCT) { auto p_item = new TaskTableItem(); delete p_item; } -TEST_F(TaskTableItemTest, is_finish) { +TEST_F(TaskTableItemTest, IS_FINISH) { for (auto &item : items_) { if (item->state == TaskTableItemState::EXECUTED || item->state == TaskTableItemState::MOVED) { @@ -54,13 +54,13 @@ TEST_F(TaskTableItemTest, is_finish) { } } -TEST_F(TaskTableItemTest, dump) { +TEST_F(TaskTableItemTest, DUMP) { for (auto &item : items_) { ASSERT_FALSE(item->Dump().empty()); } } -TEST_F(TaskTableItemTest, load) { +TEST_F(TaskTableItemTest, LOAD) { for (auto &item : items_) { auto before_state = item->state; auto ret = item->Load(); @@ -74,7 +74,7 @@ TEST_F(TaskTableItemTest, load) { } } -TEST_F(TaskTableItemTest, loaded) { +TEST_F(TaskTableItemTest, LOADED) { for (auto &item : items_) { auto before_state = item->state; auto ret = item->Loaded(); @@ -88,7 +88,7 @@ TEST_F(TaskTableItemTest, loaded) { } } -TEST_F(TaskTableItemTest, execute) { +TEST_F(TaskTableItemTest, EXECUTE) { for (auto &item : items_) { auto before_state = item->state; auto ret = item->Execute(); @@ -103,7 +103,7 @@ TEST_F(TaskTableItemTest, execute) { } -TEST_F(TaskTableItemTest, executed) { +TEST_F(TaskTableItemTest, EXECUTED) { for (auto &item : items_) { auto before_state = item->state; auto ret = item->Executed(); @@ -117,7 +117,7 @@ TEST_F(TaskTableItemTest, executed) { } } -TEST_F(TaskTableItemTest, move) { +TEST_F(TaskTableItemTest, MOVE) { for (auto &item : items_) { auto before_state = item->state; auto ret = item->Move(); @@ -131,7 +131,7 @@ TEST_F(TaskTableItemTest, move) { } } -TEST_F(TaskTableItemTest, moved) { +TEST_F(TaskTableItemTest, MOVED) { for (auto &item : items_) { auto before_state = item->state; auto ret = item->Moved(); @@ -163,7 +163,7 @@ protected: TaskTable empty_table_; }; -TEST_F(TaskTableBaseTest, subscriber) { +TEST_F(TaskTableBaseTest, SUBSCRIBER) { bool flag = false; auto callback = [&]() { flag = true; @@ -174,46 +174,46 @@ TEST_F(TaskTableBaseTest, subscriber) { } -TEST_F(TaskTableBaseTest, put_task) { +TEST_F(TaskTableBaseTest, PUT_TASK) { empty_table_.Put(task1_); ASSERT_EQ(empty_table_.Get(0)->task, task1_); } -TEST_F(TaskTableBaseTest, put_invalid_test) { +TEST_F(TaskTableBaseTest, PUT_INVALID_TEST) { empty_table_.Put(invalid_task_); ASSERT_EQ(empty_table_.Get(0)->task, invalid_task_); } -TEST_F(TaskTableBaseTest, put_batch) { +TEST_F(TaskTableBaseTest, PUT_BATCH) { std::vector tasks{task1_, task2_}; empty_table_.Put(tasks); ASSERT_EQ(empty_table_.Get(0)->task, task1_); ASSERT_EQ(empty_table_.Get(1)->task, task2_); } -TEST_F(TaskTableBaseTest, put_empty_batch) { +TEST_F(TaskTableBaseTest, PUT_EMPTY_BATCH) { std::vector tasks{}; empty_table_.Put(tasks); } -TEST_F(TaskTableBaseTest, empty) { +TEST_F(TaskTableBaseTest, EMPTY) { ASSERT_TRUE(empty_table_.Empty()); empty_table_.Put(task1_); ASSERT_FALSE(empty_table_.Empty()); } -TEST_F(TaskTableBaseTest, size) { +TEST_F(TaskTableBaseTest, SIZE) { ASSERT_EQ(empty_table_.Size(), 0); empty_table_.Put(task1_); ASSERT_EQ(empty_table_.Size(), 1); } -TEST_F(TaskTableBaseTest, operator_) { +TEST_F(TaskTableBaseTest, OPERATOR) { empty_table_.Put(task1_); ASSERT_EQ(empty_table_.Get(0), empty_table_[0]); } -TEST_F(TaskTableBaseTest, pick_to_load) { +TEST_F(TaskTableBaseTest, PICK_TO_LOAD) { const size_t NUM_TASKS = 10; for (size_t i = 0; i < NUM_TASKS; ++i) { empty_table_.Put(task1_); @@ -226,7 +226,7 @@ TEST_F(TaskTableBaseTest, pick_to_load) { ASSERT_EQ(indexes[0], 2); } -TEST_F(TaskTableBaseTest, pick_to_load_limit) { +TEST_F(TaskTableBaseTest, PICK_TO_LOAD_LIMIT) { const size_t NUM_TASKS = 10; for (size_t i = 0; i < NUM_TASKS; ++i) { empty_table_.Put(task1_); @@ -241,7 +241,7 @@ TEST_F(TaskTableBaseTest, pick_to_load_limit) { ASSERT_EQ(indexes[2], 4); } -TEST_F(TaskTableBaseTest, pick_to_load_cache) { +TEST_F(TaskTableBaseTest, PICK_TO_LOAD_CACHE) { const size_t NUM_TASKS = 10; for (size_t i = 0; i < NUM_TASKS; ++i) { empty_table_.Put(task1_); @@ -262,7 +262,7 @@ TEST_F(TaskTableBaseTest, pick_to_load_cache) { ASSERT_EQ(indexes[0], 2); } -TEST_F(TaskTableBaseTest, pick_to_execute) { +TEST_F(TaskTableBaseTest, PICK_TO_EXECUTE) { const size_t NUM_TASKS = 10; for (size_t i = 0; i < NUM_TASKS; ++i) { empty_table_.Put(task1_); @@ -276,7 +276,7 @@ TEST_F(TaskTableBaseTest, pick_to_execute) { ASSERT_EQ(indexes[0], 2); } -TEST_F(TaskTableBaseTest, pick_to_execute_limit) { +TEST_F(TaskTableBaseTest, PICK_TO_EXECUTE_LIMIT) { const size_t NUM_TASKS = 10; for (size_t i = 0; i < NUM_TASKS; ++i) { empty_table_.Put(task1_); @@ -292,7 +292,7 @@ TEST_F(TaskTableBaseTest, pick_to_execute_limit) { ASSERT_EQ(indexes[1], 3); } -TEST_F(TaskTableBaseTest, pick_to_execute_cache) { +TEST_F(TaskTableBaseTest, PICK_TO_EXECUTE_CACHE) { const size_t NUM_TASKS = 10; for (size_t i = 0; i < NUM_TASKS; ++i) { empty_table_.Put(task1_); @@ -340,7 +340,7 @@ protected: TaskTable table1_; }; -TEST_F(TaskTableAdvanceTest, load) { +TEST_F(TaskTableAdvanceTest, LOAD) { std::vector before_state; for (auto &task : table1_) { before_state.push_back(task->state); @@ -359,7 +359,7 @@ TEST_F(TaskTableAdvanceTest, load) { } } -TEST_F(TaskTableAdvanceTest, loaded) { +TEST_F(TaskTableAdvanceTest, LOADED) { std::vector before_state; for (auto &task : table1_) { before_state.push_back(task->state); @@ -378,7 +378,7 @@ TEST_F(TaskTableAdvanceTest, loaded) { } } -TEST_F(TaskTableAdvanceTest, execute) { +TEST_F(TaskTableAdvanceTest, EXECUTE) { std::vector before_state; for (auto &task : table1_) { before_state.push_back(task->state); @@ -397,7 +397,7 @@ TEST_F(TaskTableAdvanceTest, execute) { } } -TEST_F(TaskTableAdvanceTest, executed) { +TEST_F(TaskTableAdvanceTest, EXECUTED) { std::vector before_state; for (auto &task : table1_) { before_state.push_back(task->state); @@ -416,7 +416,7 @@ TEST_F(TaskTableAdvanceTest, executed) { } } -TEST_F(TaskTableAdvanceTest, move) { +TEST_F(TaskTableAdvanceTest, MOVE) { std::vector before_state; for (auto &task : table1_) { before_state.push_back(task->state); @@ -435,7 +435,7 @@ TEST_F(TaskTableAdvanceTest, move) { } } -TEST_F(TaskTableAdvanceTest, moved) { +TEST_F(TaskTableAdvanceTest, MOVED) { std::vector before_state; for (auto &task : table1_) { before_state.push_back(task->state); diff --git a/cpp/unittest/server/appendix/server_config.yaml b/cpp/unittest/server/appendix/server_config.yaml index b0095b8d3766c547dcf6744857065bafd8a5ab07..1a3dca9d97776567c8289ae675336a6ac77e8613 100644 --- a/cpp/unittest/server/appendix/server_config.yaml +++ b/cpp/unittest/server/appendix/server_config.yaml @@ -1,8 +1,8 @@ server_config: address: 0.0.0.0 # milvus server ip address (IPv4) port: 19530 # the port milvus listen to, default: 19530, range: 1025 ~ 65534 - gpu_index: 0 # the gpu milvus use, default: 0, range: 0 ~ gpu number - 1 mode: single # milvus deployment type: single, cluster, read_only + time_zone: UTC+8 # Use the UTC-x or UTC+x to specify a time zone. eg. UTC+8 for China Standard Time db_config: db_path: /tmp/milvus # milvus data storage path @@ -17,6 +17,7 @@ db_config: archive_days_threshold: 0 # files older than x days will be archived, 0 means no limit, unit: day insert_buffer_size: 4 # maximum insert buffer size allowed, default: 4, unit: GB, should be at least 1 GB. # the sum of insert_buffer_size and cpu_cache_capacity should be less than total memory, unit: GB + build_index_gpu: 0 # which gpu is used to build index, default: 0, range: 0 ~ gpu number - 1 metric_config: is_startup: off # if monitoring start: on, off @@ -32,8 +33,6 @@ cache_config: insert_cache_immediately: false # insert data will be load into cache immediately for hot query gpu_cache_capacity: 5 # how many memory are used as cache in gpu, unit: GB, RANGE: 0 ~ less than total memory gpu_cache_free_percent: 0.85 # old data will be erased from cache when cache is full, this value specify how much memory should be kept, range: greater than zero ~ 1.0 - gpu_ids: # gpu id - - 0 engine_config: use_blas_threshold: 20 diff --git a/cpp/unittest/server/cache_test.cpp b/cpp/unittest/server/cache_test.cpp index d9a0dc410b555314c2ac8c850d2286579e47738e..501d3f486f3f7c556cdc9e37ea3dc3c1511bcdaa 100644 --- a/cpp/unittest/server/cache_test.cpp +++ b/cpp/unittest/server/cache_test.cpp @@ -166,9 +166,6 @@ TEST(CacheTest, CPU_CACHE_TEST) { } TEST(CacheTest, GPU_CACHE_TEST) { - server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); - config.AddSequenceItem(server::CONFIG_GPU_IDS, "0"); - cache::CacheMgr* gpu_mgr = cache::GpuCacheMgr::GetInstance(0); const int dim = 256; diff --git a/cpp/unittest/server/config_test.cpp b/cpp/unittest/server/config_test.cpp index d512cd82bc7c5a9e9a8aae81d2e644e14f03149f..ddfca182f5a72ca0b43f81c27b77870a4f0ef904 100644 --- a/cpp/unittest/server/config_test.cpp +++ b/cpp/unittest/server/config_test.cpp @@ -144,8 +144,4 @@ TEST(ConfigTest, SERVER_CONFIG_TEST) { db_config.SetValue(server::CONFIG_DB_INSERT_BUFFER_SIZE, std::to_string(insert_buffer_size)); err = config.ValidateConfig(); ASSERT_NE(err, SERVER_SUCCESS); - - server_config.SetValue(server::CONFIG_GPU_INDEX, "9999"); - err = config.ValidateConfig(); - ASSERT_NE(err, SERVER_SUCCESS); } \ No newline at end of file