Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
d33faaf6
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看板
提交
d33faaf6
编写于
3月 21, 2020
作者:
B
barrierye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
maybe the proxy is used on iPipe, which makes web-test failed && test=serving
上级
6a629432
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
2 deletion
+18
-2
tools/serving_build.sh
tools/serving_build.sh
+18
-2
未找到文件。
tools/serving_build.sh
浏览文件 @
d33faaf6
#!/usr/bin/env bash
function
unsetproxy
()
{
HTTP_PROXY_TEMP
=
$http_proxy
HTTPS_PROXY_TEMP
=
$https_proxy
unset
http_proxy
unset
https_proxy
}
function
setproxy
()
{
export
http_proxy
=
$HTTP_PROXY_TEMP
export
https_proxy
=
$HTTPS_PROXY_TEMP
}
function
init
()
{
source
/root/.bashrc
set
-v
...
...
@@ -90,16 +102,18 @@ function python_test_fit_a_line() {
kill_server_process
# test web
unsetproxy
# maybe the proxy is used on iPipe, which makes web-test failed.
check_cmd
"python -m paddle_serving_server.serve --model uci_housing_model --name uci --port 9393 --thread 4 --name uci > /dev/null &"
sleep
5
# wait for the server to start
check_cmd
"curl -H
\"
Content-Type:application/json
\"
-X POST -d '{
\"
x
\"
: [0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584, 0.6283, 0.4919, 0.1856, 0.0795, -0.0332],
\"
fetch
\"
:[
\"
price
\"
]}' http://127.0.0.1:9393/uci/prediction"
# check http code
http_code
=
`
curl
-H
"Content-Type:application/json"
-X
POST
-d
'{"x": [0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584, 0.6283, 0.4919, 0.1856, 0.0795, -0.0332], "fetch":["price"]}'
-s
-w
"%{http_code}"
-o
/dev/null http://127.0.0.1:9393/uci/prediction
`
setproxy
# recover proxy state
kill_server_process
if
[
${
http_code
}
-ne
200
]
;
then
echo
"HTTP status code -ne 200"
exit
1
fi
kill_server_process
;;
GPU
)
# test rpc
...
...
@@ -109,16 +123,18 @@ function python_test_fit_a_line() {
kill_server_process
# test web
unsetproxy
# maybe the proxy is used on iPipe, which makes web-test failed.
check_cmd
"python -m paddle_serving_server_gpu.serve --model uci_housing_model --port 9393 --thread 2 --gpu_ids 0 --name uci > /dev/null &"
sleep
5
# wait for the server to start
check_cmd
"curl -H
\"
Content-Type:application/json
\"
-X POST -d '{
\"
x
\"
: [0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584, 0.6283, 0.4919, 0.1856, 0.0795, -0.0332],
\"
fetch
\"
:[
\"
price
\"
]}' http://127.0.0.1:9393/uci/prediction"
# check http code
http_code
=
`
curl
-H
"Content-Type:application/json"
-X
POST
-d
'{"x": [0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584, 0.6283, 0.4919, 0.1856, 0.0795, -0.0332], "fetch":["price"]}'
-s
-w
"%{http_code}"
-o
/dev/null http://127.0.0.1:9393/uci/prediction
`
setproxy
# recover proxy state
kill_server_process
if
[
${
http_code
}
-ne
200
]
;
then
echo
"HTTP status code -ne 200"
exit
1
fi
kill_server_process
;;
*
)
echo
"error type"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录