Skip to content

Release Code and Wheel #93

Release Code and Wheel

Release Code and Wheel #93

#
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is a part of the vllm-ascend project.
#
name: Release Code and Wheel
on:
schedule:
# UTC+8: 10am, 16pm
- cron: '0 2,8 * * *'
push:
tags:
- 'v*'
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.0rc3
jobs:
build_and_release_code:
name: release code
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- 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
run: |
lscpu
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install twine setuptools_scm
- name: Generate tar.gz
env:
SOC_VERSION: ascend910b1
run: |
python3 setup.py sdist
ls dist
- name: Archive tar.gz
uses: actions/upload-artifact@v6
with:
name: vllm-ascend-src
path: dist/*
- name: Release
if: ${{ github.event_name == 'push' }}
run: |
python3 -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
build_and_release_wheel:
name: build and release wheel
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
python-version: ["3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- 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: Free up disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: true
docker-images: false
- name: Build wheel
run: |
ls
docker build -f ./.github/workflows/dockerfiles/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: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Repair wheels with auditwheel
run: |
python3 -m pip install auditwheel
python3 -m pip install patchelf
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
rm -f dist/*.whl
mv dist/repaired/*.whl dist/
rmdir dist/repaired
ls dist
- name: Verify automatic platform tags
run: |
cd dist
for wheel in *.whl; do
echo "verification file: $wheel"
auditwheel show "$wheel"
done
- name: Archive wheel
uses: actions/upload-artifact@v6
with:
name: vllm-ascend-${{ matrix.os }}-py${{ matrix.python-version }}-wheel
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 }}