126 lines
3.6 KiB
YAML
126 lines
3.6 KiB
YAML
#
|
|
# 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: build / wheel
|
|
|
|
on:
|
|
schedule:
|
|
# Runs at 23:00 UTC (7:00 AM Beijing) every day
|
|
- cron: '0 23 * * *'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
- '*-dev'
|
|
paths:
|
|
- '.github/workflows/release_whl.yml'
|
|
- '.github/Dockerfile.buildwheel'
|
|
- 'vllm_ascend/**'
|
|
- 'setup.py'
|
|
- 'pyproject.toml'
|
|
- 'requirements.txt'
|
|
- 'cmake/**'
|
|
- 'CMakeLists.txt'
|
|
- 'csrc/**'
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
name: build and release wheel
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-24.04, ubuntu-24.04-arm]
|
|
# PR only trigger latest version
|
|
python-version: ${{ fromJSON(
|
|
(github.event_name == 'pull_request' && '["3.11"]') ||
|
|
'["3.9", "3.10", "3.11"]'
|
|
) }}
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2
|
|
|
|
- name: Print
|
|
run: |
|
|
lscpu
|
|
|
|
- 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/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 }}
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.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 "libascend*.so" \
|
|
--exclude "libtorch*.so" \
|
|
--exclude "liberror_manager.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@v4
|
|
with:
|
|
name: vllm-ascend-${{ matrix.os }}-py${{ matrix.python-version }}-wheel
|
|
path: dist/*
|
|
|
|
- name: Release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
run: |
|
|
python3 -m pip install twine
|
|
python3 -m twine upload --verbose dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
|