Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
d46264fa
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看板
提交
d46264fa
编写于
4月 23, 2020
作者:
D
Dong Daxiang
提交者:
GitHub
4月 23, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #472 from barrierye/add-monitor-ut
add UT for monitor(ftp&general type)
上级
e7b6be6b
db76251e
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
252 addition
and
0 deletion
+252
-0
tools/serving_build.sh
tools/serving_build.sh
+252
-0
未找到文件。
tools/serving_build.sh
浏览文件 @
d46264fa
...
@@ -323,6 +323,9 @@ function python_test_bert() {
...
@@ -323,6 +323,9 @@ function python_test_bert() {
echo
"bert RPC inference pass"
echo
"bert RPC inference pass"
;;
;;
*
)
*
)
echo
"error type"
exit
1
;;
esac
esac
echo
"test bert
$TYPE
finished as expected."
echo
"test bert
$TYPE
finished as expected."
unset
SERVING_BIN
unset
SERVING_BIN
...
@@ -357,6 +360,9 @@ function python_test_imdb() {
...
@@ -357,6 +360,9 @@ function python_test_imdb() {
echo
"imdb ignore GPU test"
echo
"imdb ignore GPU test"
;;
;;
*
)
*
)
echo
"error type"
exit
1
;;
esac
esac
echo
"test imdb
$TYPE
finished as expected."
echo
"test imdb
$TYPE
finished as expected."
unset
SERVING_BIN
unset
SERVING_BIN
...
@@ -389,6 +395,9 @@ function python_test_lac() {
...
@@ -389,6 +395,9 @@ function python_test_lac() {
echo
"lac ignore GPU test"
echo
"lac ignore GPU test"
;;
;;
*
)
*
)
echo
"error type"
exit
1
;;
esac
esac
echo
"test lac
$TYPE
finished as expected."
echo
"test lac
$TYPE
finished as expected."
unset
SERVING_BIN
unset
SERVING_BIN
...
@@ -408,6 +417,248 @@ function python_run_test() {
...
@@ -408,6 +417,248 @@ function python_run_test() {
cd
../..
# pwd: /Serving
cd
../..
# pwd: /Serving
}
}
function
monitor_test
()
{
local
TYPE
=
$1
# pwd: /Serving
mkdir
_monitor_test
&&
cd
_monitor_test
# pwd: /Serving/_monitor_test
case
$TYPE
in
CPU
)
:
pip
install
pyftpdlib
mkdir
remote_path
mkdir
local_path
cd
remote_path
# pwd: /Serving/_monitor_test/remote_path
check_cmd
"python -m pyftpdlib -p 8000 &>/dev/null &"
cd
..
# pwd: /Serving/_monitor_test
# type: ftp
# remote_path: /
# remote_model_name: uci_housing.tar.gz
# local_tmp_path: ___tmp
# local_path: local_path
cd
remote_path
# pwd: /Serving/_monitor_test/remote_path
wget
--no-check-certificate
https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
touch
donefile
cd
..
# pwd: /Serving/_monitor_test
mkdir
-p
local_path/uci_housing_model
python
-m
paddle_serving_server.monitor
\
--type
=
'ftp'
--ftp_host
=
'127.0.0.1'
--ftp_port
=
'8000'
\
--remote_path
=
'/'
--remote_model_name
=
'uci_housing.tar.gz'
\
--remote_donefile_name
=
'donefile'
--local_path
=
'local_path'
\
--local_model_name
=
'uci_housing_model'
--local_timestamp_file
=
'fluid_time_file'
\
--local_tmp_path
=
'___tmp'
--unpacked_filename
=
'uci_housing_model'
\
--interval
=
'1'
>
/dev/null &
sleep
10
if
[
!
-f
"local_path/uci_housing_model/fluid_time_file"
]
;
then
echo
"local_path/uci_housing_model/fluid_time_file not exist."
exit
1
fi
ps
-ef
|
grep
"monitor"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
rm
-rf
remote_path/
*
rm
-rf
local_path/
*
# type: ftp
# remote_path: /tmp_dir
# remote_model_name: uci_housing_model
# local_tmp_path: ___tmp
# local_path: local_path
mkdir
-p
remote_path/tmp_dir
&&
cd
remote_path/tmp_dir
# pwd: /Serving/_monitor_test/remote_path/tmp_dir
wget
--no-check-certificate
https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
tar
-xzf
uci_housing.tar.gz
touch
donefile
cd
../..
# pwd: /Serving/_monitor_test
mkdir
-p
local_path/uci_housing_model
python
-m
paddle_serving_server.monitor
\
--type
=
'ftp'
--ftp_host
=
'127.0.0.1'
--ftp_port
=
'8000'
\
--remote_path
=
'/tmp_dir'
--remote_model_name
=
'uci_housing_model'
\
--remote_donefile_name
=
'donefile'
--local_path
=
'local_path'
\
--local_model_name
=
'uci_housing_model'
--local_timestamp_file
=
'fluid_time_file'
\
--local_tmp_path
=
'___tmp'
--interval
=
'1'
>
/dev/null &
sleep
10
if
[
!
-f
"local_path/uci_housing_model/fluid_time_file"
]
;
then
echo
"local_path/uci_housing_model/fluid_time_file not exist."
exit
1
fi
ps
-ef
|
grep
"monitor"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
rm
-rf
remote_path/
*
rm
-rf
local_path/
*
# type: general
# remote_path: /
# remote_model_name: uci_housing.tar.gz
# local_tmp_path: ___tmp
# local_path: local_path
cd
remote_path
# pwd: /Serving/_monitor_test/remote_path
wget
--no-check-certificate
https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
touch
donefile
cd
..
# pwd: /Serving/_monitor_test
mkdir
-p
local_path/uci_housing_model
python
-m
paddle_serving_server.monitor
\
--type
=
'general'
--general_host
=
'ftp://127.0.0.1:8000'
\
--remote_path
=
'/'
--remote_model_name
=
'uci_housing.tar.gz'
\
--remote_donefile_name
=
'donefile'
--local_path
=
'local_path'
\
--local_model_name
=
'uci_housing_model'
--local_timestamp_file
=
'fluid_time_file'
\
--local_tmp_path
=
'___tmp'
--unpacked_filename
=
'uci_housing_model'
\
--interval
=
'1'
>
/dev/null &
sleep
10
if
[
!
-f
"local_path/uci_housing_model/fluid_time_file"
]
;
then
echo
"local_path/uci_housing_model/fluid_time_file not exist."
exit
1
fi
ps
-ef
|
grep
"monitor"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
rm
-rf
remote_path/
*
rm
-rf
local_path/
*
# type: general
# remote_path: /tmp_dir
# remote_model_name: uci_housing_model
# local_tmp_path: ___tmp
# local_path: local_path
mkdir
-p
remote_path/tmp_dir
&&
cd
remote_path/tmp_dir
# pwd: /Serving/_monitor_test/remote_path/tmp_dir
wget
--no-check-certificate
https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
tar
-xzf
uci_housing.tar.gz
touch
donefile
cd
../..
# pwd: /Serving/_monitor_test
mkdir
-p
local_path/uci_housing_model
python
-m
paddle_serving_server.monitor
\
--type
=
'general'
--general_host
=
'ftp://127.0.0.1:8000'
\
--remote_path
=
'/tmp_dir'
--remote_model_name
=
'uci_housing_model'
\
--remote_donefile_name
=
'donefile'
--local_path
=
'local_path'
\
--local_model_name
=
'uci_housing_model'
--local_timestamp_file
=
'fluid_time_file'
\
--local_tmp_path
=
'___tmp'
--interval
=
'1'
>
/dev/null &
sleep
10
if
[
!
-f
"local_path/uci_housing_model/fluid_time_file"
]
;
then
echo
"local_path/uci_housing_model/fluid_time_file not exist."
exit
1
fi
ps
-ef
|
grep
"monitor"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
rm
-rf
remote_path/
*
rm
-rf
local_path/
*
ps
-ef
|
grep
"pyftpdlib"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
;;
GPU
)
:
pip
install
pyftpdlib
mkdir
remote_path
mkdir
local_path
cd
remote_path
# pwd: /Serving/_monitor_test/remote_path
check_cmd
"python -m pyftpdlib -p 8000 &>/dev/null &"
cd
..
# pwd: /Serving/_monitor_test
# type: ftp
# remote_path: /
# remote_model_name: uci_housing.tar.gz
# local_tmp_path: ___tmp
# local_path: local_path
cd
remote_path
# pwd: /Serving/_monitor_test/remote_path
wget
--no-check-certificate
https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
touch
donefile
cd
..
# pwd: /Serving/_monitor_test
mkdir
-p
local_path/uci_housing_model
python
-m
paddle_serving_server_gpu.monitor
\
--type
=
'ftp'
--ftp_host
=
'127.0.0.1'
--ftp_port
=
'8000'
\
--remote_path
=
'/'
--remote_model_name
=
'uci_housing.tar.gz'
\
--remote_donefile_name
=
'donefile'
--local_path
=
'local_path'
\
--local_model_name
=
'uci_housing_model'
--local_timestamp_file
=
'fluid_time_file'
\
--local_tmp_path
=
'___tmp'
--unpacked_filename
=
'uci_housing_model'
\
--interval
=
'1'
>
/dev/null &
sleep
10
if
[
!
-f
"local_path/uci_housing_model/fluid_time_file"
]
;
then
echo
"local_path/uci_housing_model/fluid_time_file not exist."
exit
1
fi
ps
-ef
|
grep
"monitor"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
rm
-rf
remote_path/
*
rm
-rf
local_path/
*
# type: ftp
# remote_path: /tmp_dir
# remote_model_name: uci_housing_model
# local_tmp_path: ___tmp
# local_path: local_path
mkdir
-p
remote_path/tmp_dir
&&
cd
remote_path/tmp_dir
# pwd: /Serving/_monitor_test/remote_path/tmp_dir
wget
--no-check-certificate
https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
tar
-xzf
uci_housing.tar.gz
touch
donefile
cd
../..
# pwd: /Serving/_monitor_test
mkdir
-p
local_path/uci_housing_model
python
-m
paddle_serving_server_gpu.monitor
\
--type
=
'ftp'
--ftp_host
=
'127.0.0.1'
--ftp_port
=
'8000'
\
--remote_path
=
'/tmp_dir'
--remote_model_name
=
'uci_housing_model'
\
--remote_donefile_name
=
'donefile'
--local_path
=
'local_path'
\
--local_model_name
=
'uci_housing_model'
--local_timestamp_file
=
'fluid_time_file'
\
--local_tmp_path
=
'___tmp'
--interval
=
'1'
>
/dev/null &
sleep
10
if
[
!
-f
"local_path/uci_housing_model/fluid_time_file"
]
;
then
echo
"local_path/uci_housing_model/fluid_time_file not exist."
exit
1
fi
ps
-ef
|
grep
"monitor"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
rm
-rf
remote_path/
*
rm
-rf
local_path/
*
# type: general
# remote_path: /
# remote_model_name: uci_housing.tar.gz
# local_tmp_path: ___tmp
# local_path: local_path
cd
remote_path
# pwd: /Serving/_monitor_test/remote_path
wget
--no-check-certificate
https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
touch
donefile
cd
..
# pwd: /Serving/_monitor_test
mkdir
-p
local_path/uci_housing_model
python
-m
paddle_serving_server_gpu.monitor
\
--type
=
'general'
--general_host
=
'ftp://127.0.0.1:8000'
\
--remote_path
=
'/'
--remote_model_name
=
'uci_housing.tar.gz'
\
--remote_donefile_name
=
'donefile'
--local_path
=
'local_path'
\
--local_model_name
=
'uci_housing_model'
--local_timestamp_file
=
'fluid_time_file'
\
--local_tmp_path
=
'___tmp'
--unpacked_filename
=
'uci_housing_model'
\
--interval
=
'1'
>
/dev/null &
sleep
10
if
[
!
-f
"local_path/uci_housing_model/fluid_time_file"
]
;
then
echo
"local_path/uci_housing_model/fluid_time_file not exist."
exit
1
fi
ps
-ef
|
grep
"monitor"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
rm
-rf
remote_path/
*
rm
-rf
local_path/
*
# type: general
# remote_path: /tmp_dir
# remote_model_name: uci_housing_model
# local_tmp_path: ___tmp
# local_path: local_path
mkdir
-p
remote_path/tmp_dir
&&
cd
remote_path/tmp_dir
# pwd: /Serving/_monitor_test/remote_path/tmp_dir
wget
--no-check-certificate
https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
tar
-xzf
uci_housing.tar.gz
touch
donefile
cd
../..
# pwd: /Serving/_monitor_test
mkdir
-p
local_path/uci_housing_model
python
-m
paddle_serving_server_gpu.monitor
\
--type
=
'general'
--general_host
=
'ftp://127.0.0.1:8000'
\
--remote_path
=
'/tmp_dir'
--remote_model_name
=
'uci_housing_model'
\
--remote_donefile_name
=
'donefile'
--local_path
=
'local_path'
\
--local_model_name
=
'uci_housing_model'
--local_timestamp_file
=
'fluid_time_file'
\
--local_tmp_path
=
'___tmp'
--interval
=
'1'
>
/dev/null &
sleep
10
if
[
!
-f
"local_path/uci_housing_model/fluid_time_file"
]
;
then
echo
"local_path/uci_housing_model/fluid_time_file not exist."
exit
1
fi
ps
-ef
|
grep
"monitor"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
rm
-rf
remote_path/
*
rm
-rf
local_path/
*
ps
-ef
|
grep
"pyftpdlib"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
;;
*
)
echo
"error type"
exit
1
;;
esac
cd
..
# pwd: /Serving
rm
-rf
_monitor_test
echo
"test monitor
$TYPE
finished as expected."
}
function
main
()
{
function
main
()
{
local
TYPE
=
$1
# pwd: /
local
TYPE
=
$1
# pwd: /
init
# pwd: /Serving
init
# pwd: /Serving
...
@@ -415,6 +666,7 @@ function main() {
...
@@ -415,6 +666,7 @@ function main() {
build_server
$TYPE
# pwd: /Serving
build_server
$TYPE
# pwd: /Serving
build_app
$TYPE
# pwd: /Serving
build_app
$TYPE
# pwd: /Serving
python_run_test
$TYPE
# pwd: /Serving
python_run_test
$TYPE
# pwd: /Serving
monitor_test
$TYPE
# pwd: /Serving
echo
"serving
$TYPE
part finished as expected."
echo
"serving
$TYPE
part finished as expected."
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录