Files
xc-llm-ascend/.github/workflows/schedule_nightly_image_build.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

63 lines
2.0 KiB
YAML

name: Nightly Image Build Schedule
on:
schedule:
# UTC+8: 20pm, 23pm
- cron: '0 12,15 * * *'
workflow_dispatch:
# This workflow builds and pushes Docker images for nightly-ci
# It will be built base on the quay.io/ascend/vllm-ascend:main
# And have some customizations for nightly testing, pushing to Huawei Cloud SWR
jobs:
build-and-sync:
runs-on: ubuntu-22.04-arm
strategy:
matrix:
target: ['a2', 'a3']
outputs:
image-tag: ${{ steps.build-image.outputs.image-tag }}
steps:
- uses: actions/checkout@v6
- name: Show build target
run: |
echo "Building target: ${{ matrix.target }}"
- name: Login to Huawei Cloud SWR
id: login-swr
if: ${{ env.HW_USERNAME != '' && env.HW_TOKEN != '' }}
run: |
echo "${{ env.HW_TOKEN }}" | docker login -u "${{ env.HW_USERNAME }}" --password-stdin swr.cn-southwest-2.myhuaweicloud.com
env:
HW_USERNAME: ${{ secrets.HW_USERNAME }}
HW_TOKEN: ${{ secrets.HW_TOKEN }}
- name: Build image
id: build-image
run: |
TARGET="${{ matrix.target }}"
IMAGE_TAG="swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-${TARGET}"
echo "Building image: $IMAGE_TAG"
docker build \
--network host \
--platform linux/arm64 \
-f .github/workflows/dockerfiles/Dockerfile.nightly.${TARGET} \
--build-arg CANN_VERSION="8.5.0" \
--build-arg UBUNTU_VERSION="22.04" \
--build-arg PYTHON_VERSION="3.11" \
--cache-from "$IMAGE_TAG" \
-t "$IMAGE_TAG" .
echo "image-tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
# To avoid pushing images from forks, only push when the repository owner is 'vllm-project'
- name: Push image to SWR
if: ${{ github.repository_owner == 'vllm-project' && steps.login-swr.conclusion == 'success' }}
run: |
docker push ${{ steps.build-image.outputs.image-tag }}