未验证 提交 5fd1a241 编写于 作者: D Dong Daxiang 提交者: GitHub

Merge pull request #349 from barrierye/add_app_compile_ci

Add app compile ci
...@@ -61,7 +61,7 @@ make -j10 ...@@ -61,7 +61,7 @@ make -j10
```bash ```bash
mkdir build && cd build mkdir build && cd build
cmake -DPYTHON_INCLUDE_DIR=$PYTHONROOT/include/python2.7/ -DPYTHON_LIBRARIES=$PYTHONROOT/lib/libpython2.7.so -DPYTHON_EXECUTABLE=$PYTHONROOT/bin/python -DCMAKE_INSTALL_PREFIX=./output -DAPP=ON .. cmake -DPYTHON_INCLUDE_DIR=$PYTHONROOT/include/python2.7/ -DPYTHON_LIBRARIES=$PYTHONROOT/lib/libpython2.7.so -DPYTHON_EXECUTABLE=$PYTHONROOT/bin/python -DAPP=ON ..
make make
``` ```
......
...@@ -48,6 +48,30 @@ function rerun() { ...@@ -48,6 +48,30 @@ function rerun() {
exit 1 exit 1
} }
function build_app() {
local TYPE=$1
local DIRNAME=build-app-$TYPE
mkdir $DIRNAME # pwd: /Serving
cd $DIRNAME # pwd: /Serving/build-app-$TYPE
pip install numpy sentencepiece
case $TYPE in
CPU|GPU)
cmake -DPYTHON_INCLUDE_DIR=$PYTHONROOT/include/python2.7/ \
-DPYTHON_LIBRARIES=$PYTHONROOT/lib/libpython2.7.so \
-DPYTHON_EXECUTABLE=$PYTHONROOT/bin/python \
-DAPP=ON ..
rerun "make -j2 >/dev/null" 3 # due to some network reasons, compilation may fail
pip install -U python/dist/paddle_serving_app* >/dev/null
;;
*)
echo "error type"
exit 1
;;
esac
echo "build app $TYPE part finished as expected."
cd .. # pwd: /Serving
}
function build_client() { function build_client() {
local TYPE=$1 local TYPE=$1
local DIRNAME=build-client-$TYPE local DIRNAME=build-client-$TYPE
...@@ -230,6 +254,7 @@ function main() { ...@@ -230,6 +254,7 @@ function main() {
init # pwd: /Serving init # pwd: /Serving
build_client $TYPE # pwd: /Serving build_client $TYPE # pwd: /Serving
build_server $TYPE # pwd: /Serving build_server $TYPE # pwd: /Serving
build_app $TYPE # pwd: /Serving
python_run_test $TYPE # pwd: /Serving python_run_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.
先完成此消息的编辑!
想要评论请 注册