Skip to content

Commit 9561603

Browse files
authored
Apply CI fix from Develop (#3151)
* fix ci approve * Describe PR diff coverage using JSON file (#3114) * Refactored ci pipeline * update * Describe PR diff coverage using JSON file * remove pip cache setting from Approve * fix * update * fix ci (#3141) * fix
1 parent e26313a commit 9561603

File tree

8 files changed

+187
-85
lines changed

8 files changed

+187
-85
lines changed

.github/workflows/_build_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ jobs:
124124
echo "Date Only: $DATE_ONLY"
125125
export FASTDEPLOY_VERSION="${FASTDEPLOY_VERSION}.dev${DATE_ONLY}"
126126
fi
127+
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
127128
pip config set global.index-url http://pip.baidu.com/root/baidu/+simple/
128129
pip config set install.trusted-host pip.baidu.com
129130
pip config set global.extra-index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
130131
131132
python -m pip install --upgrade pip
132133
python -m pip install -r requirements.txt
133134
python -m pip install wheel
134-
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
135135
# 编译RDMA
136136
export ENABLE_FD_RDMA=1
137137
bash build.sh 1 python false [${COMPILE_ARCH}]

.github/workflows/_pre_ce_test.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Pre-CE-Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
DOCKER_IMAGE:
7+
description: "Build Images"
8+
required: true
9+
type: string
10+
default: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:fastdeploy-ciuse-cuda126"
11+
FASTDEPLOY_ARCHIVE_URL:
12+
description: "URL of the compressed FastDeploy code archive."
13+
required: true
14+
type: string
15+
FASTDEPLOY_WHEEL_URL:
16+
description: "URL of the FastDeploy Wheel."
17+
required: true
18+
type: string
19+
CACHE_DIR:
20+
description: "Cache Dir Use"
21+
required: false
22+
type: string
23+
default: ""
24+
25+
concurrency:
26+
group: ${{ github.event.pull_request.number }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
run_ce_cases:
31+
runs-on: [self-hosted, GPU-L20-4Card]
32+
steps:
33+
- name: Print current runner name
34+
run: |
35+
echo "Current runner name: ${{ runner.name }}"
36+
- name: Code Prepare
37+
shell: bash
38+
env:
39+
docker_image: ${{ inputs.DOCKER_IMAGE }}
40+
fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }}
41+
run: |
42+
set -x
43+
REPO="https://github.com/${{ github.repository }}.git"
44+
FULL_REPO="${{ github.repository }}"
45+
REPO_NAME="${FULL_REPO##*/}"
46+
BASE_BRANCH="${{ github.base_ref }}"
47+
48+
# Clean the repository directory before starting
49+
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
50+
-e "REPO_NAME=${REPO_NAME}" \
51+
${docker_image} /bin/bash -c '
52+
if [ -d ${REPO_NAME} ]; then
53+
echo "Directory ${REPO_NAME} exists, removing it..."
54+
rm -rf ${REPO_NAME}*
55+
fi
56+
'
57+
58+
wget -q ${fd_archive_url}
59+
tar -xf FastDeploy.tar.gz
60+
rm -rf FastDeploy.tar.gz
61+
cd FastDeploy
62+
git config --global user.name "FastDeployCI"
63+
git config --global user.email "[email protected]"
64+
git log -n 3 --oneline
65+
66+
- name: Run CI unittest
67+
env:
68+
docker_image: ${{ inputs.DOCKER_IMAGE }}
69+
fd_wheel_url: ${{ inputs.FASTDEPLOY_WHEEL_URL }}
70+
run: |
71+
runner_name="${{ runner.name }}"
72+
last_char="${runner_name: -1}"
73+
74+
if [ "${last_char}" = "1" ]; then
75+
gpu_id=2
76+
DEVICES="2,3"
77+
else
78+
gpu_id=0
79+
DEVICES="0,1"
80+
fi
81+
FD_API_PORT=$((9180 + gpu_id * 100))
82+
FD_ENGINE_QUEUE_PORT=$((9150 + gpu_id * 100))
83+
FD_METRICS_PORT=$((9170 + gpu_id * 100))
84+
85+
PARENT_DIR=$(dirname "$WORKSPACE")
86+
echo "PARENT_DIR:$PARENT_DIR"
87+
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
88+
-v "/ssd4/GithubActions/gitconfig:/etc/gitconfig:ro" \
89+
-v "/ssd4/GithubActions/ModelData:/ModelData:ro" \
90+
-v "/ssd4/GithubActions/CacheDir:/root/.cache" \
91+
-v "/ssd4/GithubActions/ConfigDir:/root/.config" \
92+
-e "MODEL_PATH=/ModelData" \
93+
-e "FD_API_PORT=${FD_API_PORT}" \
94+
-e "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}" \
95+
-e "FD_METRICS_PORT=${FD_METRICS_PORT}" \
96+
-e "fd_wheel_url=${fd_wheel_url}" \
97+
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -c '
98+
git config --global --add safe.directory /workspace/FastDeploy
99+
cd FastDeploy
100+
# python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
101+
python -m pip install paddlepaddle-gpu==3.0.0.dev20250729 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
102+
python -m pip install ${fd_wheel_url}
103+
bash scripts/run_pre_ce.sh
104+
'

.github/workflows/_unit_test_coverage.yml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ on:
2525

2626
jobs:
2727
run_tests_with_coverage:
28-
runs-on: [self-hosted, GPU-h1z1-4Cards]
28+
runs-on: [self-hosted, GPU-h1z1-2Cards]
2929
outputs:
3030
diff_cov_file_url: ${{ steps.cov_upload.outputs.diff_cov_file_url }}
31-
unittest_failed_url: ${{ steps.unittest_failed.outputs.unittest_failed_url }}
31+
unittest_failed_url: ${{ steps.cov_upload.outputs.unittest_failed_url }}
32+
diff_cov_result_json_url: ${{ steps.cov_upload.outputs.diff_cov_result_json_url }}
3233
steps:
3334
- name: Code Prepare
3435
shell: bash
@@ -111,7 +112,7 @@ jobs:
111112
coverage combine coveragedata/
112113
coverage xml -o python_coverage_all.xml
113114
COVERAGE_EXIT_CODE=0
114-
diff-cover python_coverage_all.xml --diff-file=diff.txt --fail-under=90 || COVERAGE_EXIT_CODE=9
115+
diff-cover python_coverage_all.xml --diff-file=diff.txt --fail-under=80 --json-report diff_coverage.json || COVERAGE_EXIT_CODE=9
115116
echo "COVERAGE_EXIT_CODE=${COVERAGE_EXIT_CODE}" >> exit_code.env
116117
python scripts/generate_diff_coverage_xml.py diff.txt python_coverage_all.xml
117118
'
@@ -125,27 +126,68 @@ jobs:
125126
cd FastDeploy
126127
commit_id=${{ github.event.pull_request.head.sha }}
127128
pr_num=${{ github.event.pull_request.number }}
128-
target_path=paddle-github-action/PR/FastDeploy/${pr_num}/${commit_id}/SM${compile_arch//,/_}/CoverageData
129+
target_path=paddle-github-action/PR/FastDeploy/${pr_num}/${commit_id}/SM${compile_arch//,/_}
129130
wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py
130131
push_file=$(realpath bos_tools.py)
131132
python -m pip install bce-python-sdk==0.9.29
132133
diff_cov_file="diff_coverage.xml"
133134
if [ -f ${diff_cov_file} ];then
134-
python ${push_file} ${diff_cov_file} ${target_path}
135+
python ${push_file} ${diff_cov_file} ${target_path}/CoverageData
135136
target_path_stripped="${target_path#paddle-github-action/}"
136-
DIFF_COV_FILE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/${diff_cov_file}
137+
DIFF_COV_FILE_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${diff_cov_file}
137138
echo "diff_cov_file_url=${DIFF_COV_FILE_URL}" >> $GITHUB_OUTPUT
139+
echo "diff_cov_file_url=${DIFF_COV_FILE_URL}" >> $GITHUB_ENV
138140
fi
139-
- name: Determine Unit Succ and whether the coverage rate reaches 90%
141+
diff_cov_result_json="diff_coverage.json"
142+
if [ -f ${diff_cov_result_json} ];then
143+
python ${push_file} ${diff_cov_result_json} ${target_path}/CoverageData
144+
target_path_stripped="${target_path#paddle-github-action/}"
145+
DIFF_COV_JSON_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/CoverageData/${diff_cov_result_json}
146+
echo "diff_cov_result_json_url=${DIFF_COV_JSON_URL}" >> $GITHUB_OUTPUT
147+
echo "diff_cov_result_json_url=${DIFF_COV_JSON_URL}" >> $GITHUB_ENV
148+
fi
149+
unittest_result="test/failed_tests.log"
150+
if [ -s ${unittest_result} ];then
151+
python ${push_file} ${unittest_result} ${target_path}/UnitTestResult
152+
target_path_stripped="${target_path#paddle-github-action/}"
153+
UNIT_TEST_RESULT_URL=https://paddle-github-action.bj.bcebos.com/${target_path_stripped}/UnitTestResult/${unittest_result}
154+
echo "unittest_failed_url=${UNIT_TEST_RESULT_URL}" >> $GITHUB_OUTPUT
155+
echo "unittest_failed_url=${UNIT_TEST_RESULT_URL}" >> $GITHUB_ENV
156+
fi
157+
- name: Determine Unit Succ and whether the coverage rate reaches 80%
140158
shell: bash
141159
run: |
142160
if [ "$TEST_EXIT_CODE" -eq 8 ]; then
161+
if [ -z "${unittest_failed_url}" ]; then
162+
echo "No diff unit failed file URL provided."
163+
else
164+
wget ${unittest_failed_url} || echo "Download unittest file failed, but continuing..."
165+
fi
143166
echo "Unit tests failed (exit code 8)"
167+
filename=$(basename "$unittest_failed_url")
168+
if [ -f "${filename}" ];then
169+
echo "Failed test cases:"
170+
cat "${filename}"
171+
fi
144172
exit "$TEST_EXIT_CODE"
145173
fi
146174
147175
if [ "$COVERAGE_EXIT_CODE" -eq 9 ]; then
148176
echo "Coverage generation failed (exit code 9)"
177+
if [ -z "${diff_cov_result_json_url}" ]; then
178+
echo "No diff cov result file URL provided."
179+
else
180+
wget ${diff_cov_result_json_url} || echo "Download cov json file failed, but continuing..."
181+
fi
182+
filename=$(basename "$diff_cov_result_json_url")
183+
if [ -f "${filename}" ];then
184+
echo "Failed test cases:"
185+
if command -v jq >/dev/null 2>&1; then
186+
jq . "${filename}"
187+
else
188+
cat "${filename}"
189+
fi
190+
fi
149191
exit "$COVERAGE_EXIT_CODE"
150192
fi
151193
echo "All tests and coverage passed"

.github/workflows/approve.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
uses: actions/setup-python@v5
3434
with:
3535
python-version: '3.10'
36-
cache: 'pip'
3736

3837
- name: Run approval check script
3938
run: |

.github/workflows/ci.yml

Lines changed: 2 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -13,77 +13,8 @@ concurrency:
1313

1414
jobs:
1515
build:
16-
runs-on: [self-hosted, GPU-L20-4Card]
16+
runs-on: ubuntu-latest
1717
steps:
1818
- name: Print current runner name
1919
run: |
20-
echo "Current runner name: ${{ runner.name }}"
21-
# Because the system version is lower than 2.23, the checkout cannot be used.
22-
# - name: Checkout code
23-
# uses: actions/checkout@v4
24-
25-
- name: Code Checkout
26-
env:
27-
docker_image: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:fastdeploy-ciuse-cuda126
28-
run: |
29-
REPO="https://github.com/${{ github.repository }}.git"
30-
FULL_REPO="${{ github.repository }}"
31-
REPO_NAME="${FULL_REPO##*/}"
32-
BASE_BRANCH="${{ github.base_ref }}"
33-
# Clean the repository directory before starting
34-
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
35-
-e "REPO_NAME=${REPO_NAME}" \
36-
-e "BASE_BRANCH=${BASE_BRANCH}" \
37-
${docker_image} /bin/bash -c '
38-
if [ -d ${REPO_NAME} ]; then
39-
echo "Directory ${REPO_NAME} exists, removing it..."
40-
rm -rf ${REPO_NAME}
41-
fi
42-
'
43-
git config --global user.name "FastDeployCI"
44-
git config --global user.email "[email protected]"
45-
git clone ${REPO} ${REPO_NAME} -b ${BASE_BRANCH}
46-
cd FastDeploy
47-
if [ "${{ github.event_name }}" = "pull_request" ]; then
48-
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr/${{ github.event.pull_request.number }}
49-
git merge pr/${{ github.event.pull_request.number }}
50-
git log -n 3 --oneline
51-
else
52-
git checkout ${{ github.sha }}
53-
git log -n 3 --oneline
54-
fi
55-
56-
- name: Run CI unittest
57-
env:
58-
docker_image: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:fastdeploy-ciuse-cuda126
59-
run: |
60-
runner_name="${{ runner.name }}"
61-
last_char="${runner_name: -1}"
62-
63-
if [ "${last_char}" = "1" ]; then
64-
gpu_id=2
65-
DEVICES="2,3"
66-
else
67-
gpu_id=0
68-
DEVICES="0,1"
69-
fi
70-
FD_API_PORT=$((9180 + gpu_id * 100))
71-
FD_ENGINE_QUEUE_PORT=$((9150 + gpu_id * 100))
72-
FD_METRICS_PORT=$((9170 + gpu_id * 100))
73-
74-
PARENT_DIR=$(dirname "$WORKSPACE")
75-
echo "PARENT_DIR:$PARENT_DIR"
76-
docker run --rm --net=host -v $(pwd):/workspace -w /workspace \
77-
-v "/ssd4/GithubActions/gitconfig:/etc/gitconfig:ro" \
78-
-v "/ssd4/GithubActions/ModelData:/ModelData:ro" \
79-
-v "/ssd4/GithubActions/CacheDir:/root/.cache" \
80-
-v "/ssd4/GithubActions/ConfigDir:/root/.config" \
81-
-e "MODEL_PATH=/ModelData" \
82-
-e "FD_API_PORT=${FD_API_PORT}" \
83-
-e "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}" \
84-
-e "FD_METRICS_PORT=${FD_METRICS_PORT}" \
85-
--gpus '"device='"${DEVICES}"'"' ${docker_image} /bin/bash -c "
86-
git config --global --add safe.directory /workspace/FastDeploy
87-
cd FastDeploy
88-
bash scripts/run_ci.sh
89-
"
20+
echo "The current CI tasks have been migrated to PreCe and will be deprecated soon."

.github/workflows/pr_build_and_test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:cuda126-py310
2323
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
24-
COMPILE_ARCH: "90"
24+
COMPILE_ARCH: "89,90"
2525
WITH_NIGHTLY_BUILD: "OFF"
2626
FD_VERSION: "0.0.0"
2727

@@ -52,3 +52,12 @@ jobs:
5252
PADDLETEST_ARCHIVE_URL: "https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz"
5353
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}
5454
MODEL_CACHE_DIR: "/ssd2/actions-runner/ModelCache"
55+
56+
pre_ce_test:
57+
name: Extracted partial CE model tasks to run in CI.
58+
needs: [clone,build]
59+
uses: ./.github/workflows/_pre_ce_test.yml
60+
with:
61+
DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:fastdeploy-ciuse-cuda126
62+
FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }}
63+
FASTDEPLOY_WHEEL_URL: ${{ needs.build.outputs.wheel_path }}

scripts/coverage_run.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@ run_path="$DIR/../test/"
66
cd ${run_path}
77
ls
88

9-
dirs=("layers" "operators" "worker" "utils")
9+
exclude=("ci_use" "ce")
10+
for d in */ ; do
11+
dir_name="${d%/}"
12+
if [[ -d "$dir_name" ]]; then
13+
skip=false
14+
for ex in "${exclude[@]}"; do
15+
if [[ "$dir_name" == "$ex" ]]; then
16+
skip=true
17+
break
18+
fi
19+
done
20+
if ! $skip; then
21+
dirs+=("$dir_name")
22+
fi
23+
fi
24+
done
25+
1026
failed_tests_file="failed_tests.log"
1127
> "$failed_tests_file"
1228
disabled_tests=(
@@ -20,6 +36,10 @@ disabled_tests=(
2036
operators/test_stop_generation.py
2137
operators/test_air_topp_sampling.py
2238
operators/test_fused_moe.py
39+
layers/test_repetition_early_stopper.py
40+
operators/test_stop_generation_multi_ends.py
41+
utils/test_download.py
42+
graph_optimization/test_cuda_graph.py
2343
)
2444
is_disabled() {
2545
local test_file_rel="$1"

scripts/run_ci.sh renamed to scripts/run_pre_ce.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
33
echo "$DIR"
44

55
# python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
6-
python -m pip install paddlepaddle-gpu==3.0.0.dev20250729 -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
76
python -m pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
87

9-
108
python -m pip install -r requirements.txt
119
python -m pip install jsonschema aistudio_sdk==0.3.5
12-
bash build.sh || exit 1
1310

1411
failed_files=()
1512
run_path="$DIR/../test/ci_use/"

0 commit comments

Comments
 (0)