diff --git a/.github/workflows/_pr_image_build.yaml b/.github/workflows/_schedule_image_build.yaml similarity index 97% rename from .github/workflows/_pr_image_build.yaml rename to .github/workflows/_schedule_image_build.yaml index f154877d619..911a5dafd89 100644 --- a/.github/workflows/_pr_image_build.yaml +++ b/.github/workflows/_schedule_image_build.yaml @@ -142,9 +142,9 @@ jobs: # 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=${{ env.SUFFIX }} - type=ref,event=pr,suffix=${{ env.SUFFIX }} type=pep440,pattern={{raw}},suffix=${{ env.SUFFIX }} + type=schedule,pattern=main,suffix=${{ env.SUFFIX }} + type=ref,event=workflow_dispatch,suffix=${{ env.SUFFIX }} flavor: latest=false diff --git a/.github/workflows/pr_tag_image_build_and_push.yaml b/.github/workflows/schedule_image_build_and_push.yaml similarity index 50% rename from .github/workflows/pr_tag_image_build_and_push.yaml rename to .github/workflows/schedule_image_build_and_push.yaml index a20e989e970..8b0d104ac46 100644 --- a/.github/workflows/pr_tag_image_build_and_push.yaml +++ b/.github/workflows/schedule_image_build_and_push.yaml @@ -11,52 +11,15 @@ # - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3 / vllm-ascend:v1.2.3rc1 name: Image Build and Push on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/pr_tag_image_build_and_push.yaml' - - 'Dockerfile*' - - '.github/workflows/_pr_image_build.yml' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - # We should also trigger image build when nightly test related files are changed to ensure the image is valid for nightly tests - - 'tests/e2e/nightly/' - types: [ labeled ] + schedule: + - cron: '0 */2 * * *' push: - # Publish image when tagging, the Dockerfile in tag will be build as tag image - branches: - - 'main' - - '*-dev' tags: - 'v*' - paths: - - '.github/workflows/pr_tag_image_build_and_push.yaml' - - 'Dockerfile*' - - '.github/workflows/_pr_image_build.yml' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' - - workflow_dispatch: -# only cancel in-progress runs of the same workflow -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + workflow_dispatch: jobs: image_build: - if: ${{ github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ready') && contains(github.event.pull_request.labels.*.name, 'ready-for-test')) }} name: Image Build and Push strategy: matrix: @@ -77,11 +40,11 @@ jobs: # dockerfile: Dockerfile.310p # - name: 310P openEuler # dockerfile: Dockerfile.310p.openEuler - uses: ./.github/workflows/_pr_image_build.yaml + uses: ./.github/workflows/_schedule_image_build.yaml with: dockerfile: ${{ matrix.build_meta.dockerfile }} suffix: ${{ matrix.build_meta.suffix }} quay_username: ${{ vars.QUAY_USERNAME }} - should_push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} + should_push: ${{ github.repository_owner == 'vllm-project' }} secrets: QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} diff --git a/.github/workflows/pr_tag_release_code_and_wheel.yml b/.github/workflows/schedule_release_code_and_wheel.yml similarity index 85% rename from .github/workflows/pr_tag_release_code_and_wheel.yml rename to .github/workflows/schedule_release_code_and_wheel.yml index ed655bdcb99..b7f5c2335d7 100644 --- a/.github/workflows/pr_tag_release_code_and_wheel.yml +++ b/.github/workflows/schedule_release_code_and_wheel.yml @@ -18,26 +18,12 @@ name: Release Code and Wheel on: - pull_request: - branches: - - 'main' - - '*-dev' - paths: - - '.github/workflows/pr_tag_release_code_and_wheel.yaml' - - 'vllm_ascend/**' - - 'setup.py' - - 'pyproject.toml' - - 'requirements.txt' - - 'cmake/**' - - 'CMakeLists.txt' - - 'csrc/**' + schedule: + - cron: '0 */2 * * *' push: tags: - 'v*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + workflow_dispatch: jobs: build_and_release_code: @@ -76,7 +62,7 @@ jobs: path: dist/* - name: Release - if: startsWith(github.ref, 'refs/tags/') + if: ${{ github.event_name == 'push' }} run: | python3 -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} @@ -85,11 +71,8 @@ jobs: 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.10", "3.11"]' - ) }} + python-version: ["3.10", "3.11"] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.2.2 @@ -114,11 +97,10 @@ jobs: ls dist - name: Set up Python ${{ matrix.python-version }} - if: startsWith(github.ref, 'refs/tags/') uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.python-version }} - + - name: Repair wheels with auditwheel run: | python3 -m pip install auditwheel @@ -161,7 +143,7 @@ jobs: path: dist/* - name: Release - if: startsWith(github.ref, 'refs/tags/') + if: ${{ github.event_name == 'push' }} run: | python3 -m pip install twine python3 -m twine upload --verbose dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}