name: 'Nightly image build'
on:
workflow_call:
inputs:
target:
required: true
type: string
description: "Build target: 'a2' or 'a3'"
vllm_ascend_branch:
required: false
type: string
default: 'main'
description: "Branch/ref to checkout"
secrets:
HW_USERNAME:
required: false
HW_TOKEN:
required: false
GITEE_TOKEN:
required: false
jobs:
build:
name: Build nightly-${{ inputs.target }} image
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.vllm_ascend_branch }}
- name: Login to Huawei Cloud SWR
id: login-swr
if: ${{ env.HW_USERNAME != '' && env.HW_TOKEN != '' }}
env:
HW_USERNAME: ${{ secrets.HW_USERNAME }}
HW_TOKEN: ${{ secrets.HW_TOKEN }}
run: |
echo "$HW_TOKEN" | docker login -u "$HW_USERNAME" --password-stdin swr.cn-southwest-2.myhuaweicloud.com
- name: Build nightly-${{ inputs.target }} image
env:
GITEE_USERNAME: ${{ vars.GITEE_USERNAME }}
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
run: |
BRANCH_TAG="${{ inputs.vllm_ascend_branch }}"
BRANCH_TAG="${BRANCH_TAG//\//-}"
IMAGE="swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-ci-${BRANCH_TAG}-${{ inputs.target }}"
docker build \
--network host \
--platform linux/arm64 \
-f .github/workflows/dockerfiles/Dockerfile.nightly.${{ inputs.target }} \
--build-arg CANN_VERSION="9.0.0" \
--build-arg UBUNTU_VERSION="22.04" \
--build-arg PYTHON_VERSION="3.11" \
--build-arg VLLM_ASCEND_BRANCH="${BRANCH_TAG}" \
--build-arg GITEE_USERNAME="${GITEE_USERNAME}" \
--build-arg GITEE_TOKEN="${GITEE_TOKEN}" \
-t "$IMAGE" .
- name: Push image to SWR
if: ${{ github.repository_owner == 'vllm-project' && steps.login-swr.conclusion == 'success' }}
run: |
BRANCH_TAG="${{ inputs.vllm_ascend_branch }}"
BRANCH_TAG="${BRANCH_TAG//\//-}"
docker push swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-ci-${BRANCH_TAG}-${{ inputs.target }}