Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
158aa799
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看板
提交
158aa799
编写于
10月 21, 2020
作者:
M
MRXLT
提交者:
GitHub
10月 21, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #855 from MRXLT/bug-fix
fix compile && setup
上级
eb630a80
9b694685
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
75 addition
and
34 deletion
+75
-34
core/cube/CMakeLists.txt
core/cube/CMakeLists.txt
+3
-2
doc/COMPILE.md
doc/COMPILE.md
+2
-0
doc/COMPILE_CN.md
doc/COMPILE_CN.md
+2
-0
python/pipeline/gateway/proxy_server.go
python/pipeline/gateway/proxy_server.go
+1
-1
python/setup.py.client.in
python/setup.py.client.in
+3
-14
python/setup.py.server.in
python/setup.py.server.in
+1
-1
python/setup.py.server_gpu.in
python/setup.py.server_gpu.in
+1
-1
python/util.py
python/util.py
+8
-4
tools/Dockerfile.centos6.cuda9.0-cudnn7.devel
tools/Dockerfile.centos6.cuda9.0-cudnn7.devel
+6
-0
tools/Dockerfile.centos6.devel
tools/Dockerfile.centos6.devel
+6
-0
tools/Dockerfile.ci
tools/Dockerfile.ci
+7
-0
tools/Dockerfile.cuda10.0-cudnn7.devel
tools/Dockerfile.cuda10.0-cudnn7.devel
+8
-1
tools/Dockerfile.cuda9.0-cudnn7.devel
tools/Dockerfile.cuda9.0-cudnn7.devel
+7
-0
tools/serving_build.sh
tools/serving_build.sh
+20
-10
未找到文件。
core/cube/CMakeLists.txt
浏览文件 @
158aa799
...
...
@@ -12,8 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License
#execute_process(COMMAND go env -w GO111MODULE=off)
add_subdirectory
(
cube-server
)
add_subdirectory
(
cube-api
)
add_subdirectory
(
cube-builder
)
add_subdirectory
(
cube-transfer
)
add_subdirectory
(
cube-agent
)
#
add_subdirectory(cube-transfer)
#
add_subdirectory(cube-agent)
doc/COMPILE.md
浏览文件 @
158aa799
...
...
@@ -75,6 +75,8 @@ export PATH=$PATH:$GOPATH/bin
## Get go packages
```
shell
go
env
-w
GO111MODULE
=
on
go
env
-w
GOPROXY
=
https://goproxy.cn,direct
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get
-u
github.com/golang/protobuf/protoc-gen-go
...
...
doc/COMPILE_CN.md
浏览文件 @
158aa799
...
...
@@ -72,6 +72,8 @@ export PATH=$PATH:$GOPATH/bin
## 获取 Go packages
```
shell
go
env
-w
GO111MODULE
=
on
go
env
-w
GOPROXY
=
https://goproxy.cn,direct
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get
-u
github.com/golang/protobuf/protoc-gen-go
...
...
python/pipeline/gateway/proxy_server.go
浏览文件 @
158aa799
...
...
@@ -25,7 +25,7 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"google.golang.org/grpc"
gw
"
.
/proto"
gw
"
serving-gateway
/proto"
)
//export run_proxy_server
...
...
python/setup.py.client.in
浏览文件 @
158aa799
...
...
@@ -28,19 +28,11 @@ import util
py_version = sys.version_info
def copy_lib():
if py_version[0] == 2:
lib_list = ['libpython2.7.so.1.0', 'libssl.so.10', 'libcrypto.so.10']
elif py_version[1] == 5:
lib_list = ['libpython3.5m.so.1.0', 'libssl.so.10', 'libcrypto.so.10']
elif py_version[1] == 6:
lib_list = ['libpython3.6m.so.1.0', 'libssl.so.10', 'libcrypto.so.10']
elif py_version[1] == 7:
lib_list = ['libpython3.7m.so.1.0', 'libssl.so.10', 'libcrypto.so.10']
os.popen('mkdir -p paddle_serving_client/lib')
lib_list = ['${OPENSSL_CRYPTO_LIBRARY}', '${OPENSSL_SSL_LIBRARY}',
'${PYTHON_LIBRARY}']
for lib in lib_list:
r = os.popen('which {}'.format(lib))
text = r.read()
os.popen('cp {} ./paddle_serving_client/lib'.format(text.strip()))
os.popen('cp {} ./paddle_serving_client/lib'.format(lib))
max_version, mid_version, min_version = util.python_version()
...
...
@@ -55,9 +47,6 @@ REQUIRED_PACKAGES = [
'grpcio-tools >= 1.28.1'
]
if not util.find_package("paddlepaddle") and not util.find_package("paddlepaddle-gpu"):
REQUIRED_PACKAGES.append("paddlepaddle")
packages=['paddle_serving_client',
'paddle_serving_client.proto',
...
...
python/setup.py.server.in
浏览文件 @
158aa799
...
...
@@ -29,7 +29,7 @@ util.gen_pipeline_code("paddle_serving_server")
REQUIRED_PACKAGES = [
'six >= 1.10.0', 'protobuf >= 3.11.0', 'grpcio >= 1.28.1', 'grpcio-tools >= 1.28.1',
'paddle_serving_client', 'flask >= 1.1.1', 'paddle_serving_app'
'paddle_serving_client', 'flask >= 1.1.1', 'paddle_serving_app'
, 'func_timeout', 'pyyaml'
]
packages=['paddle_serving_server',
...
...
python/setup.py.server_gpu.in
浏览文件 @
158aa799
...
...
@@ -29,7 +29,7 @@ util.gen_pipeline_code("paddle_serving_server_gpu")
REQUIRED_PACKAGES = [
'six >= 1.10.0', 'protobuf >= 3.11.0', 'grpcio >= 1.28.1', 'grpcio-tools >= 1.28.1',
'paddle_serving_client', 'flask >= 1.1.1', 'paddle_serving_app'
'paddle_serving_client', 'flask >= 1.1.1', 'paddle_serving_app'
, 'func_timeout', 'pyyaml'
]
packages=['paddle_serving_server_gpu',
...
...
python/util.py
浏览文件 @
158aa799
...
...
@@ -44,8 +44,8 @@ def gen_pipeline_code(package_name):
ret
=
os
.
system
(
"cd {}/pipeline/gateway/proto/ && "
"../../../../../third_party/install/protobuf/bin/protoc -I. "
"-I$GOPATH/
src
"
"-I$GOPATH/
src/github.com/grpc-ecosystem/grpc-gateway
/third_party/googleapis "
"-I$GOPATH/
pkg/mod
"
"-I$GOPATH/
pkg/mod/github.com/grpc-ecosystem/grpc-gateway\@v1.15.2
/third_party/googleapis "
"--go_out=plugins=grpc:. "
"gateway.proto"
.
format
(
package_name
))
if
ret
!=
0
:
...
...
@@ -54,14 +54,18 @@ def gen_pipeline_code(package_name):
ret
=
os
.
system
(
"cd {}/pipeline/gateway/proto/ && "
"../../../../../third_party/install/protobuf/bin/protoc -I. "
"-I$GOPATH/
src
"
"-I$GOPATH/
src/github.com/grpc-ecosystem/grpc-gateway
/third_party/googleapis "
"-I$GOPATH/
pkg/mod
"
"-I$GOPATH/
pkg/mod/github.com/grpc-ecosystem/grpc-gateway\@v1.15.2
/third_party/googleapis "
"--grpc-gateway_out=logtostderr=true:. "
"gateway.proto"
.
format
(
package_name
))
if
ret
!=
0
:
exit
(
1
)
# pipeline grpc-gateway shared-lib
ret
=
os
.
system
(
"cd {}/pipeline/gateway/ && go mod init serving-gateway"
.
format
(
package_name
))
ret
=
os
.
system
(
"cd {}/pipeline/gateway/ && go mod vendor && go mod tidy"
.
format
(
package_name
))
ret
=
os
.
system
(
"cd {}/pipeline/gateway && "
"go build -buildmode=c-shared -o libproxy_server.so proxy_server.go"
.
...
...
tools/Dockerfile.centos6.cuda9.0-cudnn7.devel
浏览文件 @
158aa799
...
...
@@ -41,6 +41,12 @@ RUN yum -y install wget && \
echo 'export LD_LIBRARY_PATH=/usr/local/python3.6/lib:$LD_LIBRARY_PATH' >> /root/.bashrc && \
source /root/.bashrc && \
cd .. && rm -rf Python-3.6.8* && \
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protobuf-all-3.11.2.tar.gz && \
tar zxf protobuf-all-3.11.2.tar.gz && \
cd protobuf-3.11.2 && \
./configure && make -j4 && make install && \
make clean && \
cd .. && rm -rf protobuf-* &&\
yum -y install epel-release && yum -y install patchelf libXext libSM libXrender && \
yum clean all && \
echo "export LANG=en_US.utf8" >> /root/.bashrc && \
...
...
tools/Dockerfile.centos6.devel
浏览文件 @
158aa799
...
...
@@ -41,6 +41,12 @@ RUN yum -y install wget && \
echo 'export LD_LIBRARY_PATH=/usr/local/python3.6/lib:$LD_LIBRARY_PATH' >> /root/.bashrc && \
source /root/.bashrc && \
cd .. && rm -rf Python-3.6.8* && \
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protobuf-all-3.11.2.tar.gz && \
tar zxf protobuf-all-3.11.2.tar.gz && \
cd protobuf-3.11.2 && \
./configure && make -j4 && make install && \
make clean && \
cd .. && rm -rf protobuf-* && \
yum -y install epel-release && yum -y install patchelf libXext libSM libXrender && \
yum clean all && \
localedef -c -i en_US -f UTF-8 en_US.UTF-8 && \
...
...
tools/Dockerfile.ci
浏览文件 @
158aa799
...
...
@@ -34,6 +34,13 @@ RUN wget http://nixos.org/releases/patchelf/patchelf-0.10/patchelf-0.10.tar.bz2
&& cd .. \
&& rm -rf patchelf-0.10*
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protobuf-all-3.11.2.tar.gz && \
tar zxf protobuf-all-3.11.2.tar.gz && \
cd protobuf-3.11.2 && \
./configure && make -j4 && make install && \
make clean && \
cd .. && rm -rf protobuf-*
RUN yum install -y python3 python3-devel
RUN yum -y update >/dev/null \
...
...
tools/Dockerfile.cuda10.0-cudnn7.devel
浏览文件 @
158aa799
...
...
@@ -7,6 +7,13 @@ RUN yum -y install wget >/dev/null \
&& yum -y install libXrender-0.9.10-1.el7.x86_64 --setopt=protected_multilib=false \
&& yum -y install libXext-1.3.3-3.el7.x86_64 --setopt=protected_multilib=false
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protobuf-all-3.11.2.tar.gz && \
tar zxf protobuf-all-3.11.2.tar.gz && \
cd protobuf-3.11.2 && \
./configure && make -j4 && make install && \
make clean && \
cd .. && rm -rf protobuf-*
RUN wget https://cmake.org/files/v3.2/cmake-3.2.0-Linux-x86_64.tar.gz >/dev/null \
&& tar xzf cmake-3.2.0-Linux-x86_64.tar.gz \
&& mv cmake-3.2.0-Linux-x86_64 /usr/local/cmake3.2.0 \
...
...
tools/Dockerfile.cuda9.0-cudnn7.devel
浏览文件 @
158aa799
...
...
@@ -6,6 +6,13 @@ RUN yum -y install wget >/dev/null \
&& yum -y install libXrender-0.9.10-1.el7.x86_64 --setopt=protected_multilib=false \
&& yum -y install libXext-1.3.3-3.el7.x86_64 --setopt=protected_multilib=false
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protobuf-all-3.11.2.tar.gz && \
tar zxf protobuf-all-3.11.2.tar.gz && \
cd protobuf-3.11.2 && \
./configure && make -j4 && make install && \
make clean && \
cd .. && rm -rf protobuf-*
RUN wget https://cmake.org/files/v3.2/cmake-3.2.0-Linux-x86_64.tar.gz >/dev/null \
&& tar xzf cmake-3.2.0-Linux-x86_64.tar.gz \
&& mv cmake-3.2.0-Linux-x86_64 /usr/local/cmake3.2.0 \
...
...
tools/serving_build.sh
浏览文件 @
158aa799
...
...
@@ -18,14 +18,20 @@ function init() {
export
PYTHONROOT
=
/usr
cd
Serving
export
SERVING_WORKDIR
=
$PWD
$PYTHONROOT
/bin/python
-m
pip
install
-r
python/requirements.txt
$PYTHONROOT
/bin/python
-m
pip
install
paddlepaddle
export
GOPATH
=
$HOME
/go
export
PATH
=
$PATH
:
$GOPATH
/bin
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get
-u
github.com/golang/protobuf/protoc-gen-go
go get
-u
google.golang.org/grpc
go
env
-w
GO111MODULE
=
on
go
env
-w
GOPROXY
=
https://goproxy.cn,direct
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v1.15.2
go get
-u
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v1.15.2
go get
-u
github.com/golang/protobuf/protoc-gen-go@v1.4.3
go get
-u
google.golang.org/grpc@v1.33.0
}
function
check_cmd
()
{
...
...
@@ -605,7 +611,7 @@ function python_test_grpc_impl() {
# test load server config and client config in Server side
cd
criteo_ctr_with_cube
# pwd: /Serving/python/examples/grpc_impl_example/criteo_ctr_with_cube
<<
COMMENT
#comment for compile bug, todo fix conflict between grpc-gateway and cube-agent
check_cmd "wget https://paddle-serving.bj.bcebos.com/unittest/ctr_cube_unittest.tar.gz > /dev/null"
check_cmd "tar xf ctr_cube_unittest.tar.gz"
check_cmd "mv models/ctr_client_conf ./"
...
...
@@ -626,9 +632,11 @@ function python_test_grpc_impl() {
echo "error with criteo_ctr_with_cube inference auc test, auc should > 0.67"
exit 1
fi
COMMENT
echo
"grpc impl test success"
kill_server_process
ps
-ef
|
grep
"cube"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
#
ps -ef | grep "cube" | grep -v grep | awk '{print $2}' | xargs kill
cd
..
# pwd: /Serving/python/examples/grpc_impl_example
;;
...
...
@@ -665,6 +673,7 @@ function python_test_grpc_impl() {
cd
..
# pwd: /Serving/python/examples/grpc_impl_example
# test load server config and client config in Server side
<<
COMMENT
#comment for compile bug, todo fix conflict between grpc-gateway and cube-agent
cd criteo_ctr_with_cube # pwd: /Serving/python/examples/grpc_impl_example/criteo_ctr_with_cube
check_cmd "wget https://paddle-serving.bj.bcebos.com/unittest/ctr_cube_unittest.tar.gz"
...
...
@@ -689,10 +698,11 @@ function python_test_grpc_impl() {
echo "error with criteo_ctr_with_cube inference auc test, auc should > 0.67"
exit 1
fi
COMMENT
echo
"grpc impl test success"
kill_server_process
ps
-ef
|
grep
"test_server_gpu"
|
grep
-v
serving_build |
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
ps
-ef
|
grep
"cube"
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
#
ps -ef | grep "cube" | grep -v grep | awk '{print $2}' | xargs kill
cd
..
# pwd: /Serving/python/examples/grpc_impl_example
;;
*
)
...
...
@@ -829,8 +839,8 @@ EOF
kill_process_by_port 18080
# test: process servicer & thread op
pip uninstall grpcio
-y
pip
install
grpcio
--no-binary
=
grpcio
#
pip uninstall grpcio -y
#
pip install grpcio --no-binary=grpcio
cat
<<
EOF
> config.yml
rpc_port: 18080
worker_num: 4
...
...
@@ -944,7 +954,7 @@ function python_run_test() {
local
TYPE
=
$1
# pwd: /Serving
cd
python/examples
# pwd: /Serving/python/examples
python_test_fit_a_line
$TYPE
# pwd: /Serving/python/examples
python_run_criteo_ctr_with_cube
$TYPE
# pwd: /Serving/python/examples
#
python_run_criteo_ctr_with_cube $TYPE # pwd: /Serving/python/examples
python_test_bert
$TYPE
# pwd: /Serving/python/examples
python_test_imdb
$TYPE
# pwd: /Serving/python/examples
python_test_lac
$TYPE
# pwd: /Serving/python/examples
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录