Files
xc-llm-ascend/.github/workflows/labled_download_model.yaml
zhangxinyuehfad 81f3c09d6d [CI] Change A2 runner (#6557)
### What this PR does / why we need it?

This PR updates the CI runner from `linux-aarch64-a2-*` to
`linux-aarch64-a2b3-*` in various test configuration files. This change
is necessary to adapt to updates in the CI infrastructure.

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

No.

### How was this patch tested?

The changes are configuration updates for CI tests. The correctness will
be verified by the CI pipeline.

Signed-off-by: hfadzxy <starmoon_zhang@163.com>
2026-02-05 23:43:57 +08:00

85 lines
2.4 KiB
YAML

name: 'model downloader'
on:
pull_request:
paths:
- '.github/workflows/misc/model_list.json'
- '.github/workflows/labled_download_model.yaml'
types: [labeled, synchronize]
defaults:
run:
shell: bash -el {0}
concurrency:
group: ascend-${{ github.workflow_ref }}
cancel-in-progress: true
jobs:
download-models:
if: contains(github.event.pull_request.labels.*.name, 'model-download')
name: Download models from ModelScope
runs-on: linux-aarch64-a2b3-0
container:
image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-cpu
steps:
- name: Install dependencies
run: |
apt-get update -y && apt-get install git jq -y
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
pip install modelscope
- name: Show Current Disk Usage
run: |
df -h /root/.cache | grep -v Filesystem | \
awk '{print "Mount point: "$6, "Total: "$2, "Used: "$3, "Available: "$4, "Usage: "$5}'
- name: Checkout PR branch
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Extract new models from PR
id: diff
run: |
set -euo pipefail
git config --global --add safe.directory /__w/vllm-ascend/vllm-ascend
JSON_PATH=".github/workflows/misc/model_list.json"
git fetch origin main
git show origin/main:$JSON_PATH > /tmp/models_main.json || \
echo '{"models":[]}' > /tmp/models_main.json
cp $JSON_PATH /tmp/models_pr.json
jq -r '
(.models // []) as $pr
| input
| (.models // []) as $main
| ($pr - $main)[]
' /tmp/models_pr.json /tmp/models_main.json > /tmp/new_models.txt
echo "New models:"
cat /tmp/new_models.txt || true
- name: Download new models (CLI)
run: |
set -euo pipefail
if [ ! -s /tmp/new_models.txt ]; then
echo "No new models to download."
exit 0
fi
while read -r model; do
[ -z "$model" ] && continue
echo "▶ Downloading $model"
modelscope download "$model"
done < /tmp/new_models.txt
- name: Summary
run: |
echo "Downloaded models:"
cat /tmp/new_models.txt || echo "No new models"