Skip to content

Commit d66660a

Browse files
authored
[CI] fix run_ci error in release/2.0.4 (#3411)
1 parent f0519ae commit d66660a

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,29 @@ jobs:
6767
gpu_id=0
6868
DEVICES="0,1"
6969
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))
70+
71+
FLASK_PORT=$((41068 + gpu_id * 100))
72+
FD_API_PORT=$((41088 + gpu_id * 100))
73+
FD_ENGINE_QUEUE_PORT=$((41058 + gpu_id * 100))
74+
FD_METRICS_PORT=$((41078 + gpu_id * 100))
75+
76+
PORTS=($FLASK_PORT $FD_API_PORT $FD_ENGINE_QUEUE_PORT $FD_METRICS_PORT)
77+
LOG_FILE="./port_cleanup_$(date +%Y%m%d_%H%M%S).log"
78+
echo "==== LOG_FILE is ${LOG_FILE} ===="
79+
80+
echo "==== PORT CLEAN BEFORE TASK RUN ====" | tee -a $LOG_FILE
81+
82+
for port in "${PORTS[@]}"; do
83+
PIDS=$(lsof -t -i :$port || true)
84+
if [ -n "$PIDS" ]; then
85+
echo "Port $port is occupied by PID(s): $PIDS" | tee -a $LOG_FILE
86+
echo "$PIDS" | xargs -r kill -9
87+
echo "Port $port cleared" | tee -a $LOG_FILE
88+
else
89+
echo "Port $port is free" | tee -a $LOG_FILE
90+
fi
91+
done
92+
echo "==== PORT CLEAN COMPLETE ====" | tee -a $LOG_FILE
7393
7494
PARENT_DIR=$(dirname "$WORKSPACE")
7595
echo "PARENT_DIR:$PARENT_DIR"

scripts/run_ci.sh

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

55
python -m pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
6-
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
6+
python -m pip install paddlepaddle-gpu==3.1.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
77
python -m pip install -r requirements.txt
88
python -m pip install jsonschema aistudio_sdk==0.3.5
99
bash build.sh || exit 1
@@ -24,7 +24,7 @@ for subdir in "$run_path"*/; do
2424
echo "------------------------------------------------------------"
2525

2626
set +e
27-
timeout 360 python -m pytest --disable-warnings -sv "$file"
27+
timeout 600 python -m pytest --disable-warnings -sv "$file"
2828
exit_code=$?
2929
set -e
3030

@@ -44,7 +44,7 @@ for subdir in "$run_path"*/; do
4444
if [ "$exit_code" -eq 1 ] || [ "$exit_code" -eq 124 ]; then
4545
echo "[ERROR] $file 起服务或执行异常,exit_code=$exit_code"
4646
if [ "$exit_code" -eq 124 ]; then
47-
echo "[TIMEOUT] $file 脚本执行超过 6 分钟, 任务超时退出!"
47+
echo "[TIMEOUT] $file 脚本执行超过 10 分钟, 任务超时退出!"
4848
fi
4949
fi
5050

test/ci_use/EB_Lite/test_EB_Lite_serving.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ def test_non_streaming_chat_with_min_tokens(openai_client, capsys):
707707
model="default",
708708
messages=[{"role": "user", "content": "Hello, how are you?"}],
709709
temperature=1,
710+
max_tokens=1010,
710711
extra_body={"min_tokens": min_tokens},
711712
stream=False,
712713
)

test/ci_use/EB_VL_Lite/test_EB_VL_Lite_serving.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ def setup_and_run_server():
129129
start_new_session=True, # Enables killing full group via os.killpg
130130
)
131131

132-
# Wait up to 300 seconds for API server to be ready
133-
for _ in range(300):
132+
# Wait up to 600 seconds for API server to be ready
133+
for _ in range(600):
134134
if is_port_open("127.0.0.1", FD_API_PORT):
135135
print(f"API server is up on port {FD_API_PORT}")
136136
break
137137
time.sleep(1)
138138
else:
139-
print("[TIMEOUT] API server failed to start in 5 minutes. Cleaning up...")
139+
print("[TIMEOUT] API server failed to start in 10 minutes. Cleaning up...")
140140
try:
141141
os.killpg(process.pid, signal.SIGTERM)
142142
except Exception as e:
@@ -229,9 +229,9 @@ def test_consistency_between_runs(api_url, headers, consistent_payload):
229229
# base result
230230
base_path = os.getenv("MODEL_PATH")
231231
if base_path:
232-
base_file = os.path.join(base_path, "ernie-4_5-vl-base-tp2")
232+
base_file = os.path.join(base_path, "ernie-4_5-vl-base-tp2-204")
233233
else:
234-
base_file = "ernie-4_5-vl-base-tp2"
234+
base_file = "ernie-4_5-vl-base-tp2-204"
235235
with open(base_file, "r") as f:
236236
content2 = f.read()
237237

0 commit comments

Comments
 (0)