Repository navigation
Add OBS HK cross-region stability test workflow #204
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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: E2E | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - labeled | |
| branches: | |
| - 'main' | |
| - '*-dev' | |
| - 'releases/v*' | |
| # Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly | |
| # declared as "shell: bash -el {0}" on steps that need to be properly activated. | |
| # It's used to activate ascend-toolkit environment variables. | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| lint-and-select-tests: | |
| if: ${{ github.event.action != 'labeled' || github.event.label.name == 'ready' }} | |
| runs-on: linux-amd64-cpu-8-hk | |
| container: | |
| image: quay.io/ascend-ci/vllm-ascend:lint | |
| outputs: | |
| has_tests: ${{ steps.scope.outputs.has_tests || steps.noop.outputs.has_tests }} | |
| test_groups: ${{ steps.scope.outputs.test_groups || steps.noop.outputs.test_groups }} | |
| matched_modules: ${{ steps.scope.outputs.matched_modules || steps.noop.outputs.matched_modules }} | |
| main_commit: ${{ steps.vllm.outputs.main_commit }} | |
| release_tag: ${{ steps.vllm.outputs.release_tag }} | |
| steps: | |
| - name: Validate PR title prefix | |
| run: | | |
| PR_TITLE=$(curl -sSf -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" \ | |
| | python3 -c "import sys,json; print(json.load(sys.stdin)['title'])") || { | |
| echo "::error::Failed to fetch PR title from GitHub API" | |
| exit 1 | |
| } | |
| if [ -z "$PR_TITLE" ]; then | |
| echo "::error::PR title cannot be empty" | |
| exit 1 | |
| fi | |
| echo "Checking PR title: $PR_TITLE" | |
| VALID_PREFIXES='\[(BugFix|Performance|Test|CI|Feature|Doc|Misc|Community|Refactor)\]' | |
| if ! echo "$PR_TITLE" | grep -iqE "$VALID_PREFIXES"; then | |
| echo "::error::PR title must contain one of the following prefixes: [BugFix], [Performance], [Test], [CI], [Feature], [Doc], [Misc], [Community], [Refactor]" | |
| echo "::error::Example: '[Feature] Add new optimization pass' or 'Add new feature [Feature]'" | |
| exit 1 | |
| fi | |
| echo "✓ PR title prefix is valid" | |
| - name: Checkout vllm-project/vllm-ascend repo | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Read verified vLLM refs | |
| id: vllm | |
| run: | | |
| main_commit="$(tr -d '[:space:]' < .github/vllm-main-verified.commit)" | |
| release_tag="$(tr -d '[:space:]' < .github/vllm-release-tag.commit)" | |
| [[ "${main_commit}" =~ ^[0-9a-f]{7,40}$ ]] || { | |
| echo "::error file=.github/vllm-main-verified.commit::invalid vLLM main commit: ${main_commit}" | |
| exit 1 | |
| } | |
| [[ "${release_tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([.-].*)?$ ]] || { | |
| echo "::error file=.github/vllm-release-tag.commit::invalid vLLM release tag: ${release_tag}" | |
| exit 1 | |
| } | |
| { | |
| echo "main_commit=${main_commit}" | |
| echo "release_tag=${release_tag}" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: cp problem matchers | |
| run: | | |
| cp .github/workflows/matchers/actionlint.json "$RUNNER_TEMP/actionlint.json" | |
| cp .github/workflows/matchers/markdownlint.json "$RUNNER_TEMP/markdownlint.json" | |
| cp .github/workflows/matchers/mypy.json "$RUNNER_TEMP/mypy.json" | |
| - run: echo "::add-matcher::$RUNNER_TEMP/actionlint.json" | |
| - run: echo "::add-matcher::$RUNNER_TEMP/markdownlint.json" | |
| - run: echo "::add-matcher::$RUNNER_TEMP/mypy.json" | |
| - name: Checkout vllm-project/vllm repo | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: vllm-project/vllm | |
| path: ./vllm-empty | |
| ref: ${{ steps.vllm.outputs.main_commit }} | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| lint_tracker: | |
| - 'requirements.txt' | |
| - 'requirements-dev.txt' | |
| - 'requirements-lint.txt' | |
| src: | |
| - 'vllm_ascend/**' | |
| - 'setup.py' | |
| - 'csrc/**' | |
| - 'requirements.txt' | |
| - 'pyproject.toml' | |
| - 'cmake/**' | |
| - '.github/**' | |
| - 'tests/**' | |
| - 'tools/**' | |
| - 'CMakeLists.txt' | |
| - name: Install vllm-ascend dev (conditional) | |
| if: steps.filter.outputs.lint_tracker == 'true' | |
| env: | |
| UV_INDEX_URL: http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple | |
| UV_EXTRA_INDEX_URL: "https://repo.huaweicloud.com/ascend/repos/pypi" | |
| UV_INDEX_STRATEGY: unsafe-best-match | |
| UV_NO_CACHE: 1 | |
| UV_SYSTEM_PYTHON: 1 | |
| run: | | |
| pip install uv | |
| git config --global --add safe.directory /__w/vllm-ascend/vllm-ascend | |
| pip install uc-manager | |
| uv pip install -r requirements-dev.txt --extra-index-url https://download.pytorch.org/whl/cpu | |
| - name: Get pre-commit config hash | |
| id: get_hash | |
| run: | | |
| PRE_COMMIT_HASH=$(sha256sum .pre-commit-config.yaml | awk '{print $1}') | |
| echo "PRE_COMMIT_HASH=$PRE_COMMIT_HASH" >> $GITHUB_OUTPUT | |
| - name: Restore pre-commit cache | |
| uses: runs-on/cache/restore@v5 | |
| env: | |
| RUNS_ON_S3_BUCKET_CACHE: ascend-ci-cache-hk | |
| RUNS_ON_S3_BUCKET_ENDPOINT: https://obs.ap-southeast-1.myhuaweicloud.com | |
| RUNS_ON_S3_FORCE_PATH_STYLE: "false" | |
| AWS_S3_FORCE_PATH_STYLE: "false" | |
| AWS_REGION: ap-southeast-1 | |
| with: | |
| path: /tmp/pre-commit-cache | |
| key: pre-commit-${{ steps.get_hash.outputs.PRE_COMMIT_HASH }} | |
| - name: Run pre-commit | |
| env: | |
| PRE_COMMIT_HOME: /tmp/pre-commit-cache | |
| PRE_COMMIT_COLOR: always | |
| FORCE_COLOR: "1" | |
| TERM: xterm-256color | |
| SHELLCHECK_OPTS: "--exclude=SC2046,SC2006,SC2086" | |
| run: | | |
| git config --global --add safe.directory /__w/vllm-ascend/vllm-ascend | |
| pre-commit run --all-files --hook-stage manual --show-diff-on-failure | |
| - name: Run mypy | |
| run: | | |
| PYTHONPATH="$PYTHONPATH:$(pwd)/vllm-empty" | |
| export PYTHONPATH | |
| git config --global --add safe.directory /__w/vllm-ascend/vllm-ascend | |
| for python_version in "3.10" "3.11" "3.12"; do | |
| echo "============================" | |
| tools/mypy.sh 1 "$python_version" | |
| echo "============================" | |
| done | |
| - name: Validate test coverage config | |
| run: | | |
| pip install pyyaml | |
| python3 .github/workflows/scripts/coverage.py | |
| - name: Select tests based on changed files | |
| id: scope | |
| if: steps.filter.outputs.src == 'true' | |
| run: | | |
| git config --global --add safe.directory /__w/vllm-ascend/vllm-ascend | |
| git fetch origin ${{ github.base_ref }} | |
| pip install regex | |
| python3 .github/workflows/scripts/select_tests.py \ | |
| --diff-base origin/${{ github.base_ref }} | |
| - name: Set no-tests output when source paths unchanged | |
| id: noop | |
| if: steps.filter.outputs.src != 'true' | |
| run: | | |
| { | |
| echo "has_tests=false" | |
| echo "test_groups=[]" | |
| echo "matched_modules=" | |
| } >> "$GITHUB_OUTPUT" | |
| run-selected-tests: | |
| needs: lint-and-select-tests | |
| if: ${{ needs.lint-and-select-tests.outputs.has_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'ready') }} | |
| strategy: | |
| matrix: | |
| vllm_version: | |
| - ${{ needs.lint-and-select-tests.outputs.main_commit }} | |
| - ${{ needs.lint-and-select-tests.outputs.release_tag }} | |
| uses: ./.github/workflows/_selected_tests.yaml | |
| with: | |
| vllm: ${{ matrix.vllm_version }} | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| base_ref: ${{ github.base_ref }} | |
| test_groups: ${{ needs.lint-and-select-tests.outputs.test_groups }} |