Files
xc-llm-ascend/.github/workflows/schedule_image_build_and_push.yaml
wjunLu 84b00695f8 [CI] Refactor to speedup image building and CI Installation (#6708)
### What this PR does / why we need it?
1. Refactor  image workflow using cache-from to speedup builds

![build](https://github.com/user-attachments/assets/02135c12-0069-44f8-a3ec-5c2b4282448a)

Simultaneously refactored all Dockerfiles by placing layers that rarely
change before those that change frequently, improving build cache hit
rate.

2. Refactor E2E test using vllm-ascend container images, to skip C
compile while no C code are changed

![e2e](https://github.com/user-attachments/assets/49f5b166-0df3-41e1-8f71-b3bbbed17cfd)

In this case, the job will only replace the source code of vllm-ascend
and install `requirements-dev.txt`, saving about 10min before tests

### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

- vLLM version: v0.15.0
- vLLM main:
9562912cea

Signed-off-by: wjunLu <wjunlu217@gmail.com>
2026-02-28 09:06:00 +08:00

74 lines
2.4 KiB
YAML

# 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 Build and Push
on:
schedule:
# UTC+8: 8am, 10am, 12pm, 14pm, 16pm, 18pm, 22pm
- cron: '0 0,2,4,6,8,10,14 * * *'
push:
branches:
# Build release branch images proactively so cache is warm when the tag is pushed
- 'releases/*'
tags:
- 'v*'
pull_request:
branches:
- 'main'
types: [ labeled, synchronize ]
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:
image_build:
name: Image Build and Push
if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'image-build') }}
strategy:
matrix:
build_meta:
- name: A2 Ubuntu
dockerfile: Dockerfile
suffix: ''
- name: A2 openeuler
dockerfile: Dockerfile.openEuler
suffix: 'openeuler'
- name: A3 Ubuntu
dockerfile: Dockerfile.a3
suffix: 'a3'
- name: A3 openEuler
dockerfile: Dockerfile.a3.openEuler
suffix: 'a3-openeuler'
- name: 310P Ubuntu
dockerfile: Dockerfile.310p
suffix: '310p'
- name: 310P openEuler
dockerfile: Dockerfile.310p.openEuler
suffix: '310p-openeuler'
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.repository_owner == 'vllm-project' && (github.event_name != 'pull_request') }}
workflow_dispatch_tag: ${{ inputs.tag }}
secrets:
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}