Skip to content

Commit

Permalink
Put *.so and proto in the build directory into a tar package (#32993)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianshuo78520a committed May 28, 2021
1 parent 5363dad commit cf08bab
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions paddle/scripts/paddle_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,30 @@ function summary_check_problems() {
set -x
}


function reuse_so_cache() {
get_html="https://api.github.com/repos/PaddlePaddle/Paddle"
merge_commit=grep sha tmp.txt `curl -X GET ${get_html}/commits -H "authorization: token ${GITHUB_API_TOKEN}" >tmp.txt` |awk -F \" 'NR==1{print $(NF-1)}'
merge_pr=grep -oP -m 1 '(#[0-9]*)' tmp.txt `curl -X GET ${get_html}/commits/${merge_commit} -H "authorization: token ${GITHUB_API_TOKEN}" >tmp.txt` |sed 's/#//g'
pr_commit=grep "sha" tmp.txt `curl -X GET ${get_html}/pulls/${merge_pr}/commits -H "authorization: token ${GITHUB_API_TOKEN}"` |tail -3|head -1|awk -F : '{print $NF}'|sed 's#"##g'|sed 's#,##g'
set +e
down_proto_so=`wget -q https://xly-devops.bj.bcebos.com/PR/Paddle/${merge_pr}/${pr_commit}/workspace/Paddle/build/proto_so.tar.gz`
set -e
if [ "${down_proto_so}" -eq 0 ];then
export CI_SKIP_CPP_TEST=ON
cd build && mv ../proto_so.tar.gz .
tar --use-compress-program=pigz -xpf proto_so.tar.gz
cmake_gen ${PYTHON_ABI:-""} ${parallel_number}
cd python
touch stub.cc
alias cp=cp
cp -r ../../python/paddle .
python setup.py bdist_wheel
else
cmake_gen_and_build ${PYTHON_ABI:-""} ${parallel_number}
fi
}

function main() {
local CMD=$1
local parallel_number=$2
Expand Down Expand Up @@ -2218,6 +2242,10 @@ function main() {
parallel_test
check_coverage
;;
reuse_so_cicheck_py35)
reuse_so_cache
parallel_test
;;
cmake_gen)
cmake_gen ${PYTHON_ABI:-""}
;;
Expand Down

0 comments on commit cf08bab

Please sign in to comment.