diff --git a/doc/PIPELINE_SERVING_CN.md b/doc/PIPELINE_SERVING_CN.md index 22e4b33050ac64ae7c53454ab5110ee623b93ce7..46a21a103777bafd4ed200e75861e6c09251d037 100644 --- a/doc/PIPELINE_SERVING_CN.md +++ b/doc/PIPELINE_SERVING_CN.md @@ -130,7 +130,7 @@ def postprocess(self, input_dicts, fetch_dict): **preprocess** 的参数是前继 Channel 中的数据 `input_dicts`,该变量是一个以前继 OP 的 name 为 Key,对应 OP 的输出为 Value 的字典。 -**process ** 的参数是 Paddle Serving Client 预测接口的输入变量 `fetch_dict`(preprocess 函数的返回值),该变量是一个以 feed_name 为 Key,对应 ndarray 格式的数据为 Value 的字典。 +**process** 的参数是 Paddle Serving Client 预测接口的输入变量 `fetch_dict`(preprocess 函数的返回值),该变量是一个以 feed_name 为 Key,对应 ndarray 格式的数据为 Value 的字典。 **postprocess** 的参数是 `input_dicts` 和 `fetch_dict`,`input_dicts` 与 preprocess 的参数一致,`fetch_dict` 是 process 函数的返回值(如果没有执行 process ,则该值为 preprocess 的返回值)。 diff --git a/tools/serving_build.sh b/tools/serving_build.sh index ee70cfc0b9e61fda0436eb84ed13200287175680..c2eee61959856c885103ed5bdd031603178b02e5 100644 --- a/tools/serving_build.sh +++ b/tools/serving_build.sh @@ -137,6 +137,15 @@ function kill_server_process() { sleep 1 } +function kill_process_by_pid() { + if [ $# != 1 ]; then + echo "usage: kill_process_by_pid " + exit 1 + fi + local PID=$1 + lsof -i:$PID | awk 'NR == 1 {next} {print $2}' | xargs kill +} + function python_test_fit_a_line() { # pwd: /Serving/python/examples cd fit_a_line # pwd: /Serving/python/examples/fit_a_line @@ -521,6 +530,7 @@ function python_test_grpc_impl() { check_cmd "python test_batch_client.py > /dev/null" check_cmd "python test_timeout_client.py > /dev/null" kill_server_process + kill_process_by_pid 9393 check_cmd "python test_server.py uci_housing_model > /dev/null &" sleep 5 # wait for the server to start @@ -531,6 +541,7 @@ function python_test_grpc_impl() { check_cmd "python test_batch_client.py > /dev/null" check_cmd "python test_timeout_client.py > /dev/null" kill_server_process + kill_process_by_pid 9393 cd .. # pwd: /Serving/python/examples/grpc_impl_example @@ -579,6 +590,7 @@ function python_test_grpc_impl() { check_cmd "python test_batch_client.py > /dev/null" check_cmd "python test_timeout_client.py > /dev/null" kill_server_process + kill_process_by_pid 9393 check_cmd "python test_server_gpu.py uci_housing_model > /dev/null &" sleep 5 # wait for the server to start @@ -589,7 +601,8 @@ function python_test_grpc_impl() { check_cmd "python test_batch_client.py > /dev/null" check_cmd "python test_timeout_client.py > /dev/null" kill_server_process - ps -ef | grep "test_server_gpu" | grep -v serving_build | grep -v grep | awk '{print $2}' | xargs kill + kill_process_by_pid 9393 + #ps -ef | grep "test_server_gpu" | grep -v serving_build | grep -v grep | awk '{print $2}' | xargs kill cd .. # pwd: /Serving/python/examples/grpc_impl_example @@ -702,7 +715,6 @@ function python_test_pipeline(){ # start paddle serving service (brpc) sh get_data.sh python -m paddle_serving_server.serve --model imdb_cnn_model --port 9292 --workdir test9292 &> cnn.log & - sleep 5 python -m paddle_serving_server.serve --model imdb_bow_model --port 9393 --workdir test9393 &> bow.log & sleep 5 @@ -771,10 +783,11 @@ EOF ps -ef | grep "pipeline_server" | grep -v grep | awk '{print $2}' | xargs kill kill_server_process + kill_process_by_pid 9292 + kill_process_by_pid 9393 # start paddle serving service (grpc) python -m paddle_serving_server.serve --model imdb_cnn_model --port 9292 --use_multilang --workdir test9292 &> cnn.log & - sleep 5 python -m paddle_serving_server.serve --model imdb_bow_model --port 9393 --use_multilang --workdir test9393 &> bow.log & sleep 5 python test_pipeline_server.py > /dev/null & @@ -782,6 +795,8 @@ EOF check_cmd "python test_pipeline_client.py" ps -ef | grep "pipeline_server" | grep -v grep | awk '{print $2}' | xargs kill kill_server_process + kill_process_by_pid 9292 + kill_process_by_pid 9393 ;; GPU) echo "pipeline ignore GPU test"