From 9647320641796feaaeca0a85db1461a63891f5e5 Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Tue, 10 Aug 2021 18:20:40 +0800 Subject: [PATCH 1/8] notest;test=cpu --- paddle/scripts/paddle_build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 1eee270c8dc46..6d251a299fac8 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -730,6 +730,9 @@ function generate_upstream_develop_api_spec() { cmake_gen $1 build $2 cp ${PADDLE_ROOT}/python/requirements.txt /tmp + pr_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` + echo "pr_whl_size: ${pr_whl_size}" + git checkout $cur_branch generate_api_spec "$1" "DEV" @@ -740,6 +743,8 @@ function generate_upstream_develop_api_spec() { if [ ${cmake_change} ];then rm -rf ${PADDLE_ROOT}/build/third_party fi + dev_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` + echo "dev_whl_size: ${dev_whl_size}" } function generate_api_spec() { From 19c314d47a8af90b56541152faa688bf27777d71 Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Wed, 11 Aug 2021 11:31:11 +0800 Subject: [PATCH 2/8] notest;test=cpu --- paddle/scripts/paddle_build.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 6d251a299fac8..4605f35e0f240 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -722,6 +722,31 @@ function fetch_upstream_develop_if_not_exist() { fi } +function check_whl_size() { + if [ "${pr_whl_size}" ];then + echo "pr whl size not found" + return + fi + + dev_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` + echo "dev_whl_size: ${dev_whl_size}" + + apt-get install -y bc + whldiffSize=`${pr_whl_size} - ${dev_whl_size}` + if [ `echo "10 < $whldiffSize"|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 22334008 22361972` + echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}" + if [ "${APPROVALS}" == "FALSE" ]; then + echo "==========================================================================================" + echo "This PR make the release paddlepaddle whl size growth exceeds 10 M." + echo "Then you must have one RD (jim19930609 (Recommend) or JiabinYang) approval for this PR\n" + echo "==========================================================================================" + exit 6 + fi + fi +} + function generate_upstream_develop_api_spec() { fetch_upstream_develop_if_not_exist cur_branch=`git branch | grep \* | cut -d ' ' -f2` @@ -743,8 +768,6 @@ function generate_upstream_develop_api_spec() { if [ ${cmake_change} ];then rm -rf ${PADDLE_ROOT}/build/third_party fi - dev_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` - echo "dev_whl_size: ${dev_whl_size}" } function generate_api_spec() { From b17160f3e796ee58dddc38152b662ded7e5fad31 Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Wed, 11 Aug 2021 14:16:24 +0800 Subject: [PATCH 3/8] notest;test=cpu --- paddle/scripts/paddle_build.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 4605f35e0f240..1cfe3dce62487 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -689,18 +689,18 @@ function get_precision_ut_mac() { on_precision=1 re=$(cat ut_list|awk -F ' ' '{print }' | awk 'BEGIN{ all_str=""}{if (all_str==""){all_str=$1}else{all_str=all_str"$|^"$1}} END{print "^"all_str"$"}') UT_list_prec_1='ut_list_prec2' - for case in $UT_list; do - flag=$(echo $case|grep -oE $re) + for ut_case in $UT_list; do + flag=$(echo $ut_case|grep -oE $re) if [ -n "$flag" ];then if [ -z "$UT_list_prec" ];then - UT_list_prec="^$case$" + UT_list_prec="^$ut_case$" elif [[ "${#UT_list_prec}" -gt 10000 ]];then - UT_list_prec_1="$UT_list_prec_1|^$case$" + UT_list_prec_1="$UT_list_prec_1|^$ut_case$" else - UT_list_prec="$UT_list_prec|^$case$" + UT_list_prec="$UT_list_prec|^$ut_case$" fi else - echo ${case} "won't run in PRECISION_TEST mode." + echo ${ut_case} "won't run in PRECISION_TEST mode." fi done fi @@ -731,7 +731,6 @@ function check_whl_size() { dev_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` echo "dev_whl_size: ${dev_whl_size}" - apt-get install -y bc whldiffSize=`${pr_whl_size} - ${dev_whl_size}` if [ `echo "10 < $whldiffSize"|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` @@ -2262,6 +2261,7 @@ function main() { example_code=$? summary_check_problems $check_style_code $[${example_code_gpu} + ${example_code}] "$check_style_info" "${example_info_gpu}\n${example_info}" assert_api_spec_approvals + check_whl_size ;; build) cmake_gen ${PYTHON_ABI:-""} From cc945152be6925a0ba89f3026a653cc400664fbf Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Wed, 11 Aug 2021 17:12:07 +0800 Subject: [PATCH 4/8] notest;op_benchmark --- paddle/scripts/paddle_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 1cfe3dce62487..7fd7f3feb3eb9 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -723,9 +723,9 @@ function fetch_upstream_develop_if_not_exist() { } function check_whl_size() { - if [ "${pr_whl_size}" ];then + if [ ! "${pr_whl_size}" ];then echo "pr whl size not found" - return + exit 1 fi dev_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` From 7e86543617c72b208f63a112e49a9bd79a5f338f Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Wed, 11 Aug 2021 17:12:44 +0800 Subject: [PATCH 5/8] fix --- paddle/scripts/paddle_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 7fd7f3feb3eb9..1b3cbc5863247 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -724,7 +724,7 @@ function fetch_upstream_develop_if_not_exist() { function check_whl_size() { if [ ! "${pr_whl_size}" ];then - echo "pr whl size not found" + echo "pr whl size not found " exit 1 fi From 26a20c3427d134ff23e7897ef89ac3d95c60c3c7 Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Wed, 11 Aug 2021 20:31:33 +0800 Subject: [PATCH 6/8] fix --- paddle/scripts/paddle_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 1b3cbc5863247..405f860b346a1 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -731,8 +731,8 @@ function check_whl_size() { dev_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` echo "dev_whl_size: ${dev_whl_size}" - whldiffSize=`${pr_whl_size} - ${dev_whl_size}` - if [ `echo "10 < $whldiffSize"|bc` -eq 1 ] ; then + whldiffSize=`expr ${pr_whl_size} - ${dev_whl_size}` + if [ ${whldiffSize} -gt 10 ] ; 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 22334008 22361972` echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}" From d90433f956de7f25b3bbac98f19c856e4165eea2 Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Thu, 12 Aug 2021 15:32:53 +0800 Subject: [PATCH 7/8] notest;test=cpu --- paddle/scripts/paddle_build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 405f860b346a1..9e51c752d55b8 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -730,6 +730,7 @@ function check_whl_size() { dev_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` echo "dev_whl_size: ${dev_whl_size}" + pr_whl_size=196 whldiffSize=`expr ${pr_whl_size} - ${dev_whl_size}` if [ ${whldiffSize} -gt 10 ] ; then From 3b483e15b58fcb410fd43edf1e64700a3668deae Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Thu, 12 Aug 2021 17:12:17 +0800 Subject: [PATCH 8/8] fix --- paddle/scripts/paddle_build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 9e51c752d55b8..1d3504556fc3d 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -728,9 +728,9 @@ function check_whl_size() { exit 1 fi + set +x dev_whl_size=`du -m ${PADDLE_ROOT}/build/python/dist/*.whl|awk '{print $1}'` echo "dev_whl_size: ${dev_whl_size}" - pr_whl_size=196 whldiffSize=`expr ${pr_whl_size} - ${dev_whl_size}` if [ ${whldiffSize} -gt 10 ] ; then @@ -745,6 +745,7 @@ function check_whl_size() { exit 6 fi fi + set -x } function generate_upstream_develop_api_spec() {