未验证 提交 ff97dea4 编写于 作者: 王明冬 提交者: GitHub

add inference size check to CI, test=develop (#34060)

上级 1889d504
...@@ -809,6 +809,31 @@ function check_approvals_of_unittest() { ...@@ -809,6 +809,31 @@ function check_approvals_of_unittest() {
exit 6 exit 6
fi fi
fi fi
elif [ $check_times == 3 ]; then
rm -f fluidInference_so_size
curl -O https://paddle-docker-tar.bj.bcebos.com/paddle_ci_index/fluidInference_so_size
oriBuildSize=`cat fluidInference_so_size`
curBuildSize=$(du -m --max-depth=0 ${PADDLE_ROOT}/build/paddle_inference_install_dir/paddle/lib/libpaddle_inference.so |awk '{print $1}')
apt-get install -y bc
diffSize=$(printf "%.2f" `echo "$curBuildSize - $oriBuildSize" | bc`)
cat <<EOF
========================================
Original libpaddle_inference.so Size is ${oriBuildSize}M.
Current libpaddle_inference.so Size is ${curBuildSize}M.
Diff size of libpaddle_inference.so is ${diffSize}M.
========================================
EOF
if [ `echo "5 < $diffSize"|bc` -eq 1 ] ; then
approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000`
APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 39303645 328693`
echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}"
if [ "${APPROVALS}" == "FALSE" ]; then
echo "=========================================================================================="
echo -e "Diff size is no less than 5 M. Then you must have one RD (Shixiaowei02 (Recommend) or Superjomn) approval for this PR\n"
echo "=========================================================================================="
exit 6
fi
fi
fi fi
set -x set -x
} }
...@@ -2185,6 +2210,7 @@ function main() { ...@@ -2185,6 +2210,7 @@ function main() {
#test_fluid_lib_train #test_fluid_lib_train
#go inference test #go inference test
test_go_inference_api test_go_inference_api
check_approvals_of_unittest 3
;; ;;
test_train) test_train)
gen_fluid_lib ${parallel_number} gen_fluid_lib ${parallel_number}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册