diff --git a/.github/format_pr_body.sh b/.github/format_pr_body.sh deleted file mode 100755 index 113b3d32..00000000 --- a/.github/format_pr_body.sh +++ /dev/null @@ -1,59 +0,0 @@ -# -# 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. -# Adapted from vllm/.github/scripts/cleanup_pr_body.sh - -#!/bin/bash - -set -eux - -# ensure 2 argument is passed -if [ "$#" -ne 3 ]; then - echo "Usage: $0 " - exit 1 -fi - -PR_NUMBER=$1 -VLLM_VERSION=$2 -VLLM_COMMIT=$3 -OLD=/tmp/orig_pr_body.txt -NEW=/tmp/new_pr_body.txt -FINAL=/tmp/final_pr_body.txt - -gh pr view --json body --template "{{.body}}" "${PR_NUMBER}" > "${OLD}" -cp "${OLD}" "${NEW}" - -# Remove notes in pr description and add vLLM version and commit -sed -i '//d' "${NEW}" -sed -i '/- vLLM .*$/d' "${NEW}" -{ - echo "" - echo "- vLLM version: $VLLM_VERSION" - echo "- vLLM main: $VLLM_COMMIT" -} >> "${NEW}" - -# Remove redundant empty lines -uniq "${NEW}" > "${FINAL}" - -# Run this only if ${NEW} is different than ${OLD} -if ! cmp -s "${OLD}" "${FINAL}"; then - echo - echo "Updating PR body:" - echo - cat "${NEW}" - gh pr edit --body-file "${FINAL}" "${PR_NUMBER}" -else - echo "No changes needed" -fi diff --git a/.github/labeler.yml b/.github/labeler.yml index cf82d002..d3394968 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -8,8 +8,8 @@ documentation: ci/build: - changed-files: - any-glob-to-any-file: - - '.github/actions/*.yml' - - '.github/workflows/*.yml' + - '.github/actions/*.yaml' + - '.github/workflows/*.yaml' 'module:tests': - changed-files: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/_pre_commit.yml similarity index 100% rename from .github/workflows/pre-commit.yml rename to .github/workflows/_pre_commit.yml diff --git a/.github/workflows/format_pr_body.yaml b/.github/workflows/format_pr_body.yaml deleted file mode 100644 index 079345a1..00000000 --- a/.github/workflows/format_pr_body.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# -# 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: format / pr body - -on: - # The PR updated when PR opened and push new commits - pull_request_target: - types: [opened, synchronize] - branches: - - 'main' - -permissions: - pull-requests: write - -jobs: - update-description: - name: update vLLM version - runs-on: ubuntu-latest - - steps: - - - name: Get vLLM version - run: | - VLLM_COMMIT=ad32e3e19ccf0526cb6744a5fed09a138a5fb2f9 - echo "VLLM_COMMIT=https://github.com/vllm-project/vllm/commit/$VLLM_COMMIT" >> $GITHUB_ENV - - - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.2.2 - - - name: Set up Python - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - - - name: Get vLLM release version - run: | - VLLM_VERSION=$(python3 docs/source/conf.py | jq .ci_vllm_version | tr -d '"') - echo "VLLM_VERSION=$VLLM_VERSION" >> $GITHUB_ENV - - - name: Update PR description - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - bash .github/format_pr_body.sh "${{ github.event.number }}" "${{ env.VLLM_VERSION }}" "${{ env.VLLM_COMMIT }}" diff --git a/.github/workflows/image_310p_openeuler.yml b/.github/workflows/image_310p_openeuler.yml deleted file mode 100644 index 37abca3b..00000000 --- a/.github/workflows/image_310p_openeuler.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: 'image / openEuler / 310p' -# This is a docker build check and publish job: -# 1. PR Triggered docker image build check -# - is for image build check -# - Enable on main/*-dev branch -# - push: ${{ github.event_name != 'pull_request' }} ==> false -# 2. branches push trigger image publish -# - is for branch/dev/nightly image -# - commits are merge into main/*-dev ==> vllm-ascend:main-310p-openeuler / vllm-ascend:*-dev-310p-openeuler -# 3. tags push trigger image publish -# - is for final release image -# - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3-310p-openeuler / vllm-ascend:v1.2.3rc1-310p-openeuler -on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/image_310p_openeuler.yml' - - 'Dockerfile.310p.openEuler' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - types: [ labeled ] - push: - # Publish image when tagging, the Dockerfile in tag will be build as tag image - branches: - - 'main' - - '*-dev' - tags: - - 'v*' - paths: - - '.github/workflows/image_310p_openeuler.yml' - - 'Dockerfile.310p.openEuler' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - -# only cancel in-progress runs of the same workflow -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: vllm-ascend image build - # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 - # Push event or PR with both 'ready' and 'ready-for-test' labels - runs-on: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'ubuntu-latest' || - 'ubuntu-24.04-arm' - }} - if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} - steps: - - uses: actions/checkout@v6.0.1 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Print - run: | - lscpu - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # TODO(yikun): add more hub image and a note on release policy for container image - images: | - quay.io/ascend/vllm-ascend - # Note for test case - # https://github.com/marketplace/actions/docker-metadata-action#typeref - # 1. branch job pulish per main/*-dev branch commits - # 2. main and dev pull_request is build only, so the tag pr-N-310p-openeuler is fine - # 3. only pep440 matched tag will be published: - # - v0.7.1 --> v0.7.1-310p-openeuler - # - pre/post/dev: v0.7.1rc1-310p-openeuler/v0.7.1rc1-310p-openeuler/v0.7.1rc1.dev1-310p-openeuler/v0.7.1.post1-310p-openeuler, no latest - # which follow the rule from vLLM with prefix v - # TODO(yikun): the post release might be considered as latest release - tags: | - type=ref,event=branch,suffix=-310p-openeuler - type=ref,event=pr,suffix=-310p-openeuler - type=pep440,pattern={{raw}},suffix=-310p-openeuler - flavor: - latest=false - - - name: Free up disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: true - docker-images: false - - - name: Build - Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Build - Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Publish - Login to Quay Container Registry - if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Build and push 310p - uses: docker/build-push-action@v6 - with: - platforms: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'linux/amd64,linux/arm64' || - 'linux/arm64' - }} - # use the current repo path as the build context, ensure .git is contained - context: . - # only trigger when tag, branch/main push - push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - file: Dockerfile.310p.openEuler - build-args: | - PIP_INDEX_URL=https://pypi.org/simple - provenance: false diff --git a/.github/workflows/image_310p_ubuntu.yml b/.github/workflows/image_310p_ubuntu.yml deleted file mode 100644 index 638b8492..00000000 --- a/.github/workflows/image_310p_ubuntu.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: 'image / Ubuntu / 310p' -# This is a docker build check and publish job: -# 1. PR Triggered docker image build check -# - is for image build check -# - Enable on main/*-dev branch -# - push: ${{ github.event_name != 'pull_request' }} ==> false -# 2. branches push trigger image publish -# - is for branch/dev/nightly image -# - commits are merge into main/*-dev ==> vllm-ascend:main-310p / vllm-ascend:*-dev-310p -# 3. tags push trigger image publish -# - is for final release image -# - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3-310p / vllm-ascend:v1.2.3rc1-310p -on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/image_310p_ubuntu.yml' - - 'Dockerfile.310p' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - types: [ labeled ] - push: - # Publish image when tagging, the Dockerfile in tag will be build as tag image - branches: - - 'main' - - '*-dev' - tags: - - 'v*' - paths: - - '.github/workflows/image_310p_ubuntu.yml' - - 'Dockerfile.310p' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - -# only cancel in-progress runs of the same workflow -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - - build: - name: vllm-ascend image build - # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 - # Push event or PR with both 'ready' and 'ready-for-test' labels - runs-on: ubuntu-latest - if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} - steps: - - uses: actions/checkout@v6.0.1 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Print - run: | - lscpu - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # TODO(yikun): add more hub image and a note on release policy for container image - images: | - quay.io/ascend/vllm-ascend - # Note for test case - # https://github.com/marketplace/actions/docker-metadata-action#typeref - # 1. branch job pulish per main/*-dev branch commits - # 2. main and dev pull_request is build only, so the tag pr-N is fine - # 3. only pep440 matched tag will be published: - # - v0.7.1 --> v0.7.1-310p - # - pre/post/dev: v0.7.1rc1-310p/v0.7.1rc1-310p/v0.7.1rc1.dev1-310p/v0.7.1.post1-310p, no latest - # which follow the rule from vLLM with prefix v - # TODO(yikun): the post release might be considered as latest release - tags: | - type=ref,event=branch,suffix=-310p - type=ref,event=pr,suffix=-310p - type=pep440,pattern={{raw}},suffix=-310p - flavor: - latest=false - - - name: Free up disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: true - docker-images: false - - - name: Build - Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Build - Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Publish - Login to Quay Container Registry - if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Build and push 310p - uses: docker/build-push-action@v6 - with: - platforms: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'linux/amd64,linux/arm64' || - 'linux/amd64' - }} - # use the current repo path as the build context, ensure .git is contained - context: . - file: Dockerfile.310p - # only trigger when tag, branch/main push - push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - build-args: | - PIP_INDEX_URL=https://pypi.org/simple - provenance: false \ No newline at end of file diff --git a/.github/workflows/image_a3_openeuler.yml b/.github/workflows/image_a3_openeuler.yml deleted file mode 100644 index d059693a..00000000 --- a/.github/workflows/image_a3_openeuler.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: 'image / openEuler / a3' -# This is a docker build check and publish job: -# 1. PR Triggered docker image build check -# - is for image build check -# - Enable on main/*-dev branch -# - push: ${{ github.event_name != 'pull_request' }} ==> false -# 2. branches push trigger image publish -# - is for branch/dev/nightly image -# - commits are merge into main/*-dev ==> vllm-ascend:main / vllm-ascend:*-dev -# 3. tags push trigger image publish -# - is for final release image -# - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3-a3-openeuler / vllm-ascend:v1.2.3rc1-a3-openeuler -on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/image_a3_openeuler.yml' - - 'Dockerfile.a3.openEuler' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - types: [ labeled ] - push: - # Publish image when tagging, the Dockerfile in tag will be build as tag image - branches: - - 'main' - - '*-dev' - tags: - - 'v*' - paths: - - '.github/workflows/image_a3_openeuler.yml' - - 'Dockerfile.a3.openEuler' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - -# only cancel in-progress runs of the same workflow -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: vllm-ascend image build - # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 - # Push event or PR with both 'ready' and 'ready-for-test' labels - runs-on: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'ubuntu-latest' || - 'ubuntu-24.04-arm' - }} - if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} - steps: - - uses: actions/checkout@v6.0.1 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Print - run: | - lscpu - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # TODO(yikun): add more hub image and a note on release policy for container image - images: | - quay.io/ascend/vllm-ascend - # Note for test case - # https://github.com/marketplace/actions/docker-metadata-action#typeref - # 1. branch job pulish per main/*-dev branch commits - # 2. main and dev pull_request is build only, so the tag pr-N-a3-openeuler is fine - # 3. only pep440 matched tag will be published: - # - v0.7.1 --> v0.7.1-a3-openeuler - # - pre/post/dev: v0.7.1rc1-a3-openeuler/v0.7.1rc1-a3-openeuler/v0.7.1rc1.dev1-a3-openeuler/v0.7.1.post1-a3-openeuler, no latest - # which follow the rule from vLLM with prefix v - # TODO(yikun): the post release might be considered as latest release - tags: | - type=ref,event=branch,suffix=-a3-openeuler - type=ref,event=pr,suffix=-a3-openeuler - type=pep440,pattern={{raw}},suffix=-a3-openeuler - flavor: - latest=false - - - name: Free up disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: true - docker-images: false - - - name: Build - Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Build - Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Publish - Login to Quay Container Registry - if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Build and push a3 - uses: docker/build-push-action@v6 - with: - platforms: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'linux/amd64,linux/arm64' || - 'linux/arm64' - }} - # use the current repo path as the build context, ensure .git is contained - context: . - # only trigger when tag, branch/main push - push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - file: Dockerfile.a3.openEuler - build-args: | - PIP_INDEX_URL=https://pypi.org/simple - provenance: false - diff --git a/.github/workflows/image_a3_ubuntu.yml b/.github/workflows/image_a3_ubuntu.yml deleted file mode 100644 index 5e8bacb4..00000000 --- a/.github/workflows/image_a3_ubuntu.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: 'image / Ubuntu / a3' -# This is a docker build check and publish job: -# 1. PR Triggered docker image build check -# - is for image build check -# - Enable on main/*-dev branch -# - push: ${{ github.event_name != 'pull_request' }} ==> false -# 2. branches push trigger image publish -# - is for branch/dev/nightly image -# - commits are merge into main/*-dev ==> vllm-ascend:main / vllm-ascend:*-dev -# 3. tags push trigger image publish -# - is for final release image -# - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3-a3|vllm-ascend:v1.2.3rc1-a3 -on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/image_a3_ubuntu.yml' - - 'Dockerfile.a3' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - types: [ labeled ] - push: - # Publish image when tagging, the Dockerfile in tag will be build as tag image - branches: - - 'main' - - '*-dev' - tags: - - 'v*' - paths: - - '.github/workflows/image_a3_ubuntu.yml' - - 'Dockerfile.a3' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - -# only cancel in-progress runs of the same workflow -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - - build: - name: vllm-ascend image build - # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 - # Push event or PR with both 'ready' and 'ready-for-test' labels - runs-on: ubuntu-latest - if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} - steps: - - uses: actions/checkout@v6.0.1 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Print - run: | - lscpu - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # TODO(yikun): add more hub image and a note on release policy for container image - images: | - quay.io/ascend/vllm-ascend - # Note for test case - # https://github.com/marketplace/actions/docker-metadata-action#typeref - # 1. branch job pulish per main/*-dev branch commits - # 2. main and dev pull_request is build only, so the tag pr-N-a3 is fine - # 3. only pep440 matched tag will be published: - # - v0.7.1 --> v0.7.1-a3 - # - pre/post/dev: v0.7.1rc1-a3/v0.7.1rc1-a3/v0.7.1rc1.dev1-a3/v0.7.1.post1-a3, no latest - # which follow the rule from vLLM with prefix v - # TODO(yikun): the post release might be considered as latest release - tags: | - type=ref,event=branch,suffix=-a3 - type=ref,event=pr,suffix=-a3 - type=pep440,pattern={{raw}},suffix=-a3 - flavor: - latest=false - - - name: Free up disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: true - docker-images: false - - - name: Build - Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Build - Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Publish - Login to Quay Container Registry - if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Build and push a3 - uses: docker/build-push-action@v6 - with: - platforms: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'linux/amd64,linux/arm64' || - 'linux/amd64' - }} - # use the current repo path as the build context, ensure .git is contained - context: . - file: Dockerfile.a3 - # only trigger when tag, branch/main push - push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - build-args: | - PIP_INDEX_URL=https://pypi.org/simple - provenance: false - diff --git a/.github/workflows/image_build_and_push.yaml b/.github/workflows/image_build_and_push.yaml new file mode 100644 index 00000000..1654268c --- /dev/null +++ b/.github/workflows/image_build_and_push.yaml @@ -0,0 +1,528 @@ +# This is a docker build check and publish job: +# 1. PR Triggered docker image build check +# - is for image build check +# - Enable on main/*-dev branch +# - push: ${{ github.event_name != 'pull_request' }} ==> false +# 2. branches push trigger image publish +# - is for branch/dev/nightly image +# - commits are merge into main/*-dev ==> vllm-ascend:main / vllm-ascend:*-dev +# 3. tags push trigger image publish +# - is for final release image +# - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3 / vllm-ascend:v1.2.3rc1 +name: Image +on: + pull_request: + branches: + - 'main' + - '*-dev' + paths: + - '.github/workflows/image_build_and_push.yml' + - 'Dockerfile*' + - 'vllm_ascend/**' + - 'setup.py' + - 'pyproject.toml' + - 'requirements.txt' + - 'cmake/**' + - 'CMakeLists.txt' + - 'csrc/**' + types: [ labeled ] + push: + # Publish image when tagging, the Dockerfile in tag will be build as tag image + branches: + - 'main' + - '*-dev' + tags: + - 'v*' + paths: + - '.github/workflows/image_build_and_push.yaml' + - 'Dockerfile' + - 'vllm_ascend/**' + - 'setup.py' + - 'pyproject.toml' + - 'requirements.txt' + - 'cmake/**' + - 'CMakeLists.txt' + - 'csrc/**' + +# only cancel in-progress runs of the same workflow +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + a2_ubuntu: + name: A2 Ubuntu Image Build and Push + # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 + # Push event or PR with both 'ready' and 'ready-for-test' labels + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' }} + steps: + - uses: actions/checkout@v6.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # TODO(yikun): add more hub image and a note on release policy for container image + images: | + quay.io/ascend/vllm-ascend + # Note for test case + # https://github.com/marketplace/actions/docker-metadata-action#typeref + # 1. branch job pulish per main/*-dev branch commits + # 2. main and dev pull_request is build only, so the tag pr-N is fine + # 3. only pep440 matched tag will be published: + # - v0.7.1 --> v0.7.1, latest + # - pre/post/dev: v0.7.1rc1/v0.7.1rc1/v0.7.1rc1.dev1/v0.7.1.post1, no latest + # which follow the rule from vLLM with prefix v + # TODO(yikun): the post release might be considered as latest release + tags: | + type=ref,event=branch + type=ref,event=pr + type=pep440,pattern={{raw}} + flavor: + latest=true + + - name: Free up disk space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + tool-cache: true + docker-images: false + + - name: Build - Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build - Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Publish - Login to Quay Container Registry + if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ vars.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push A2 + uses: docker/build-push-action@v6 + with: + platforms: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'linux/amd64,linux/arm64' || + 'linux/amd64' + }} + # use the current repo path as the build context, ensure .git is contained + context: . + file: Dockerfile + # only trigger when tag, branch/main push + push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + build-args: | + PIP_INDEX_URL=https://pypi.org/simple + provenance: false + + a2_openeuler: + name: A2 openEuler Image Build and Push + # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 + # Push event or PR with both 'ready' and 'ready-for-test' labels + runs-on: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'ubuntu-latest' || + 'ubuntu-24.04-arm' + }} + if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} + steps: + - uses: actions/checkout@v6.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # TODO(yikun): add more hub image and a note on release policy for container image + images: | + quay.io/ascend/vllm-ascend + # Note for test case + # https://github.com/marketplace/actions/docker-metadata-action#typeref + # 1. branch job pulish per main/*-dev branch commits + # 2. main and dev pull_request is build only, so the tag pr-N-openeuler is fine + # 3. only pep440 matched tag will be published: + # - v0.7.1 --> v0.7.1-openeuler + # - pre/post/dev: v0.7.1rc1-openeuler/v0.7.1rc1-openeuler/v0.7.1rc1.dev1-openeuler/v0.7.1.post1-openeuler, no latest + # which follow the rule from vLLM with prefix v + # TODO(yikun): the post release might be considered as latest release + tags: | + type=ref,event=branch,suffix=-openeuler + type=ref,event=pr,suffix=-openeuler + type=pep440,pattern={{raw}},suffix=-openeuler + flavor: + latest=true + + - name: Free up disk space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + tool-cache: true + docker-images: false + + - name: Build - Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build - Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Publish - Login to Quay Container Registry + if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ vars.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push 910b + uses: docker/build-push-action@v6 + with: + platforms: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'linux/amd64,linux/arm64' || + 'linux/arm64' + }} + # use the current repo path as the build context, ensure .git is contained + context: . + # only trigger when tag, branch/main push + push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + file: Dockerfile.openEuler + build-args: | + PIP_INDEX_URL=https://pypi.org/simple + provenance: false + + a3_ubuntu: + name: A3 Ubuntu Image Build and Push + # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 + # Push event or PR with both 'ready' and 'ready-for-test' labels + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} + steps: + - uses: actions/checkout@v6.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # TODO(yikun): add more hub image and a note on release policy for container image + images: | + quay.io/ascend/vllm-ascend + # Note for test case + # https://github.com/marketplace/actions/docker-metadata-action#typeref + # 1. branch job pulish per main/*-dev branch commits + # 2. main and dev pull_request is build only, so the tag pr-N-a3 is fine + # 3. only pep440 matched tag will be published: + # - v0.7.1 --> v0.7.1-a3 + # - pre/post/dev: v0.7.1rc1-a3/v0.7.1rc1-a3/v0.7.1rc1.dev1-a3/v0.7.1.post1-a3, no latest + # which follow the rule from vLLM with prefix v + # TODO(yikun): the post release might be considered as latest release + tags: | + type=ref,event=branch,suffix=-a3 + type=ref,event=pr,suffix=-a3 + type=pep440,pattern={{raw}},suffix=-a3 + flavor: + latest=false + + - name: Free up disk space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + tool-cache: true + docker-images: false + + - name: Build - Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build - Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Publish - Login to Quay Container Registry + if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ vars.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push a3 + uses: docker/build-push-action@v6 + with: + platforms: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'linux/amd64,linux/arm64' || + 'linux/amd64' + }} + # use the current repo path as the build context, ensure .git is contained + context: . + file: Dockerfile.a3 + # only trigger when tag, branch/main push + push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + build-args: | + PIP_INDEX_URL=https://pypi.org/simple + provenance: false + + a3_openeuler: + name: A3 openEuler Image Build and Push + # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 + # Push event or PR with both 'ready' and 'ready-for-test' labels + runs-on: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'ubuntu-latest' || + 'ubuntu-24.04-arm' + }} + if: ${{ github.event_name == 'push' }} + steps: + - uses: actions/checkout@v6.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # TODO(yikun): add more hub image and a note on release policy for container image + images: | + quay.io/ascend/vllm-ascend + # Note for test case + # https://github.com/marketplace/actions/docker-metadata-action#typeref + # 1. branch job pulish per main/*-dev branch commits + # 2. main and dev pull_request is build only, so the tag pr-N-a3-openeuler is fine + # 3. only pep440 matched tag will be published: + # - v0.7.1 --> v0.7.1-a3-openeuler + # - pre/post/dev: v0.7.1rc1-a3-openeuler/v0.7.1rc1-a3-openeuler/v0.7.1rc1.dev1-a3-openeuler/v0.7.1.post1-a3-openeuler, no latest + # which follow the rule from vLLM with prefix v + # TODO(yikun): the post release might be considered as latest release + tags: | + type=ref,event=branch,suffix=-a3-openeuler + type=ref,event=pr,suffix=-a3-openeuler + type=pep440,pattern={{raw}},suffix=-a3-openeuler + flavor: + latest=false + + - name: Free up disk space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + tool-cache: true + docker-images: false + + - name: Build - Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build - Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Publish - Login to Quay Container Registry + if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ vars.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push a3 + uses: docker/build-push-action@v6 + with: + platforms: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'linux/amd64,linux/arm64' || + 'linux/arm64' + }} + # use the current repo path as the build context, ensure .git is contained + context: . + # only trigger when tag, branch/main push + push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + file: Dockerfile.a3.openEuler + build-args: | + PIP_INDEX_URL=https://pypi.org/simple + provenance: false + + _310p_ubuntu: + name: 310P Ubuntu Image Build and Push + # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 + # Push event or PR with both 'ready' and 'ready-for-test' labels + runs-on: ubuntu-latest + # 310 doesn't work now. Skip it. + # if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} + if: false + steps: + - uses: actions/checkout@v6.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Print + run: | + lscpu + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # TODO(yikun): add more hub image and a note on release policy for container image + images: | + quay.io/ascend/vllm-ascend + # Note for test case + # https://github.com/marketplace/actions/docker-metadata-action#typeref + # 1. branch job pulish per main/*-dev branch commits + # 2. main and dev pull_request is build only, so the tag pr-N is fine + # 3. only pep440 matched tag will be published: + # - v0.7.1 --> v0.7.1-310p + # - pre/post/dev: v0.7.1rc1-310p/v0.7.1rc1-310p/v0.7.1rc1.dev1-310p/v0.7.1.post1-310p, no latest + # which follow the rule from vLLM with prefix v + # TODO(yikun): the post release might be considered as latest release + tags: | + type=ref,event=branch,suffix=-310p + type=ref,event=pr,suffix=-310p + type=pep440,pattern={{raw}},suffix=-310p + flavor: + latest=false + + - name: Free up disk space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + tool-cache: true + docker-images: false + + - name: Build - Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build - Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Publish - Login to Quay Container Registry + if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ vars.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push 310p + uses: docker/build-push-action@v6 + with: + platforms: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'linux/amd64,linux/arm64' || + 'linux/amd64' + }} + # use the current repo path as the build context, ensure .git is contained + context: . + file: Dockerfile.310p + # only trigger when tag, branch/main push + push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + build-args: | + PIP_INDEX_URL=https://pypi.org/simple + provenance: false + + _310p_openeuler: + name: 310P openEuler Image Build and Push + # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 + # Push event or PR with both 'ready' and 'ready-for-test' labels + runs-on: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'ubuntu-latest' || + 'ubuntu-24.04-arm' + }} + # 310 doesn't work now. Skip it. + # if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} + if: false + steps: + - uses: actions/checkout@v6.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Print + run: | + lscpu + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # TODO(yikun): add more hub image and a note on release policy for container image + images: | + quay.io/ascend/vllm-ascend + # Note for test case + # https://github.com/marketplace/actions/docker-metadata-action#typeref + # 1. branch job pulish per main/*-dev branch commits + # 2. main and dev pull_request is build only, so the tag pr-N-310p-openeuler is fine + # 3. only pep440 matched tag will be published: + # - v0.7.1 --> v0.7.1-310p-openeuler + # - pre/post/dev: v0.7.1rc1-310p-openeuler/v0.7.1rc1-310p-openeuler/v0.7.1rc1.dev1-310p-openeuler/v0.7.1.post1-310p-openeuler, no latest + # which follow the rule from vLLM with prefix v + # TODO(yikun): the post release might be considered as latest release + tags: | + type=ref,event=branch,suffix=-310p-openeuler + type=ref,event=pr,suffix=-310p-openeuler + type=pep440,pattern={{raw}},suffix=-310p-openeuler + flavor: + latest=false + + - name: Free up disk space + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + tool-cache: true + docker-images: false + + - name: Build - Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build - Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Publish - Login to Quay Container Registry + if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ vars.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push 310p + uses: docker/build-push-action@v6 + with: + platforms: >- + ${{ + github.event_name == 'push' && github.repository_owner == 'vllm-project' && + 'linux/amd64,linux/arm64' || + 'linux/arm64' + }} + # use the current repo path as the build context, ensure .git is contained + context: . + # only trigger when tag, branch/main push + push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + file: Dockerfile.310p.openEuler + build-args: | + PIP_INDEX_URL=https://pypi.org/simple + provenance: false diff --git a/.github/workflows/image_openeuler.yml b/.github/workflows/image_openeuler.yml deleted file mode 100644 index 85ceb40e..00000000 --- a/.github/workflows/image_openeuler.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: 'image / openEuler' -# This is a docker build check and publish job: -# 1. PR Triggered docker image build check -# - is for image build check -# - Enable on main/*-dev branch -# - push: ${{ github.event_name != 'pull_request' }} ==> false -# 2. branches push trigger image publish -# - is for branch/dev/nightly image -# - commits are merge into main/*-dev ==> vllm-ascend:main-openeuler / vllm-ascend:*-dev-openeuler -# - is for final release image -# - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3-openeuler / vllm-ascend:v1.2.3rc1-openeuler -on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/image_openeuler.yml' - - 'Dockerfile.openEuler' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - types: [ labeled ] - push: - # Publish image when tagging, the Dockerfile in tag will be build as tag image - branches: - - 'main' - - '*-dev' - tags: - - 'v*' - paths: - - '.github/workflows/image_openeuler.yml' - - 'Dockerfile.openEuler' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - -# only cancel in-progress runs of the same workflow -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: vllm-ascend image build - # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 - # Push event or PR with both 'ready' and 'ready-for-test' labels - runs-on: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'ubuntu-latest' || - 'ubuntu-24.04-arm' - }} - if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} - steps: - - uses: actions/checkout@v6.0.1 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Print - run: | - lscpu - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # TODO(yikun): add more hub image and a note on release policy for container image - images: | - quay.io/ascend/vllm-ascend - # Note for test case - # https://github.com/marketplace/actions/docker-metadata-action#typeref - # 1. branch job pulish per main/*-dev branch commits - # 2. main and dev pull_request is build only, so the tag pr-N-openeuler is fine - # 3. only pep440 matched tag will be published: - # - v0.7.1 --> v0.7.1-openeuler - # - pre/post/dev: v0.7.1rc1-openeuler/v0.7.1rc1-openeuler/v0.7.1rc1.dev1-openeuler/v0.7.1.post1-openeuler, no latest - # which follow the rule from vLLM with prefix v - # TODO(yikun): the post release might be considered as latest release - tags: | - type=ref,event=branch,suffix=-openeuler - type=ref,event=pr,suffix=-openeuler - type=pep440,pattern={{raw}},suffix=-openeuler - flavor: - latest=true - - - name: Free up disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: true - docker-images: false - - - name: Build - Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Build - Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Publish - Login to Quay Container Registry - if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Build and push 910b - uses: docker/build-push-action@v6 - with: - platforms: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'linux/amd64,linux/arm64' || - 'linux/arm64' - }} - # use the current repo path as the build context, ensure .git is contained - context: . - # only trigger when tag, branch/main push - push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - file: Dockerfile.openEuler - build-args: | - PIP_INDEX_URL=https://pypi.org/simple - provenance: false diff --git a/.github/workflows/image_ubuntu.yml b/.github/workflows/image_ubuntu.yml deleted file mode 100644 index 8edffccf..00000000 --- a/.github/workflows/image_ubuntu.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: 'image / Ubuntu' -# This is a docker build check and publish job: -# 1. PR Triggered docker image build check -# - is for image build check -# - Enable on main/*-dev branch -# - push: ${{ github.event_name != 'pull_request' }} ==> false -# 2. branches push trigger image publish -# - is for branch/dev/nightly image -# - commits are merge into main/*-dev ==> vllm-ascend:main / vllm-ascend:*-dev -# 3. tags push trigger image publish -# - is for final release image -# - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3 / vllm-ascend:v1.2.3rc1 -on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/image_ubuntu.yml' - - 'Dockerfile' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - types: [ labeled ] - push: - # Publish image when tagging, the Dockerfile in tag will be build as tag image - branches: - - 'main' - - '*-dev' - tags: - - 'v*' - paths: - - '.github/workflows/image_ubuntu.yml' - - 'Dockerfile' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - -# only cancel in-progress runs of the same workflow -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - - build: - name: vllm-ascend image build - # Only arm64 build on openEuler arm64, only amd64 build on Ubuntu amd64 - # Push event or PR with both 'ready' and 'ready-for-test' labels - runs-on: ubuntu-latest - if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} - steps: - - uses: actions/checkout@v6.0.1 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Print - run: | - lscpu - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - # TODO(yikun): add more hub image and a note on release policy for container image - images: | - quay.io/ascend/vllm-ascend - # Note for test case - # https://github.com/marketplace/actions/docker-metadata-action#typeref - # 1. branch job pulish per main/*-dev branch commits - # 2. main and dev pull_request is build only, so the tag pr-N is fine - # 3. only pep440 matched tag will be published: - # - v0.7.1 --> v0.7.1, latest - # - pre/post/dev: v0.7.1rc1/v0.7.1rc1/v0.7.1rc1.dev1/v0.7.1.post1, no latest - # which follow the rule from vLLM with prefix v - # TODO(yikun): the post release might be considered as latest release - tags: | - type=ref,event=branch - type=ref,event=pr - type=pep440,pattern={{raw}} - flavor: - latest=true - - - name: Free up disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: true - docker-images: false - - - name: Build - Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Build - Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Publish - Login to Quay Container Registry - if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ vars.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Build and push 910b - uses: docker/build-push-action@v6 - with: - platforms: >- - ${{ - github.event_name == 'push' && github.repository_owner == 'vllm-project' && - 'linux/amd64,linux/arm64' || - 'linux/amd64' - }} - # use the current repo path as the build context, ensure .git is contained - context: . - file: Dockerfile - # only trigger when tag, branch/main push - push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - build-args: | - PIP_INDEX_URL=https://pypi.org/simple - provenance: false diff --git a/.github/workflows/label_merge_conflict.yml b/.github/workflows/label_merge_conflict.yml index 3118d2e7..0ac2234b 100644 --- a/.github/workflows/label_merge_conflict.yml +++ b/.github/workflows/label_merge_conflict.yml @@ -1,4 +1,4 @@ -name: "Merge Conflict Labeler" +name: Lint on: # So that PRs touching the same files as the push are updated push: @@ -10,6 +10,7 @@ on: jobs: main: + name: Merge Conflict Labeler runs-on: ubuntu-latest steps: - name: check if prs are dirty diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index 1a3a7d81..00000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Pull Request Labeler - -on: pull_request_target - -jobs: - label: - name: Label - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: Label the PR - uses: actions/labeler@v6 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - configuration-path: .github/labeler.yml - sync-labels: true diff --git a/.github/workflows/matchers/ruff.json b/.github/workflows/matchers/ruff.json deleted file mode 100644 index f6d4479e..00000000 --- a/.github/workflows/matchers/ruff.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "ruff", - "pattern": [ - { - "regexp": "^(.+?):(\\d+):(\\d+): (\\w+): (.+)$", - "file": 1, - "line": 2, - "column": 3, - "code": 4, - "message": 5 - } - ] - } - ] - } diff --git a/.github/workflows/nightly_benchmarks.yaml b/.github/workflows/nightly_benchmarks.yaml index 0315d397..7afd49d7 100644 --- a/.github/workflows/nightly_benchmarks.yaml +++ b/.github/workflows/nightly_benchmarks.yaml @@ -15,7 +15,7 @@ # limitations under the License. # -name: 'ascend test / performance' +name: Performance Test # This workflow runs nightly benchmarks for vllm-ascend. on: diff --git a/.github/workflows/pr_create.yaml b/.github/workflows/pr_create.yaml new file mode 100644 index 00000000..22ab2c41 --- /dev/null +++ b/.github/workflows/pr_create.yaml @@ -0,0 +1,121 @@ +# +# 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: Lint + +on: + # The PR updated when PR opened and push new commits + pull_request_target: + types: [opened] + branches: + - 'main' + +permissions: + pull-requests: write + +jobs: + commit-update: + name: format PR body + runs-on: ubuntu-latest + steps: + - name: Get vLLM version + run: | + VLLM_COMMIT=ad32e3e19ccf0526cb6744a5fed09a138a5fb2f9 + echo "VLLM_COMMIT=https://github.com/vllm-project/vllm/commit/$VLLM_COMMIT" >> $GITHUB_ENV + + - name: Checkout repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.2.2 + + - name: Set up Python + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + + - name: Get vLLM release version + run: | + VLLM_VERSION=$(python3 docs/source/conf.py | jq .ci_vllm_version | tr -d '"') + echo "VLLM_VERSION=$VLLM_VERSION" >> $GITHUB_ENV + + - name: Update PR description + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER=${{ github.event.number }} + VLLM_VERSION=${{ env.VLLM_VERSION }} + VLLM_COMMIT=${{ env.VLLM_COMMIT }} + OLD=/tmp/orig_pr_body.txt + NEW=/tmp/new_pr_body.txt + FINAL=/tmp/final_pr_body.txt + + gh pr view --json body --template "{{.body}}" "${PR_NUMBER}" > "${OLD}" + cp "${OLD}" "${NEW}" + + # Remove notes in pr description and add vLLM version and commit + sed -i '//d' "${NEW}" + sed -i '/- vLLM .*$/d' "${NEW}" + { + echo "" + echo "- vLLM version: $VLLM_VERSION" + echo "- vLLM main: $VLLM_COMMIT" + } >> "${NEW}" + + # Remove redundant empty lines + uniq "${NEW}" > "${FINAL}" + + # Run this only if ${NEW} is different than ${OLD} + if ! cmp -s "${OLD}" "${FINAL}"; then + echo + echo "Updating PR body:" + echo + cat "${NEW}" + gh pr edit --body-file "${FINAL}" "${PR_NUMBER}" + else + echo "No changes needed" + fi + + pr-label: + name: Pull Request Labeler + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Label the PR + uses: actions/labeler@v6 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/labeler.yml + sync-labels: true + + pr-reminder: + name: PR Reminder Comment Bot + runs-on: ubuntu-latest + steps: + - name: Remind to run full CI on PR + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: | + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: 'πŸ‘‹ Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:β€Œβ€Œ\n\n' + + '- A PR should do only one thing, smaller PRs enable faster reviews.\n' + + '- Every PR should include unit tests and end-to-end tests β€Œto ensure it works and is not broken by other future PRs.\n' + + '- Write the commit message by fulfilling the PR description to help reviewer and future developers understand.\n\n' + + 'If CI fails, you can run linting and testing checks locally according [Contributing](https://vllm-ascend.readthedocs.io/zh-cn/latest/developer_guide/contribution/index.html) and [Testing](https://vllm-ascend.readthedocs.io/zh-cn/latest/developer_guide/contribution/testing.html).' + }) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release_code.yml b/.github/workflows/release_code.yml deleted file mode 100644 index f8e84769..00000000 --- a/.github/workflows/release_code.yml +++ /dev/null @@ -1,77 +0,0 @@ -# -# 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 / sdist - -on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/release_code.yml' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - push: - tags: - - 'v*' - -jobs: - build: - name: release code - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11"] - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.2.2 - - - name: Print - run: | - lscpu - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.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@v5 - with: - name: vllm-ascend-src - path: dist/* - - - name: Release - if: startsWith(github.ref, 'refs/tags/') - run: | - python3 -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release_whl.yml b/.github/workflows/release_code_and_wheel.yml similarity index 75% rename from .github/workflows/release_whl.yml rename to .github/workflows/release_code_and_wheel.yml index 01663f05..e58beeee 100644 --- a/.github/workflows/release_whl.yml +++ b/.github/workflows/release_code_and_wheel.yml @@ -15,19 +15,15 @@ # This file is a part of the vllm-ascend project. # -name: build / wheel +name: Build 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' + - '.github/workflows/release_code.yml' - 'vllm_ascend/**' - 'setup.py' - 'pyproject.toml' @@ -40,7 +36,47 @@ on: - 'v*' jobs: - build: + build_and_release_code: + name: release code + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.2.2 + + - name: Print + run: | + lscpu + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.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@v5 + with: + name: vllm-ascend-src + path: dist/* + + - name: Release + if: startsWith(github.ref, 'refs/tags/') + run: | + python3 -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} + + build_and_release_wheel: name: build and release wheel strategy: matrix: @@ -48,16 +84,12 @@ jobs: # PR only trigger latest version python-version: ${{ fromJSON( (github.event_name == 'pull_request' && '["3.11"]') || - '["3.9", "3.10", "3.11"]' + '["3.10", "3.11"]' ) }} runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.2.2 - - name: Print - run: | - lscpu - - name: Free up disk space uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 with: diff --git a/.github/workflows/reminder_comment.yml b/.github/workflows/reminder_comment.yml deleted file mode 100644 index 1c45edc2..00000000 --- a/.github/workflows/reminder_comment.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: PR Reminder Comment Bot -permissions: - pull-requests: write -on: - pull_request_target: - types: [opened] -jobs: - pr_reminder: - runs-on: ubuntu-latest - steps: - - name: Remind to run full CI on PR - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: 'πŸ‘‹ Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:β€Œβ€Œ\n\n' + - '- A PR should do only one thing, smaller PRs enable faster reviews.\n' + - '- Every PR should include unit tests and end-to-end tests β€Œto ensure it works and is not broken by other future PRs.\n' + - '- Write the commit message by fulfilling the PR description to help reviewer and future developers understand.\n\n' + - 'If CI fails, you can run linting and testing checks locally according [Contributing](https://vllm-ascend.readthedocs.io/zh-cn/latest/developer_guide/contribution/index.html) and [Testing](https://vllm-ascend.readthedocs.io/zh-cn/latest/developer_guide/contribution/testing.html).' - }) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/vllm_ascend_test_pr_light.yaml b/.github/workflows/vllm_ascend_test_pr_light.yaml index 264e0a62..0d5287a9 100644 --- a/.github/workflows/vllm_ascend_test_pr_light.yaml +++ b/.github/workflows/vllm_ascend_test_pr_light.yaml @@ -40,7 +40,7 @@ concurrency: jobs: lint: - uses: ./.github/workflows/pre-commit.yml + uses: ./.github/workflows/_pre_commit.yml with: vllm: ad32e3e19ccf0526cb6744a5fed09a138a5fb2f9 changes: