Commit 63bc58d5 authored by groot's avatar groot
Browse files

remove unused files of wrapper test


Former-commit-id: 48eb93ccb9ca5076d4ae5e7a2d4938635258c85a
parent 273cd5f3
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -41,11 +41,3 @@ target_link_libraries(test_wrapper
        ${unittest_libs})

install(TARGETS test_wrapper DESTINATION unittest)

configure_file(appendix/server_config.yaml
        "${CMAKE_CURRENT_BINARY_DIR}/milvus/conf/server_config.yaml"
        COPYONLY)

configure_file(appendix/log_config.conf
        "${CMAKE_CURRENT_BINARY_DIR}/milvus/conf/log_config.conf"
        COPYONLY)
 No newline at end of file
+0 −27
Original line number Diff line number Diff line
* GLOBAL:
    FORMAT                  =   "%datetime | %level | %logger | %msg"
    FILENAME                =   "/tmp/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-global.log"
    ENABLED                 =   true
    TO_FILE                 =   true
    TO_STANDARD_OUTPUT      =   false
    SUBSECOND_PRECISION     =   3
    PERFORMANCE_TRACKING    =   false
    MAX_LOG_FILE_SIZE       =   209715200 ## Throw log files away after 200MB
* DEBUG:
    FILENAME                =   "/tmp/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-debug.log"
    ENABLED                 =   true
* WARNING:
    FILENAME                =   "/tmp/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-warning.log"
* TRACE:
    FILENAME                =   "/tmp/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-trace.log"
* VERBOSE:
    FORMAT                  =   "%datetime{%d/%M/%y} | %level-%vlevel | %msg"
    TO_FILE                 =   false
    TO_STANDARD_OUTPUT      =   false
## Error logs
* ERROR:
    ENABLED                 =   true
    FILENAME                =   "/tmp/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-error.log"
* FATAL:
    ENABLED                 =   true
    FILENAME                =   "/tmp/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-fatal.log"
+0 −37
Original line number Diff line number Diff line
# All the following configurations are default values.

server_config:
  address: 0.0.0.0                  # milvus server ip address (IPv4)
  port: 19530                       # port range: 1025 ~ 65534
  deploy_mode: single               # deployment type: single, cluster_readonly, cluster_writable
  time_zone: UTC+8

db_config:
  primary_path: /tmp/milvus    # path used to store data and meta
  secondary_path:                   # path used to store data only, split by semicolon

  backend_url: sqlite://:@:/        # URI format: dialect://username:password@host:port/database
                                    # Keep 'dialect://:@:/', and replace other texts with real values.
                                    # Replace 'dialect' with 'mysql' or 'sqlite'

  insert_buffer_size: 4             # GB, maximum insert buffer size allowed
  build_index_gpu: 0                # gpu id used for building index

metric_config:
  enable_monitor: false             # enable monitoring or not
  collector: prometheus             # prometheus
  prometheus_config:
    port: 8080                      # port prometheus used to fetch metrics

cache_config:
  cpu_mem_capacity: 16              # GB, CPU memory used for cache
  cpu_mem_threshold: 0.85           # percentage of data kept when cache cleanup triggered
  cache_insert_data: false          # whether load inserted data into cache

engine_config:
  blas_threshold: 20

resource_config:
  resource_pool:
    - cpu
    - gpu0
+6 −10
Original line number Diff line number Diff line
@@ -16,20 +16,16 @@
// under the License.

#include "wrapper/KnowhereResource.h"
#include "wrapper/utils.h"
#include "server/Config.h"

#include <gtest/gtest.h>

namespace {

static const char* CONFIG_FILE_PATH = "./milvus/conf/server_config.yaml";
static const char* LOG_FILE_PATH = "./milvus/conf/log_config.conf";

} // namespace

TEST(KnowhereTest, KNOWHERE_RESOURCE_TEST) {
TEST_F(KnowhereTest, KNOWHERE_RESOURCE_TEST) {
    std::string config_path(CONFIG_PATH);
    config_path += CONFIG_FILE;
    milvus::server::Config& config = milvus::server::Config::GetInstance();
    milvus::Status s = config.LoadConfigFile(CONFIG_FILE_PATH);
    milvus::Status s = config.LoadConfigFile(config_path);
    ASSERT_TRUE(s.ok());

    milvus::engine::KnowhereResource::Initialize();
+95 −30
Original line number Diff line number Diff line
@@ -18,8 +18,73 @@

#include <gtest/gtest.h>
#include <faiss/IndexFlat.h>
#include <string>

#include "wrapper/utils.h"
#include "utils/CommonUtil.h"

namespace {
static const char
    * CONFIG_STR = "# All the following configurations are default values.\n"
                   "\n"
                   "server_config:\n"
                   "  address: 0.0.0.0                  # milvus server ip address (IPv4)\n"
                   "  port: 19530                       # port range: 1025 ~ 65534\n"
                   "  deploy_mode: single               \n"
                   "  time_zone: UTC+8\n"
                   "\n"
                   "db_config:\n"
                   "  primary_path: /tmp/milvus    # path used to store data and meta\n"
                   "  secondary_path:                   # path used to store data only, split by semicolon\n"
                   "\n"
                   "  backend_url: sqlite://:@:/        # URI format: dialect://username:password@host:port/database\n"
                   "                                    \n"
                   "                                    # Replace 'dialect' with 'mysql' or 'sqlite'\n"
                   "\n"
                   "  insert_buffer_size: 4             # GB, maximum insert buffer size allowed\n"
                   "\n"
                   "metric_config:\n"
                   "  enable_monitor: false             # enable monitoring or not\n"
                   "  collector: prometheus             # prometheus\n"
                   "  prometheus_config:\n"
                   "    port: 8080                      # port prometheus used to fetch metrics\n"
                   "\n"
                   "cache_config:\n"
                   "  cpu_mem_capacity: 16              # GB, CPU memory used for cache\n"
                   "  cpu_mem_threshold: 0.85           # percentage of data kept when cache cleanup triggered\n"
                   "  cache_insert_data: false          # whether load inserted data into cache\n"
                   "\n"
                   "engine_config:\n"
                   "  blas_threshold: 20\n"
                   "\n"
                   "resource_config:\n"
                   "  resource_pool:\n"
                   "    - gpu0\n"
                   "  index_build_device: gpu0          # GPU used for building index";

void
WriteToFile(const std::string& file_path, const char* content) {
    std::fstream fs(file_path.c_str(), std::ios_base::out);

    //write data to file
    fs << content;
    fs.close();
}

} // namespace

void
KnowhereTest::SetUp() {
    std::string config_path(CONFIG_PATH);
    milvus::server::CommonUtil::CreateDirectory(config_path);
    WriteToFile(config_path + CONFIG_FILE, CONFIG_STR);
}

void
KnowhereTest::TearDown() {
    std::string config_path(CONFIG_PATH);
    milvus::server::CommonUtil::DeleteDirectory(config_path);
}

void
DataGenBase::GenData(const int& dim, const int& nb, const int& nq,
Loading