Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
473c4c1
test=document_fix modify paddle_root
swgu98 Apr 10, 2025
0159bc2
test=document_fix _work
swgu98 Apr 10, 2025
641dcbf
test=document_fix no rm
swgu98 Apr 10, 2025
0eade79
test=document_fix /
swgu98 Apr 10, 2025
26267b1
test=document_fix pP
swgu98 Apr 11, 2025
61a502a
test=document_fix ci scripts
swgu98 Apr 11, 2025
7962117
test=document_fix
swgu98 Apr 11, 2025
9c242db
test=document_fix docker path
swgu98 Apr 11, 2025
31439c0
test=document_fix cd
swgu98 Apr 11, 2025
4fbb4b5
test=document_fix
swgu98 Apr 11, 2025
5abee63
test=document_fix
swgu98 Apr 11, 2025
86703cd
test=document_fix
swgu98 Apr 11, 2025
c9bc055
test=document_fix clean
swgu98 Apr 14, 2025
a33c385
test=document_fix work_dirc
swgu98 Apr 14, 2025
ffbeb36
test=document_fix work_dirc
swgu98 Apr 14, 2025
af33506
test=document_fix work_dirc
swgu98 Apr 14, 2025
1314e41
test=document_fix work_dirc
swgu98 Apr 14, 2025
e91d587
test=document_fix work_dirc
swgu98 Apr 14, 2025
4621ef3
test=document_fix paddle
swgu98 Apr 14, 2025
5ccdac2
test=document_fix merge develop
swgu98 Apr 14, 2025
1782fc0
test=document_fix no build
swgu98 Apr 14, 2025
c6e0737
test=document_fix no test download
swgu98 Apr 14, 2025
19cdd9c
test=document_fix
swgu98 Apr 14, 2025
aae4998
test=document_fix env
swgu98 Apr 14, 2025
18cc0d2
test=document_fix all
swgu98 Apr 14, 2025
868cb8c
test=document_fix all
swgu98 Apr 14, 2025
024eb23
test=document_fix bypass path
swgu98 Apr 14, 2025
53ef729
test=document_fix
swgu98 Apr 14, 2025
165fc9a
test=document_fix all
swgu98 Apr 14, 2025
231feee
test=document_fix
swgu98 Apr 14, 2025
d9bdf64
test=document_fix final
swgu98 Apr 15, 2025
825a298
test=document_fix _
swgu98 Apr 15, 2025
1fcc064
test=document_fix up
swgu98 Apr 16, 2025
5809d36
test=document_fix up
swgu98 Apr 16, 2025
b233408
test=document_fix all
swgu98 Apr 16, 2025
3b34864
test=document_fix download coverage
swgu98 Apr 17, 2025
0dc44ab
test=document_fix build
swgu98 Apr 17, 2025
05aea47
test=document_fix build
swgu98 Apr 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 55 additions & 51 deletions .github/workflows/_Coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ env:
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
TASK: paddle-CI-${{ github.event.pull_request.number }}-coverage
ci_scripts: ${{ github.workspace }}/ci
ci_scripts: /paddle/ci
BRANCH: ${{ github.base_ref }}
work_dir: ${{ github.workspace }}
PADDLE_ROOT: ${{ github.workspace }}
work_dir: /paddle
PADDLE_ROOT: /paddle
GIT_PR_ID: ${{ github.event.pull_request.number }}
CI_name: coverage

defaults:
run:
Expand All @@ -25,12 +26,11 @@ jobs:
runs-on:
group: GZ_BD-CPU
outputs:
can-skip: ${{ steps.check-bypass.outputs.can_skip }}
can-skip: ${{ steps.check-bypass.outputs.can-skip }}

steps:
- name: Download paddle.tar.gz and update test branch
run: |
rm -rf * .[^.]*
set -e
echo "Downloading Paddle.tar.gz"
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/Paddle/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
Expand All @@ -40,9 +40,9 @@ jobs:
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
git config pull.rebase false
git checkout test
echo "Pull upstream develop"
. ../../../proxy
git pull upstream develop --no-edit
echo "Pull upstream $BRANCH"
source ${{ github.workspace }}/../../../proxy
git pull upstream $BRANCH --no-edit

- name: Check bypass
id: check-bypass
Expand All @@ -52,7 +52,7 @@ jobs:
workflow-name: coverage

- name: Check docker image and run container
if: steps.check-bypass.outputs.can_skip != 'true'
if: steps.check-bypass.outputs.can-skip != 'true'
env:
CCACHE_DIR: "/root/.ccache/coverage"
FLAGS_fraction_of_gpu_memory_to_use: 0.15
Expand Down Expand Up @@ -81,14 +81,16 @@ jobs:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UT_RUN_TYPE_SETTING: WITHOUT_HYBRID
run: |
container_name=${TASK}-build-$(date +%s)
container_name=${TASK}-build-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker run -d -t --name ${container_name} \
-v "/home/data/cfs:/home/data/cfs" \
-v "/home/data/cfs/.cache:/root/.cache" \
-v "/home/data/cfs/.ccache:/root/.ccache" \
-v "/dev/shm:/dev/shm" \
-v "${{ github.workspace }}/../../../..:${{ github.workspace }}/../../../.." \
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
-v ${{ github.workspace }}:/paddle \
-e CI_name \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
Expand Down Expand Up @@ -121,42 +123,44 @@ jobs:
-e GITHUB_TOKEN \
-e GITHUB_API_TOKEN \
-e UT_RUN_TYPE_SETTING \
-w ${{ github.workspace }} --network host ${docker_image}
-w /paddle --network host ${docker_image}

- name: Build
if: steps.check-bypass.outputs.can_skip != 'true'
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
mkdir -p /home/data/cfs/.cache/coverage
mkdir -p /home/data/cfs/.ccache/coverage
. ../../../proxy
bash $ci_scripts/coverage_build.sh ${PYTHON_ABI:-""} bdist_wheel ${parallel_number:-""} coverage "" ${{ github.env }}
source ${{ github.workspace }}/../../../proxy
bash $ci_scripts/coverage_build.sh bdist_wheel
'

- name: Check added unittests
if: steps.check-bypass.outputs.can_skip != 'true'
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
. ../../../proxy
bash -x $ci_scripts/check_added_ut.sh
source ~/.bashrc
source ${{ github.workspace }}/../../../proxy
bash $ci_scripts/check_added_ut.sh
'

- name: Check coverage build size requires approval
if: steps.check-bypass.outputs.can_skip != 'true'
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
. ../../../proxy
bash $ci_scripts/coverage_build_size_approval.sh ${{ env.buildSize }}
source ~/.bashrc
source ${{ github.workspace }}/../../../proxy
bash $ci_scripts/coverage_build_size_approval.sh
'

- name: Clean up env
if: steps.check-bypass.outputs.can_skip != 'true'
working-directory: build
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
source ~/.bashrc
source ${ci_scripts}/utils.sh; clean_build_files
Build_Size=$(du -h --max-depth=0 ${work_dir}/build |awk '"'"'{print $1}'"'"')
echo "Build_Size=${Build_Size}" > ${{ github.workspace }}/dist/coverage_build_size
echo "Build_Size=${Build_Size}" > ${work_dir}/dist/coverage_build_size
find ./ -type f -size +200M | xargs du -lh
rm -rf $(find . -name "*.a")
rm -rf $(find . -name "*.o")
Expand All @@ -166,22 +170,20 @@ jobs:
find ./ -name "eager_generator" -or -name "kernel_signature_generator" -or -name "eager_legacy_op_function_generator" | xargs rm -rf
rm -rf ./python/build/lib.linux-x86_64-3.9/
cd "${work_dir}/build/third_party" && find $(ls | grep -v "dlpack" | grep -v "install" | grep -v "eigen3" | grep -v "gflags") -type f ! -name "*.so" -a ! -name "libdnnl.so*" -delete
cd ${{ github.workspace }}/..
tar --use-compress-program="pzstd -1" -cpf Paddle.tar.gz Paddle
cd /
tar --use-compress-program="pzstd -1" -cpf Paddle.tar.gz paddle
'

- name: Upload coverage product
if: steps.check-bypass.outputs.can_skip != 'true'
if: steps.check-bypass.outputs.can-skip != 'true'
env:
home_path: ${{ github.workspace }}/..
bos_file: ${{ github.workspace }}/../bos/BosClient.py
paddle_whl: paddlepaddle_gpu-0.0.0-cp39-cp39-linux_x86_64.whl
working-directory: dist
run: |
pwd
docker exec -t ${{ env.container_name }} /bin/bash -c '
echo "::group::Install bce-python-sdk"
. ../../../proxy
source ${{ github.workspace }}/../../../proxy
python -m pip install bce-python-sdk==0.8.74
echo "::endgroup::"
export AK=paddle
Expand All @@ -191,17 +193,19 @@ jobs:
mkdir ${{ env.home_path }}/bos
tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos
fi
. ../../../unproxy
cd ${{ github.workspace }}/dist
python ${{ env.bos_file }} coverage_build_size paddle-github-action/PR/coverage_build_size/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
python ${{ env.bos_file }} ${{ env.paddle_whl }} paddle-github-action/PR/coverage_whl/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
cd ${{ github.workspace }}/..
python ${{ env.bos_file }} Paddle.tar.gz paddle-github-action/PR/coverage_paddle/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
cd /paddle/dist
echo "Uploading coverage build size"
python ${{ env.bos_file }} coverage_build_size paddle-github-action/PR/coverage/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
echo "Uploading coverage wheel"
python ${{ env.bos_file }} ${{ env.paddle_whl }} paddle-github-action/PR/coverage/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
cd /
echo "Uploading Paddle.tar.gz"
python ${{ env.bos_file }} Paddle.tar.gz paddle-github-action/PR/coverage/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
rm Paddle.tar.gz
'

- name: Terminate and delete the container
if: ${{ steps.check-bypass.outputs.can_skip != 'true' && always() }}
if: ${{ steps.check-bypass.outputs.can-skip != 'true' && always() }}
run: |
set +e
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
Expand All @@ -214,23 +218,20 @@ jobs:
needs: build
if: needs.build.outputs.can-skip != 'true'
runs-on:
group: BD_BJ-V100
group: BD_BJ_v100
steps:
- name: Download paddle.tar.gz and update test branch
run: |
set +e
rm -rf * .[^.]*
set -e
echo "Downloading Paddle.tar.gz"
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/coverage_paddle/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
# wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/coverage_paddle/71611/52756a5f582d9ee58822dd76788beaf13024f6a0/Paddle.tar.gz --no-check-certificate
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/coverage/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
echo "Extracting Paddle.tar.gz"
tar --use-compress-program='pzstd -1' -xpf Paddle.tar.gz --strip-components=1
rm Paddle.tar.gz
. ../../../proxy
source ${{ github.workspace }}/../../../proxy
git checkout test
echo "Pull upstream develop"
git pull upstream develop --no-edit
git pull upstream $BRANCH --no-edit

- name: Check docker image and run container
env:
Expand Down Expand Up @@ -259,14 +260,16 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
container_name=${TASK}-test-$(date +%s)
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker run -d -t --gpus all --name ${container_name} \
-v "/home/data/cfs:/home/data/cfs" \
-v "/home/data/cfs/.cache:/root/.cache" \
-v "/home/data/cfs/.ccache:/root/.ccache" \
-v "/dev/shm:/dev/shm" \
-v "${{ github.workspace }}/../../../..:${{ github.workspace }}/../../../.." \
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
-v ${{ github.workspace }}:/paddle \
-e CI_name \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
Expand Down Expand Up @@ -298,14 +301,13 @@ jobs:
-e COVERAGE_FILE \
-e GITHUB_TOKEN \
-e GITHUB_API_TOKEN \
-w ${{ github.workspace }} --network host ${docker_image}
-w /paddle --network host ${docker_image}

- name: Test
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
nvidia-smi
. ../../../proxy
bash $ci_scripts/coverage_test.sh ${{ github.env }}
source ${{ github.workspace }}/../../../proxy
bash $ci_scripts/coverage_test.sh
TEST_EXIT_CODE=$?
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}" >> ${{ github.env }}
if [[ "$TEST_EXIT_CODE" -ne 0 && "$TEST_EXIT_CODE" -ne 9 ]]; then
Expand All @@ -316,7 +318,9 @@ jobs:
- name: Check coverage data
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
. ../../../proxy
source ~/.bashrc
unset GREP_OPTIONS
source ${{ github.workspace }}/../../../proxy
source ${ci_scripts}/utils.sh; check_coverage
COVERAGE_EXIT_CODE=$?
echo "COVERAGE_EXIT_CODE=${COVERAGE_EXIT_CODE}" >> ${{ github.env }}
Expand Down
Loading