Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
cb794e63
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
cb794e63
编写于
9月 09, 2019
作者:
J
Jiawei Wang
提交者:
GitHub
9月 09, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #71 from Badangel/cube-builder
Check some conf and add some log
上级
de49fe4d
de66f804
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
14 deletion
+36
-14
cube/cube-transfer/src/cube-transfer.go
cube/cube-transfer/src/cube-transfer.go
+36
-14
未找到文件。
cube/cube-transfer/src/cube-transfer.go
浏览文件 @
cb794e63
...
...
@@ -16,8 +16,8 @@ package main
import
(
"fmt"
"github.com/docopt/docopt-go"
"github.com/Badangel/logex"
"github.com/docopt/docopt-go"
"os"
"path/filepath"
"runtime"
...
...
@@ -64,6 +64,7 @@ Log options:
// settings:
if
opts
[
"-p"
]
==
nil
{
logex
.
Fatal
(
"ERROR: -p PORT must be set!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: -p PORT must be set!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -72,6 +73,7 @@ Log options:
logex
.
Notice
(
">>> port:"
,
transfer
.
Port
)
if
opts
[
"--config"
]
==
nil
{
logex
.
Fatal
(
"ERROR: --config config_file must be set!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: --config config_file must be set!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -81,6 +83,7 @@ Log options:
configMgr
.
Init
(
opts
[
"--config"
]
.
(
string
))
transfer
.
Dict
.
DictName
=
configMgr
.
Read
(
"default"
,
"dict_name"
)
if
transfer
.
Dict
.
DictName
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] DictName in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] DictName in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -89,6 +92,7 @@ Log options:
transfer
.
Dict
.
DictMode
=
configMgr
.
Read
(
"default"
,
"mode"
)
if
transfer
.
Dict
.
DictMode
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] DictMode in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] DictMode in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -97,28 +101,31 @@ Log options:
transfer
.
Dict
.
DownloadMode
=
configMgr
.
Read
(
"default"
,
"download_mode"
)
if
transfer
.
Dict
.
DownloadMode
!=
"http"
&&
transfer
.
Dict
.
DownloadMode
!=
"ftp"
{
logex
.
Fatal
(
"ERROR: nead [default] download_mode in config_file! only support ftp or http"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] download_mode in config_file! only support ftp or http"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
}
logex
.
Notice
(
">>> DownloadMode:"
,
transfer
.
Dict
.
DownloadMode
)
transfer
.
Dict
.
WgetPort
=
configMgr
.
Read
(
"default"
,
"wget_port"
)
if
transfer
.
Dict
.
WgetPort
==
""
{
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] wget_port in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
}
var
wget_port
int
wget_port
,
err
=
strconv
.
Atoi
(
transfer
.
Dict
.
WgetPort
)
if
err
!=
nil
{
logex
.
Fatal
(
"wget_port form is not right need int"
)
os
.
Exit
(
1
)
}
logex
.
Notice
(
">>> WgetPort:"
,
wget_port
)
transfer
.
Dict
.
WgetPort
=
configMgr
.
Read
(
"default"
,
"wget_port"
)
if
transfer
.
Dict
.
WgetPort
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] wget_port in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] wget_port in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
}
var
wget_port
int
wget_port
,
err
=
strconv
.
Atoi
(
transfer
.
Dict
.
WgetPort
)
if
err
!=
nil
{
logex
.
Fatal
(
"wget_port form is not right need int"
)
os
.
Exit
(
1
)
}
logex
.
Notice
(
">>> WgetPort:"
,
wget_port
)
transfer
.
BuildToolLocal
=
configMgr
.
Read
(
"default"
,
"buildtool_local"
)
if
transfer
.
BuildToolLocal
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] BuildToolLocal in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] BuildToolLocal in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -127,6 +134,7 @@ Log options:
transfer
.
Dict
.
DonefileAddress
=
configMgr
.
Read
(
"default"
,
"donefile_address"
)
if
transfer
.
Dict
.
DonefileAddress
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] DonefileAddress in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] DonefileAddress in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -135,6 +143,7 @@ Log options:
transfer
.
Dict
.
OutputAddress
=
configMgr
.
Read
(
"default"
,
"output_address"
)
if
transfer
.
Dict
.
OutputAddress
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] OutputAddress in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] OutputAddress in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -143,6 +152,7 @@ Log options:
transfer
.
Dict
.
TmpAddress
=
configMgr
.
Read
(
"default"
,
"tmp_address"
)
if
transfer
.
Dict
.
TmpAddress
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] TmpAddress in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] TmpAddress in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -151,6 +161,7 @@ Log options:
ShardNumStr
:=
configMgr
.
Read
(
"default"
,
"shard_num"
)
if
ShardNumStr
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] ShardNum in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] ShardNum in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -164,6 +175,7 @@ Log options:
CopyNumStr
:=
configMgr
.
Read
(
"default"
,
"copy_num"
)
if
CopyNumStr
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] CopyNum in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] CopyNum in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -179,6 +191,7 @@ Log options:
transfer
.
Dict
.
DeployPath
=
configMgr
.
Read
(
"default"
,
"deploy_path"
)
if
transfer
.
Dict
.
DeployPath
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] DeployPath in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] DeployPath in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -187,6 +200,7 @@ Log options:
transfer
.
TransferAddr
=
configMgr
.
Read
(
"default"
,
"transfer_address"
)
if
transfer
.
TransferAddr
==
""
{
logex
.
Fatal
(
"ERROR: nead [default] TransferAddr in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"ERROR: nead [default] TransferAddr in config_file!"
)
fmt
.
Fprintln
(
os
.
Stderr
,
usage
)
os
.
Exit
(
1
)
...
...
@@ -199,9 +213,17 @@ Log options:
agentName
:=
fmt
.
Sprintf
(
"agent%d_%d"
,
i
,
j
)
agentInfo
:=
configMgr
.
Read
(
"cube_agent"
,
agentName
)
agentInfoSlice
:=
strings
.
Split
(
agentInfo
,
":"
)
if
len
(
agentInfoSlice
)
!=
2
{
logex
.
Fatal
(
"agent conf format not right! sample: ip:port"
)
os
.
Exit
(
1
)
}
cubeName
:=
fmt
.
Sprintf
(
"cube%d_%d"
,
i
,
j
)
cubeInfo
:=
configMgr
.
Read
(
"cube_agent"
,
cubeName
)
cubeInfoSlice
:=
strings
.
Split
(
cubeInfo
,
":"
)
if
len
(
cubeInfoSlice
)
!=
3
{
logex
.
Fatal
(
"cube conf format not right! sample: ip:port:deploy_path"
)
os
.
Exit
(
1
)
}
instance
.
DictName
=
transfer
.
Dict
.
DictName
instance
.
AgentIp
=
agentInfoSlice
[
0
]
instance
.
AgentPort
,
_
=
strconv
.
Atoi
(
agentInfoSlice
[
1
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录