[CI] support build wheel and docker image by workflow (#6453)

Make image and wheel build CI job work with workflow_dispatch way

- vLLM version: v0.14.1
- vLLM main:
dc917cceb8

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan
2026-02-01 20:06:22 +08:00
committed by GitHub
parent b4aafd4293
commit f7dc7d9b86
3 changed files with 111 additions and 70 deletions

View File

@@ -43,10 +43,18 @@ jobs:
tag: arm64 tag: arm64
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
if: ${{ github.event_name != 'workflow_dispatch' }}
with: with:
fetch-depth: 0 fetch-depth: 0
persist-credentials: false persist-credentials: false
- uses: actions/checkout@v6
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ inputs.workflow_dispatch_tag }}
- name: Free up disk space - name: Free up disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with: with:
@@ -148,6 +156,7 @@ jobs:
tags: | tags: |
type=pep440,pattern={{raw}},suffix=${{ env.SUFFIX }} type=pep440,pattern={{raw}},suffix=${{ env.SUFFIX }}
type=schedule,pattern=main,suffix=${{ env.SUFFIX }} type=schedule,pattern=main,suffix=${{ env.SUFFIX }}
type=raw,value=${{ inputs.workflow_dispatch_tag }},enable=${{ github.event_name == 'workflow_dispatch' }},suffix=${{ env.SUFFIX }}
flavor: flavor:
latest=false latest=false

View File

@@ -21,9 +21,14 @@ on:
inputs: inputs:
tag: tag:
description: 'Docker tag for build results' description: 'Docker tag for build results'
type: string
default: main default: main
required: true required: true
type: choice
options:
- main
- v0.15.0rc1
- v0.14.0rc1
- v0.13.0rc2
jobs: jobs:
image_build: image_build:

View File

@@ -25,6 +25,17 @@ on:
tags: tags:
- 'v*' - 'v*'
workflow_dispatch: workflow_dispatch:
inputs:
tag:
description: 'Docker tag for build results'
default: main
required: true
type: choice
options:
- main
- v0.15.0rc1
- v0.14.0rc1
- v0.13.0rc2
jobs: jobs:
build_and_release_code: build_and_release_code:
@@ -34,12 +45,20 @@ jobs:
matrix: matrix:
python-version: ["3.11"] python-version: ["3.11"]
steps: steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2 - name: checkout vllm-ascend
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: actions/checkout@v6
- name: checkout vllm-ascend ${{ inputs.tag }}
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v6
with:
ref: ${{ inputs.tag }}
- name: Print - name: Print
run: | run: |
lscpu lscpu
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with: with:
@@ -76,78 +95,86 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2 - name: checkout vllm-ascend
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: actions/checkout@v6
- name: Free up disk space - name: checkout vllm-ascend ${{ inputs.tag }}
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 if: ${{ github.event_name == 'workflow_dispatch' }}
with: uses: actions/checkout@v6
tool-cache: true with:
docker-images: false ref: ${{ inputs.tag }}
- name: Build wheel - name: Free up disk space
run: | uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
ls with:
docker build -f ./.github/Dockerfile.buildwheel \ tool-cache: true
--build-arg PY_VERSION=${{ matrix.python-version }} \ docker-images: false
-t wheel:v1 .
docker run --rm \
-u $(id -u):$(id -g) \
-v $(pwd):/outpwd \
wheel:v1 \
bash -c "cp -r /workspace/vllm-ascend/dist /outpwd"
ls dist
- name: Set up Python ${{ matrix.python-version }} - name: Build wheel
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 run: |
with: ls
python-version: ${{ matrix.python-version }} docker build -f ./.github/Dockerfile.buildwheel \
--build-arg PY_VERSION=${{ matrix.python-version }} \
-t wheel:v1 .
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/outpwd" \
wheel:v1 \
bash -c "cp -r /workspace/vllm-ascend/dist /outpwd"
ls dist
- name: Repair wheels with auditwheel - name: Set up Python ${{ matrix.python-version }}
run: | uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
python3 -m pip install auditwheel with:
python3 -m pip install patchelf python-version: ${{ matrix.python-version }}
mkdir -p dist/repaired
for whl in dist/*.whl; do
auditwheel repair "$whl" -w dist/repaired/ \
--exclude libplatform.so \
--exclude libregister.so \
--exclude libge_common_base.so \
--exclude libc10.so \
--exclude libc_sec.so \
--exclude libnnopbase.so \
--exclude libprofapi.so \
--exclude libgraph_base.so \
--exclude libgraph.so \
--exclude libexe_graph.so \
--exclude "libascend*.so" \
--exclude "libtorch*.so" \
--exclude "libopapi.so" \
--exclude "liberror_manager.so" \
--exclude "libruntime.so" \
--exclude "libmmpa.so"
done - name: Repair wheels with auditwheel
rm -f dist/*.whl run: |
mv dist/repaired/*.whl dist/ python3 -m pip install auditwheel
rmdir dist/repaired python3 -m pip install patchelf
ls dist mkdir -p dist/repaired
for whl in dist/*.whl; do
auditwheel repair "$whl" -w dist/repaired/ \
--exclude libplatform.so \
--exclude libregister.so \
--exclude libge_common_base.so \
--exclude libc10.so \
--exclude libc_sec.so \
--exclude libnnopbase.so \
--exclude libprofapi.so \
--exclude libgraph_base.so \
--exclude libgraph.so \
--exclude libexe_graph.so \
--exclude "libascend*.so" \
--exclude "libtorch*.so" \
--exclude "libopapi.so" \
--exclude "liberror_manager.so" \
--exclude "libruntime.so" \
--exclude "libmmpa.so"
- name: Verify automatic platform tags done
run: | rm -f dist/*.whl
cd dist mv dist/repaired/*.whl dist/
for wheel in *.whl; do rmdir dist/repaired
echo "verification file: $wheel" ls dist
auditwheel show "$wheel"
done
- name: Archive wheel - name: Verify automatic platform tags
uses: actions/upload-artifact@v6 run: |
with: cd dist
name: vllm-ascend-${{ matrix.os }}-py${{ matrix.python-version }}-wheel for wheel in *.whl; do
path: dist/* echo "verification file: $wheel"
auditwheel show "$wheel"
done
- name: Release - name: Archive wheel
if: ${{ github.event_name == 'push' }} uses: actions/upload-artifact@v6
run: | with:
python3 -m pip install twine name: vllm-ascend-${{ matrix.os }}-py${{ matrix.python-version }}-wheel
python3 -m twine upload --verbose dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} path: dist/*
- name: Release
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
python3 -m pip install twine
python3 -m twine upload --verbose dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}