Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_35024513
milvus
提交
2aad94b6
milvus
项目概览
qq_35024513
/
milvus
与 Fork 源项目一致
Fork自
milvus / milvus
通知
14
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2aad94b6
编写于
11月 28, 2019
作者:
Y
yudong.cai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#560 add version in server config file
上级
7e394a26
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
48 addition
and
3 deletion
+48
-3
CHANGELOG.md
CHANGELOG.md
+1
-0
core/conf/server_cpu_config.template
core/conf/server_cpu_config.template
+2
-0
core/conf/server_gpu_config.template
core/conf/server_gpu_config.template
+2
-0
core/src/server/Config.cpp
core/src/server/Config.cpp
+32
-3
core/src/server/Config.h
core/src/server/Config.h
+9
-0
core/unittest/server/utils.cpp
core/unittest/server/utils.cpp
+2
-0
未找到文件。
CHANGELOG.md
浏览文件 @
2aad94b6
...
...
@@ -44,6 +44,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
\#
420 - Update shards merge part to match v0.5.3
-
\#
488 - Add log in scheduler/optimizer
-
\#
502 - C++ SDK support IVFPQ and SPTAG
-
\#
560 - Add version in server config file
## Improvement
-
\#
255 - Add ivfsq8 test report detailed version
...
...
core/conf/server_cpu_config.template
浏览文件 @
2aad94b6
# Default values are used when you make no changes to the following parameters.
version: 0.1 # config version
server_config:
address: 0.0.0.0 # milvus server ip address (IPv4)
port: 19530 # milvus server port, must in range [1025, 65534]
...
...
core/conf/server_gpu_config.template
浏览文件 @
2aad94b6
# Default values are used when you make no changes to the following parameters.
version: 0.1 # config version
server_config:
address: 0.0.0.0 # milvus server ip address (IPv4)
port: 19530 # milvus server port, must in range [1025, 65534]
...
...
core/src/server/Config.cpp
浏览文件 @
2aad94b6
...
...
@@ -20,6 +20,7 @@
#include <iostream>
#include <regex>
#include <string>
#include <unordered_map>
#include <vector>
#include "config/YamlConfigMgr.h"
...
...
@@ -33,6 +34,8 @@ namespace server {
constexpr
uint64_t
GB
=
1UL
<<
30
;
static
const
std
::
unordered_map
<
std
::
string
,
std
::
string
>
milvus_config_version_map
({{
"0.6.0"
,
"0.1"
}});
Config
&
Config
::
GetInstance
()
{
static
Config
config_inst
;
...
...
@@ -69,6 +72,12 @@ Status
Config
::
ValidateConfig
()
{
Status
s
;
std
::
string
config_version
;
s
=
GetConfigVersion
(
config_version
);
if
(
!
s
.
ok
())
{
return
s
;
}
/* server config */
std
::
string
server_addr
;
s
=
GetServerConfigAddress
(
server_addr
);
...
...
@@ -383,6 +392,16 @@ Config::PrintAll() {
}
////////////////////////////////////////////////////////////////////////////////
Status
Config
::
CheckConfigVersion
(
const
std
::
string
&
value
)
{
if
(
milvus_config_version_map
.
at
(
MILVUS_VERSION
)
!=
value
)
{
std
::
string
msg
=
"Invalid config version: "
+
value
+
". Expected config version: "
+
milvus_config_version_map
.
at
(
MILVUS_VERSION
);
return
Status
(
SERVER_INVALID_ARGUMENT
,
msg
);
}
return
Status
::
OK
();
}
Status
Config
::
CheckServerConfigAddress
(
const
std
::
string
&
value
)
{
if
(
!
ValidationUtil
::
ValidateIpAddress
(
value
).
ok
())
{
...
...
@@ -766,10 +785,14 @@ Config::CheckGpuResourceConfigBuildIndexResources(const std::vector<std::string>
////////////////////////////////////////////////////////////////////////////////
ConfigNode
&
Config
::
GetConfig
Node
(
const
std
::
string
&
name
)
{
Config
::
GetConfig
Root
(
)
{
ConfigMgr
*
mgr
=
YamlConfigMgr
::
GetInstance
();
ConfigNode
&
root_node
=
mgr
->
GetRootNode
();
return
root_node
.
GetChild
(
name
);
return
mgr
->
GetRootNode
();
}
ConfigNode
&
Config
::
GetConfigNode
(
const
std
::
string
&
name
)
{
return
GetConfigRoot
().
GetChild
(
name
);
}
Status
...
...
@@ -816,6 +839,12 @@ Config::GetConfigSequenceStr(const std::string& parent_key, const std::string& c
return
value
;
}
Status
Config
::
GetConfigVersion
(
std
::
string
&
value
)
{
value
=
GetConfigRoot
().
GetValue
(
CONFIG_VERSION
);
return
CheckConfigVersion
(
value
);
}
Status
Config
::
GetServerConfigAddress
(
std
::
string
&
value
)
{
value
=
GetConfigStr
(
CONFIG_SERVER
,
CONFIG_SERVER_ADDRESS
,
CONFIG_SERVER_ADDRESS_DEFAULT
);
...
...
core/src/server/Config.h
浏览文件 @
2aad94b6
...
...
@@ -28,6 +28,8 @@
namespace
milvus
{
namespace
server
{
static
const
char
*
CONFIG_VERSION
=
"version"
;
/* server config */
static
const
char
*
CONFIG_SERVER
=
"server_config"
;
static
const
char
*
CONFIG_SERVER_ADDRESS
=
"address"
;
...
...
@@ -115,6 +117,8 @@ class Config {
PrintAll
();
private:
ConfigNode
&
GetConfigRoot
();
ConfigNode
&
GetConfigNode
(
const
std
::
string
&
name
);
Status
...
...
@@ -125,6 +129,9 @@ class Config {
PrintConfigSection
(
const
std
::
string
&
config_node_name
);
///////////////////////////////////////////////////////////////////////////
Status
CheckConfigVersion
(
const
std
::
string
&
value
);
/* server config */
Status
CheckServerConfigAddress
(
const
std
::
string
&
value
);
...
...
@@ -193,6 +200,8 @@ class Config {
std
::
string
GetConfigSequenceStr
(
const
std
::
string
&
parent_key
,
const
std
::
string
&
child_key
,
const
std
::
string
&
delim
=
","
,
const
std
::
string
&
default_value
=
""
);
Status
GetConfigVersion
(
std
::
string
&
value
);
public:
/* server config */
...
...
core/unittest/server/utils.cpp
浏览文件 @
2aad94b6
...
...
@@ -28,6 +28,8 @@ namespace {
static
const
char
*
VALID_CONFIG_STR
=
"# Default values are used when you make no changes to the following parameters.
\n
"
"
\n
"
"version: 0.1"
"
\n
"
"server_config:
\n
"
" address: 0.0.0.0 # milvus server ip address (IPv4)
\n
"
" port: 19530 # port range: 1025 ~ 65534
\n
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录