Skip to content

Commit 1931732

Browse files
committed
solve confilict
2 parents eb089b3 + a5cd7c9 commit 1931732

File tree

566 files changed

+57173
-17746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

566 files changed

+57173
-17746
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Rerun Workflow'
2+
description: 'Re-run GitHub Actions workflow for a given Pull Request'
3+
inputs:
4+
GITHUB_TOKEN:
5+
description: 'GitHub token with repo scope'
6+
required: true
7+
OWNER:
8+
description: 'Repository owner'
9+
required: true
10+
REPO:
11+
description: 'Repository name'
12+
required: true
13+
PR_ID:
14+
description: 'Pull Request ID'
15+
required: true
16+
JOB_NAME:
17+
description: 'Job name to rerun'
18+
required: true
19+
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- run: bash ./.github/actions/rerun-workflow/rerun.sh
24+
shell: bash
25+
env:
26+
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
27+
OWNER: ${{ inputs.OWNER }}
28+
REPO: ${{ inputs.REPO }}
29+
PR_ID: ${{ inputs.PR_ID }}
30+
JOB_NAME: ${{ inputs.JOB_NAME }}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
set -e
16+
17+
COMMIT_SHA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
18+
"https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_ID" | jq -r '.head.sha')
19+
20+
echo "Commit SHA: $COMMIT_SHA"
21+
22+
response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
23+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs?head_sha=$COMMIT_SHA&per_page=100")
24+
25+
echo "Response: $response"
26+
27+
run_ids=$(echo "$response" | jq -r '.workflow_runs[].id')
28+
29+
if [ -n "$run_ids" ]; then
30+
echo "Found run_ids for commit $COMMIT_SHA: $run_ids"
31+
32+
for run_id in $run_ids; do
33+
if [ "$JOB_NAME" = "all-failed" ]; then
34+
echo "Rerunning all failed jobs for run_id: $run_id"
35+
36+
rerun_response=$(curl -X POST -s -w "%{http_code}" -o /dev/null \
37+
-H "Accept: application/vnd.github.v3+json" \
38+
-H "Authorization: Bearer $GITHUB_TOKEN" \
39+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id/rerun-failed-jobs")
40+
if [ "$rerun_response" -eq 201 ]; then
41+
echo "Successfully requested rerun for all blocked jobs in run_id: $run_id"
42+
else
43+
echo "Failed to request rerun for run_id: $run_id with status code $rerun_response"
44+
fi
45+
46+
else
47+
jobs_response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
48+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id/jobs")
49+
50+
echo "Jobs Response for run_id $run_id: $jobs_response"
51+
52+
# if [[ "$JOB_NAME" == *"bypass"* ]]; then
53+
block_jobs=$(echo "$jobs_response" | jq -r --arg job_name "$JOB_NAME" \
54+
'.jobs[] | select(.name == $job_name) | .id')
55+
# else
56+
# block_jobs=$(echo "$jobs_response" | jq -r --arg job_name "$JOB_NAME" \
57+
# '.jobs[] | select(.name == $job_name and .conclusion != "success") | .id')
58+
# fi
59+
60+
if [ -n "$block_jobs" ]; then
61+
echo "Found block jobs for run_id $run_id: $block_jobs"
62+
63+
for job_id in $block_jobs; do
64+
echo "Rerunning job_id: $job_id"
65+
curl -X POST -H "Accept: application/vnd.github.v3+json" \
66+
-H "Authorization: token $GITHUB_TOKEN" \
67+
"https://api.github.com/repos/$OWNER/$REPO/actions/jobs/$job_id/rerun"
68+
done
69+
else
70+
echo "No block jobs found for run_id $run_id with name $JOB_NAME."
71+
fi
72+
fi
73+
done
74+
else
75+
echo "No matching workflow runs found for commit $COMMIT_SHA."
76+
exit 1
77+
fi

.github/copilot-instructions.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# GitHub Copilot Custom Review Instructions
2+
3+
When reviewing code, focus on:
4+
5+
## Security Critical Issues
6+
- Check for hardcoded secrets, API keys, or credentials
7+
- Look for SQL injection and XSS vulnerabilities
8+
- Verify proper input validation and sanitization
9+
- Review authentication and authorization logic
10+
11+
## Performance Red Flags
12+
- Identify N+1 database query problems
13+
- Spot inefficient loops and algorithmic issues
14+
- Check for memory leaks and resource cleanup
15+
- Review caching opportunities for expensive operations
16+
17+
## Code Quality Essentials
18+
- Functions should be focused and appropriately sized
19+
- Use clear, descriptive naming conventions
20+
- Ensure proper error handling throughout
21+
22+
## Review Style
23+
- Be specific and actionable in feedback
24+
- Explain the "why" behind recommendations
25+
- Acknowledge good patterns when you see them
26+
- Ask clarifying questions when code intent is unclear
27+
28+
Always prioritize security vulnerabilities and performance issues that could impact users.
29+
30+
Always suggest changes to improve readability. For example, this suggestion seeks to make the code more readable and also makes the validation logic reusable and testable.
31+
32+
// Instead of:
33+
if (user.email && user.email.includes('@') && user.email.length > 5) {
34+
submitButton.enabled = true;
35+
} else {
36+
submitButton.enabled = false;
37+
}
38+
39+
// Consider:
40+
function isValidEmail(email) {
41+
return email && email.includes('@') && email.length > 5;
42+
}
43+
44+
submitButton.enabled = isValidEmail(user.email);
45+
46+
## Description for pull request
47+
48+
- Please check the title of the Pull Request. It needs to follow the format of [CLASS]Title, for example, [BugFix] Fix memory leak of data processor. If the title is incorrect, provide suggestions on how the committer should modify it.
49+
- Please check the description information of the Pull Request. At a minimum, it should explain why these modifications are being made in this Pull Request and what problem is being solved. If the committer hasn't written the corresponding information or the information is incomplete, prompt the committer to make modifications.
50+
51+
## Language
52+
- For repository members, please reply directly in Simplified Chinese; for external Contributors, reply in English.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Check PR Template
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- 'release/*'
8+
9+
jobs:
10+
check:
11+
name: Check PR Template
12+
if: ${{ github.repository_owner == 'PaddlePaddle' }}
13+
runs-on: ubuntu-latest
14+
env:
15+
PR_ID: ${{ github.event.pull_request.number }}
16+
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
17+
AUTHOR: ${{ github.event.pull_request.user.login }}
18+
19+
steps:
20+
- name: Cleanup
21+
run: |
22+
rm -rf * .[^.]*
23+
24+
- name: Checkout base branch
25+
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ github.event.pull_request.base.ref }}
28+
fetch-depth: 1000
29+
30+
- name: Merge PR to test branch
31+
run: |
32+
git fetch origin pull/${PR_ID}/merge
33+
git checkout -b test FETCH_HEAD
34+
35+
- name: Setup Python 3.10
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: '3.10'
39+
cache: 'pip'
40+
41+
- name: Install Python dependencies
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install httpx
45+
46+
- name: Check PR Template
47+
env:
48+
AGILE_PULL_ID: ${{ env.PR_ID }}
49+
AGILE_COMPILE_BRANCH: ${{ env.BASE_BRANCH }}
50+
AGILE_CHECKIN_AUTHOR: ${{ env.AUTHOR }}
51+
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
run: |
53+
python scripts/CheckPRTemplate.py; EXCODE=$?
54+
exit $EXCODE

.github/workflows/_accuracy_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ jobs:
7676
DEVICES=$(echo "$CARD_ID" | fold -w1 | paste -sd,)
7777
DEVICE_PORT=$(echo "$DEVICES" | cut -d',' -f1)
7878
79-
FLASK_PORT=$((42068 + DEVICE_PORT * 100))
80-
FD_API_PORT=$((42088 + DEVICE_PORT * 100))
81-
FD_ENGINE_QUEUE_PORT=$((42058 + DEVICE_PORT * 100))
82-
FD_METRICS_PORT=$((42078 + DEVICE_PORT * 100))
83-
FD_CACHE_QUEUE_PORT=$((42098 + DEVICE_PORT * 100))
79+
FLASK_PORT=$((8068 + DEVICE_PORT * 100))
80+
FD_API_PORT=$((8088 + DEVICE_PORT * 100))
81+
FD_ENGINE_QUEUE_PORT=$((8058 + DEVICE_PORT * 100))
82+
FD_METRICS_PORT=$((8078 + DEVICE_PORT * 100))
83+
FD_CACHE_QUEUE_PORT=$((8098 + DEVICE_PORT * 100))
8484
echo "Test ENV Parameter:"
8585
echo "========================================================="
8686
echo "FLASK_PORT=${FLASK_PORT}"

.github/workflows/_base_test.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ jobs:
7676
DEVICES=$(echo "$CARD_ID" | fold -w1 | paste -sd,)
7777
DEVICE_PORT=$(echo "$DEVICES" | cut -d',' -f1)
7878
79-
FLASK_PORT=$((42068 + DEVICE_PORT * 100))
80-
FD_API_PORT=$((42088 + DEVICE_PORT * 100))
81-
FD_ENGINE_QUEUE_PORT=$((42058 + DEVICE_PORT * 100))
82-
FD_METRICS_PORT=$((42078 + DEVICE_PORT * 100))
83-
FD_CACHE_QUEUE_PORT=$((42098 + DEVICE_PORT * 100))
79+
FLASK_PORT=$((8068 + DEVICE_PORT * 100))
80+
FD_API_PORT=$((8088 + DEVICE_PORT * 100))
81+
FD_ENGINE_QUEUE_PORT=$((8058 + DEVICE_PORT * 100))
82+
FD_METRICS_PORT=$((8078 + DEVICE_PORT * 100))
83+
FD_CACHE_QUEUE_PORT=$((8098 + DEVICE_PORT * 100))
8484
echo "Test ENV Parameter:"
8585
echo "========================================================="
8686
echo "FLASK_PORT=${FLASK_PORT}"
@@ -206,20 +206,6 @@ jobs:
206206
check_service 90
207207
python -m pytest -sv test_max_waiting_time.py || TEST_EXIT_CODE=1
208208
209-
curl -X POST http://0.0.0.0:${FLASK_PORT}/switch \
210-
-H "Content-Type: application/json" \
211-
-d "{\"--model\": \"/MODELDATA/ernie-4_5-21b-a3b-bf16-paddle\", \"--config\": \"21b_mtp.yaml\", \"--enable-logprob\": \"False\"}"
212-
check_service 180
213-
export TEMPLATE=TOKEN_NORMAL
214-
python -m pytest -sv test_seed_usage.py -k "not test_seed_stream" || TEST_EXIT_CODE=1
215-
216-
curl -X POST http://0.0.0.0:${FLASK_PORT}/switch \
217-
-H "Content-Type: application/json" \
218-
-d "{\"--model\": \"/MODELDATA/ernie-4_5-21b-a3b-bf16-paddle\", \"--config\": \"21b_sot.yaml\", \"--enable-logprob\": \"False\"}"
219-
check_service 360
220-
export TEMPLATE=TOKEN_NORMAL
221-
python -m pytest -sv test_seed_usage.py -k "not test_seed_stream" || TEST_EXIT_CODE=1
222-
223209
popd
224210
echo "TEST_EXIT_CODE=${TEST_EXIT_CODE}" >> /workspace/FastDeploy/exit_code.env
225211
'

.github/workflows/_logprob_test_linux.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ jobs:
6868
DEVICES=$(echo "$CARD_ID" | fold -w1 | paste -sd,)
6969
DEVICE_PORT=$(echo "$DEVICES" | cut -d',' -f1)
7070
71-
FLASK_PORT=$((42068 + DEVICE_PORT * 100))
72-
FD_API_PORT=$((42088 + DEVICE_PORT * 100))
73-
FD_ENGINE_QUEUE_PORT=$((42058 + DEVICE_PORT * 100))
74-
FD_METRICS_PORT=$((42078 + DEVICE_PORT * 100))
75-
FD_CACHE_QUEUE_PORT=$((42098 + DEVICE_PORT * 100))
71+
FLASK_PORT=$((8068 + DEVICE_PORT * 100))
72+
FD_API_PORT=$((8088 + DEVICE_PORT * 100))
73+
FD_ENGINE_QUEUE_PORT=$((8058 + DEVICE_PORT * 100))
74+
FD_METRICS_PORT=$((8078 + DEVICE_PORT * 100))
75+
FD_CACHE_QUEUE_PORT=$((8098 + DEVICE_PORT * 100))
7676
echo "Test ENV Parameter:"
7777
echo "========================================================="
7878
echo "FLASK_PORT=${FLASK_PORT}"

.github/workflows/_pre_ce_test.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,26 @@ jobs:
7777
DEVICES=$(echo "$CARD_ID" | fold -w1 | paste -sd,)
7878
DEVICE_PORT=$(echo "$DEVICES" | cut -d',' -f1)
7979
80-
FLASK_PORT=$((42068 + DEVICE_PORT * 100))
81-
FD_API_PORT=$((42088 + DEVICE_PORT * 100))
82-
FD_ENGINE_QUEUE_PORT=$((42058 + DEVICE_PORT * 100))
83-
FD_METRICS_PORT=$((42078 + DEVICE_PORT * 100))
84-
FD_CACHE_QUEUE_PORT=$((42098 + DEVICE_PORT * 100))
85-
FD_ZMQ_RECV_REQUEST_SERVER_PORT=$((42048 + DEVICE_PORT * 100))
86-
FD_ZMQ_SEND_RESPONSE_SERVER_PORT=$((42038 + DEVICE_PORT * 100))
87-
FD_ZMQ_CONTROL_CMD_SERVER_PORTS=$((42028 + DEVICE_PORT * 100))
80+
FLASK_PORT=$((8068 + DEVICE_PORT * 100))
81+
FD_API_PORT=$((8088 + DEVICE_PORT * 100))
82+
FD_ENGINE_QUEUE_PORT=$((8058 + DEVICE_PORT * 100))
83+
FD_METRICS_PORT=$((8078 + DEVICE_PORT * 100))
84+
FD_CACHE_QUEUE_PORT=$((8098 + DEVICE_PORT * 100))
85+
FD_CONTROLLER_PORT=$((8018 + DEVICE_PORT * 100))
86+
FD_ZMQ_RECV_REQUEST_SERVER_PORT=$((8048 + DEVICE_PORT * 100))
87+
FD_ZMQ_SEND_RESPONSE_SERVER_PORT=$((8038 + DEVICE_PORT * 100))
88+
FD_ZMQ_CONTROL_CMD_SERVER_PORTS=$((8028 + DEVICE_PORT * 100))
8889
echo "Test ENV Parameter:"
8990
echo "========================================================="
9091
echo "FLASK_PORT=${FLASK_PORT}"
9192
echo "FD_API_PORT=${FD_API_PORT}"
9293
echo "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}"
9394
echo "FD_METRICS_PORT=${FD_METRICS_PORT}"
9495
echo "FD_CACHE_QUEUE_PORT=${FD_CACHE_QUEUE_PORT}"
96+
echo "FD_CONTROLLER_PORT=${FD_CONTROLLER_PORT}"
97+
echo "FD_ZMQ_RECV_REQUEST_SERVER_PORT=${FD_ZMQ_RECV_REQUEST_SERVER_PORT}"
98+
echo "FD_ZMQ_SEND_RESPONSE_SERVER_PORT=${FD_ZMQ_SEND_RESPONSE_SERVER_PORT}"
99+
echo "FD_ZMQ_CONTROL_CMD_SERVER_PORTS=${FD_ZMQ_CONTROL_CMD_SERVER_PORTS}"
95100
echo "DEVICES=${DEVICES}"
96101
echo "========================================================="
97102
@@ -140,7 +145,11 @@ jobs:
140145
-e "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}" \
141146
-e "FD_METRICS_PORT=${FD_METRICS_PORT}" \
142147
-e "FD_CACHE_QUEUE_PORT=${FD_CACHE_QUEUE_PORT}" \
148+
-e "FD_CONTROLLER_PORT=${FD_CONTROLLER_PORT}" \
143149
-e "FLASK_PORT=${FLASK_PORT}" \
150+
-e "FD_ZMQ_RECV_REQUEST_SERVER_PORT=${FD_ZMQ_RECV_REQUEST_SERVER_PORT}" \
151+
-e "FD_ZMQ_SEND_RESPONSE_SERVER_PORT=${FD_ZMQ_SEND_RESPONSE_SERVER_PORT}" \
152+
-e "FD_ZMQ_CONTROL_CMD_SERVER_PORTS=${FD_ZMQ_CONTROL_CMD_SERVER_PORTS}" \
144153
-e "fd_wheel_url=${fd_wheel_url}" \
145154
--gpus "\"device=${DEVICES}\"" ${docker_image} /bin/bash -c '
146155
git config --global --add safe.directory /workspace/FastDeploy

.github/workflows/_stable_test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ jobs:
7676
DEVICES=$(echo "$CARD_ID" | fold -w1 | paste -sd,)
7777
DEVICE_PORT=$(echo "$DEVICES" | cut -d',' -f1)
7878
79-
FLASK_PORT=$((42068 + DEVICE_PORT * 100))
80-
FD_API_PORT=$((42088 + DEVICE_PORT * 100))
81-
FD_ENGINE_QUEUE_PORT=$((42058 + DEVICE_PORT * 100))
82-
FD_METRICS_PORT=$((42078 + DEVICE_PORT * 100))
83-
FD_CACHE_QUEUE_PORT=$((42038 + DEVICE_PORT * 100))
84-
FD_INFERENCE_MSG_QUEUE_ID=$(( 42048 + DEVICE_PORT * 100))
79+
FLASK_PORT=$((8068 + DEVICE_PORT * 100))
80+
FD_API_PORT=$((8088 + DEVICE_PORT * 100))
81+
FD_ENGINE_QUEUE_PORT=$((8058 + DEVICE_PORT * 100))
82+
FD_METRICS_PORT=$((8078 + DEVICE_PORT * 100))
83+
FD_CACHE_QUEUE_PORT=$((8038 + DEVICE_PORT * 100))
84+
FD_INFERENCE_MSG_QUEUE_ID=$(( 8048 + DEVICE_PORT * 100))
8585
echo "Test ENV Parameter:"
8686
echo "========================================================="
8787
echo "FLASK_PORT=${FLASK_PORT}"

0 commit comments

Comments
 (0)