-
Notifications
You must be signed in to change notification settings - Fork 742
[CI] Support multi-Python version build (3.10/3.11/3.12) #7230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
4dfdeef
ec4c9fa
107dccc
fdc7cf5
79e2857
7d80249
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ on: | |
| description: "Build Images" | ||
| required: true | ||
| type: string | ||
| default: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:cuda126-py310" | ||
| default: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleqa:fastdeploy-build-cuda126-manylinux" | ||
| FASTDEPLOY_ARCHIVE_URL: | ||
| description: "URL of the compressed FastDeploy code archive." | ||
| required: true | ||
|
|
@@ -53,6 +53,11 @@ on: | |
| required: false | ||
| type: string | ||
| default: "" | ||
| PYTHON_VERSION: | ||
| description: "Python version to use (3.10, 3.11, 3.12)" | ||
| required: false | ||
| type: string | ||
| default: "3.10" | ||
| outputs: | ||
| wheel_path: | ||
| description: "Output path of the generated wheel" | ||
|
|
@@ -138,6 +143,7 @@ jobs: | |
| PADDLE_WHL_URL: ${{ inputs.PADDLE_WHL_URL }} | ||
| WITH_NIGHTLY_BUILD: ${{ inputs.WITH_NIGHTLY_BUILD }} | ||
| FD_UNIFY_BUILD: ${{ inputs.FD_UNIFY_BUILD }} | ||
| PYTHON_VERSION: ${{ inputs.PYTHON_VERSION }} | ||
| run: | | ||
| set -x | ||
| runner_name="${{ runner.name }}" | ||
|
|
@@ -173,8 +179,22 @@ jobs: | |
| -e "PADDLE_WHL_URL=${PADDLE_WHL_URL}" \ | ||
| -e "BRANCH_REF=${BRANCH_REF}" \ | ||
| -e "CCACHE_MAXSIZE=50G" \ | ||
| -e "PYTHON_VERSION=${PYTHON_VERSION}" \ | ||
| -e "no_proxy=localhost,127.0.0.1,0.0.0.0,bcebos.com,.bcebos.com,bj.bcebos.com,su.bcebos.com,paddle-ci.gz.bcebos.com,apiin.im.baidu.com,baidu-int.com,.baidu.com,aliyun.com,gitee.com,pypi.tuna.tsinghua.edu.cn,.tuna.tsinghua.edu.cn" \ | ||
| --gpus "\"device=${gpu_id}\"" ${docker_image} /bin/bash -c ' | ||
| # Switch Python environment based on PYTHON_VERSION | ||
| if [[ "${PYTHON_VERSION}" == "3.11" ]]; then | ||
| export LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} | ||
This comment was marked as outdated.
Sorry, something went wrong. |
||
| export PATH=/opt/_internal/cpython-3.11.0/bin/:${PATH} | ||
| elif [[ "${PYTHON_VERSION}" == "3.12" ]]; then | ||
| export LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} | ||
| export PATH=/opt/_internal/cpython-3.12.0/bin/:${PATH} | ||
| else | ||
| # Default to Python 3.10 | ||
| export LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} | ||
| export PATH=/opt/_internal/cpython-3.10.0/bin/:${PATH} | ||
| fi | ||
|
|
||
| if [[ -n "${FD_VERSION}" ]]; then | ||
| export FASTDEPLOY_VERSION=${FD_VERSION} | ||
| echo "Custom FastDeploy version: ${FASTDEPLOY_VERSION}" | ||
|
|
@@ -202,8 +222,15 @@ jobs: | |
| pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple | ||
|
|
||
| python -m pip install --upgrade pip | ||
| python -m pip install -r requirements.txt | ||
| python -m pip install wheel | ||
| # Install jinja2 for custom ops code generation (required for 3.11/3.12) | ||
| python -m pip install jinja2 wheel | ||
| # Skip cp310-specific wheels for non-3.10 Python versions | ||
This comment was marked as outdated.
Sorry, something went wrong. |
||
| if [[ "${PYTHON_VERSION}" != "3.10" ]]; then | ||
| grep -v "cp310-cp310" requirements.txt > requirements_filtered.txt | ||
| python -m pip install -r requirements_filtered.txt || true | ||
This comment was marked as outdated.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 建议 |
||
| else | ||
| python -m pip install -r requirements.txt || true | ||
| fi | ||
| # 编译RDMA | ||
| export FD_ENABLE_RDMA_COMPILE=1 | ||
| export FD_UNIFY_BUILD="${FD_UNIFY_BUILD}" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| name: CI_METAX | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| branches: | ||
| - develop | ||
| - release/** | ||
| #on: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ 疑问 |
||
| # pull_request_target: | ||
| # types: | ||
| # - opened | ||
| # - synchronize | ||
| # branches: | ||
| # - develop | ||
| # - release/** | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ 疑问 路径
/opt/_internal/cpython-3.11.0/硬编码了具体补丁版本号。若镜像实际安装的是 3.11.5 等更高补丁版本,export 会指向不存在的路径,PATH 前缀静默失效后回落到镜像默认 Python,导致实际版本与预期不符且无任何报错。建议切换后立即校验:python3 --version | grep -q "3.11" || { echo "ERROR: wrong python version"; exit 1; }。同样问题存在于 cu129/cu130 变体。