From 722110a952797edd21317c25fadae9c45cf3ee5e Mon Sep 17 00:00:00 2001 From: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com> Date: Tue, 4 Nov 2025 18:56:38 +0800 Subject: [PATCH] [CI] Refactor CE wheel upload for multiple target paths (#4790) * [CI] Refactor CE wheel upload for multiple target paths * [CI] fix test_streaming_with_stop_str error --- .github/workflows/ce_job.yml | 62 +++++++++++++------- tests/ci_use/EB_Lite/test_EB_Lite_serving.py | 2 +- tests/e2e/test_EB_Lite_serving.py | 2 +- 3 files changed, 44 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ce_job.yml b/.github/workflows/ce_job.yml index e84e1c8a1..a33587531 100644 --- a/.github/workflows/ce_job.yml +++ b/.github/workflows/ce_job.yml @@ -191,20 +191,31 @@ jobs: commit_id=${{ github.sha }} branch_name=${{ github.ref_name }} - target_path=paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM${COMPILE_ARCH//,/_}/${branch_name}/${commit_id} - wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py + wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py push_file=$(realpath bos_tools.py) python -m pip install bce-python-sdk==0.9.29 - ls - python ${push_file} ${filename} ${target_path} - target_path_stripped="${target_path#paddle-qa/}" - WHEEL_PATH=https://paddle-qa.bj.bcebos.com/${target_path_stripped}/${filename} - target_path_latest=paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM${COMPILE_ARCH//,/_}/${branch_name}/latest - python ${push_file} ${filename} ${target_path_latest} - target_path_stripped_latest="${target_path_latest#paddle-qa/}" - WHEEL_PATH_LATEST=https://paddle-qa.bj.bcebos.com/${target_path_stripped_latest}/${filename} + target_paths=( + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/SM${COMPILE_ARCH//,/_}/${branch_name}/${commit_id}" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM_80/${branch_name}/${commit_id}" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM_90/${branch_name}/${commit_id}" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/SM${COMPILE_ARCH//,/_}/${branch_name}/latest" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM_80/${branch_name}/latest" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM_90/${branch_name}/latest" + ) + + for target_path in "${target_paths[@]}"; do + echo "Uploading ${filename} to ${target_path}" + python "${push_file}" "${filename}" "${target_path}" + done + + base_prefix="paddle-qa/" + commit_path_stripped="${target_paths[0]#${base_prefix}}" + latest_path_stripped="${target_paths[3]#${base_prefix}}" + WHEEL_PATH="https://paddle-qa.bj.bcebos.com/${commit_path_stripped}/${filename}" + WHEEL_PATH_LATEST="https://paddle-qa.bj.bcebos.com/${latest_path_stripped}/${filename}" + echo "commit wheel url is ${WHEEL_PATH}" echo "latest wheel url is ${WHEEL_PATH_LATEST}" @@ -230,19 +241,30 @@ jobs: commit_id=${{ github.sha }} branch_name=${{ github.ref_name }} - target_path=paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM${COMPILE_ARCH//,/_}/${branch_name}/${commit_id} - wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py + wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py push_file=$(realpath bos_tools.py) python -m pip install bce-python-sdk==0.9.29 - ls - python ${push_file} ${filename} ${target_path} - target_path_stripped="${target_path#paddle-qa/}" - WHEEL_PATH=https://paddle-qa.bj.bcebos.com/${target_path_stripped}/${filename} - target_path_latest=paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM${COMPILE_ARCH//,/_}/${branch_name}/latest - python ${push_file} ${filename} ${target_path_latest} - target_path_stripped_latest="${target_path_latest#paddle-qa/}" - WHEEL_PATH_LATEST=https://paddle-qa.bj.bcebos.com/${target_path_stripped_latest}/${filename} + target_paths=( + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/SM${COMPILE_ARCH//,/_}/${branch_name}/${commit_id}" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM_86/${branch_name}/${commit_id}" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM_89/${branch_name}/${commit_id}" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/SM${COMPILE_ARCH//,/_}/${branch_name}/latest" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM_86/${branch_name}/latest" + "paddle-qa/paddle-pipeline/FastDeploy_ActionCE/cu126/SM_89/${branch_name}/latest" + ) + + for target_path in "${target_paths[@]}"; do + echo "Uploading ${filename} to ${target_path}" + python "${push_file}" "${filename}" "${target_path}" + done + + base_prefix="paddle-qa/" + commit_path_stripped="${target_paths[0]#${base_prefix}}" + latest_path_stripped="${target_paths[3]#${base_prefix}}" + WHEEL_PATH="https://paddle-qa.bj.bcebos.com/${commit_path_stripped}/${filename}" + WHEEL_PATH_LATEST="https://paddle-qa.bj.bcebos.com/${latest_path_stripped}/${filename}" + echo "commit wheel url is ${WHEEL_PATH}" echo "latest wheel url is ${WHEEL_PATH_LATEST}" diff --git a/tests/ci_use/EB_Lite/test_EB_Lite_serving.py b/tests/ci_use/EB_Lite/test_EB_Lite_serving.py index 1e4944390..baeeb2598 100644 --- a/tests/ci_use/EB_Lite/test_EB_Lite_serving.py +++ b/tests/ci_use/EB_Lite/test_EB_Lite_serving.py @@ -425,7 +425,7 @@ def test_streaming_with_stop_str(openai_client): last_token = "" for chunk in response: last_token = chunk.choices[0].delta.content - assert last_token == "" + assert last_token.endswith("") response = openai_client.chat.completions.create( model="default", diff --git a/tests/e2e/test_EB_Lite_serving.py b/tests/e2e/test_EB_Lite_serving.py index ef489ff4c..28d3d912a 100644 --- a/tests/e2e/test_EB_Lite_serving.py +++ b/tests/e2e/test_EB_Lite_serving.py @@ -589,7 +589,7 @@ def test_streaming_with_stop_str(openai_client): last_token = "" for chunk in response: last_token = chunk.choices[0].delta.content - assert last_token == "" + assert last_token.endswith("") response = openai_client.chat.completions.create( model="default",