Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
3c686f5f
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
185
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3c686f5f
编写于
8月 31, 2020
作者:
W
wangjiawei04
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'root-develop' into update-pipeline-doc
上级
2f64f00a
64de7e38
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
13 addition
and
136 deletion
+13
-136
python/pipeline/__init__.py
python/pipeline/__init__.py
+6
-6
python/pipeline/pipeline_server.py
python/pipeline/pipeline_server.py
+1
-1
tools/serving_build.sh
tools/serving_build.sh
+6
-129
未找到文件。
python/pipeline/__init__.py
浏览文件 @
3c686f5f
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
logger
# this module must be the first to import
from
.
import
logger
# this module must be the first to import
from
operator
import
Op
,
RequestOp
,
ResponseOp
from
.
operator
import
Op
,
RequestOp
,
ResponseOp
from
pipeline_server
import
PipelineServer
from
.
pipeline_server
import
PipelineServer
from
pipeline_client
import
PipelineClient
from
.
pipeline_client
import
PipelineClient
from
local_rpc_service_handler
import
LocalRpcServiceHandler
from
.
local_rpc_service_handler
import
LocalRpcServiceHandler
from
analyse
import
Analyst
from
.
analyse
import
Analyst
python/pipeline/pipeline_server.py
浏览文件 @
3c686f5f
...
@@ -181,7 +181,7 @@ class PipelineServer(object):
...
@@ -181,7 +181,7 @@ class PipelineServer(object):
def
_start_local_rpc_service
(
self
):
def
_start_local_rpc_service
(
self
):
# only brpc now
# only brpc now
if
self
.
_conf
[
"dag"
][
"client_type"
]
!=
"brpc"
:
if
self
.
_conf
[
"dag"
][
"client_type"
]
!=
"brpc"
:
raise
ValueError
(
"Local service version must be brpc type now."
)
_LOGGER
.
warning
(
"Local service version must be brpc type now."
)
for
op
in
self
.
_used_op
:
for
op
in
self
.
_used_op
:
if
not
isinstance
(
op
,
operator
.
RequestOp
):
if
not
isinstance
(
op
,
operator
.
RequestOp
):
op
.
launch_local_rpc_service
()
op
.
launch_local_rpc_service
()
...
...
tools/serving_build.sh
浏览文件 @
3c686f5f
...
@@ -879,9 +879,9 @@ EOF
...
@@ -879,9 +879,9 @@ EOF
sh get_data.sh
sh get_data.sh
python web_service.py
>
/dev/null &
python web_service.py
>
/dev/null &
sleep
5
sleep
5
curl
-X
POST
-k
http://localhost:18080/prediction
-d
'{"key": ["x"], "value": ["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"]}'
curl
-X
POST
-k
http://localhost:18080/
uci/
prediction
-d
'{"key": ["x"], "value": ["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"]}'
check http code
check http code
http_code
=
`
curl
-X
POST
-k
-d
'{"key":["x"], "value": ["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"]}'
-s
-w
"%{http_code}"
-o
/dev/null http://localhost:18080/prediction
`
http_code
=
`
curl
-X
POST
-k
-d
'{"key":["x"], "value": ["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"]}'
-s
-w
"%{http_code}"
-o
/dev/null http://localhost:18080/
uci/
prediction
`
if
[
${
http_code
}
-ne
200
]
;
then
if
[
${
http_code
}
-ne
200
]
;
then
echo
"HTTP status code -ne 200"
echo
"HTTP status code -ne 200"
exit
1
exit
1
...
@@ -896,22 +896,9 @@ EOF
...
@@ -896,22 +896,9 @@ EOF
sh get_data.sh
sh get_data.sh
python web_service.py
>
/dev/null &
python web_service.py
>
/dev/null &
sleep
5
sleep
5
curl
-X
POST
-k
http://localhost:18080/prediction
-d
'{"key": ["x"], "value": ["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"]}'
curl
-X
POST
-k
http://localhost:18080/
uci/
prediction
-d
'{"key": ["x"], "value": ["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"]}'
# check http code
# check http code
http_code
=
`
curl
-X
POST
-k
-d
'{"key":["x"], "value": ["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"]}'
-s
-w
"%{http_code}"
-o
/dev/null http://localhost:18080/prediction
`
http_code
=
`
curl
-X
POST
-k
-d
'{"key":["x"], "value": ["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"]}'
-s
-w
"%{http_code}"
-o
/dev/null http://localhost:18080/uci/prediction
`
if
[
${
http_code
}
-ne
200
]
;
then
echo
"HTTP status code -ne 200"
exit
1
fi
ps
-ef
|
grep
"web_service"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
ps
-ef
|
grep
"pipeline"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
kill_server_process
python local_pipeline_server.py
>
/dev/null &
sleep
5
curl
-X
POST
-k
http://localhost:18080/prediction
-d
'{"key": ["x"], "value": ["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"]}'
# check http code
http_code
=
`
curl
-X
POST
-k
-d
'{"key":["x"], "value": ["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"]}'
-s
-w
"%{http_code}"
-o
/dev/null http://localhost:18080/prediction
`
if
[
${
http_code
}
-ne
200
]
;
then
if
[
${
http_code
}
-ne
200
]
;
then
echo
"HTTP status code -ne 200"
echo
"HTTP status code -ne 200"
exit
1
exit
1
...
@@ -976,118 +963,8 @@ function monitor_test() {
...
@@ -976,118 +963,8 @@ function monitor_test() {
mkdir
_monitor_test
&&
cd
_monitor_test
# pwd: /Serving/_monitor_test
mkdir
_monitor_test
&&
cd
_monitor_test
# pwd: /Serving/_monitor_test
case
$TYPE
in
case
$TYPE
in
CPU
)
:
CPU
)
:
pip
install
pyftpdlib
# The CPU part and GPU part are identical.
mkdir
remote_path
# In order to avoid Travis CI timeout (50 min), the CPU version is not checked
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
)
:
GPU
)
:
pip
install
pyftpdlib
pip
install
pyftpdlib
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录