name: Build and verify Qwen2.5 compatibility engines on: push: tags: - "v*-nvidia-a100" - "v*-cambricon-mlu370" - "v*-metax-c500" - "v*-vastai-va16" - "v*-all" jobs: docker: runs-on: amd64-ubuntu-24.04 env: RELEASE_TAG: ${{ gitea.ref_name }} REPOSITORY: ${{ gitea.repository }} SERVER_URL: ${{ gitea.server_url }} ACTOR: ${{ gitea.actor }} steps: - name: Clone tagged source run: | git clone "$SERVER_URL/$REPOSITORY.git" . git checkout "$RELEASE_TAG" - name: Run compatibility tests run: | python3 -m unittest discover -s tests -q python3 -m py_compile engine_compat.py release_plan.py bash -n vllm_wrapper.sh - name: Select release targets and load image metadata run: | set -eu set -a . .gitea/workflows/task_info.env set +a test -n "$FRAMEWORK" test -n "$TASK_TYPE" python3 release_plan.py "$RELEASE_TAG" --gitea-env "$GITEA_ENV" echo "FRAMEWORK=$FRAMEWORK" >> "$GITEA_ENV" echo "TASK_TYPE=$TASK_TYPE" >> "$GITEA_ENV" - name: Validate GPU and task metadata run: | set -eu test -n "${FIXED_TOKEN:-}" || { echo "FIXED_TOKEN is missing"; exit 1; } for gpu in $GPU_TYPES; do response="$(curl --silent --show-error --fail-with-body --location --get \ 'https://modelhub.org.cn/adminApi/image-verify/validate' \ --header "Xc-Token: $FIXED_TOKEN" \ --data-urlencode "gpuType=$gpu" \ --data-urlencode "taskType=$TASK_TYPE")" VALIDATE_RESPONSE="$response" python3 -c 'import json,os,sys; body=json.loads(os.environ["VALIDATE_RESPONSE"]); sys.exit(0 if body.get("code")==0 and body.get("data") is True else 1)' echo "validated gpuType=$gpu taskType=$TASK_TYPE" done - name: Log in to Docker registry run: | set -eu test -n "${DOCKER_REGISTRY:-}" test -n "${DOCKER_USERNAME:-}" test -n "${DOCKER_PASSWORD:-}" printf '%s' "$DOCKER_PASSWORD" | docker login "$DOCKER_REGISTRY" \ -u "$DOCKER_USERNAME" --password-stdin - name: Build and push target images run: | set -eu image_name="$(printf '%s' "$REPOSITORY" | tr '[:upper:]' '[:lower:]' | tr '_' '-')" image_base="$DOCKER_REGISTRY/$DOCKER_USERNAME/$image_name" echo "IMAGE_BASE=$image_base" >> "$GITEA_ENV" for target in $IMAGE_TARGETS; do if [ "$RELEASE_TARGET" = all ]; then image_tag="$RELEASE_TAG-$target" else image_tag="$RELEASE_TAG" fi image="$image_base:$image_tag" case "$target" in nvidia-a100) docker build \ --build-arg BASE_IMAGE=harbor.4pd.io/dooke/vllm/vllm/vllm-openai:v0.11.0 \ -t "$image" . ;; cambricon-mlu370) docker build \ --build-arg BASE_IMAGE=harbor.4pd.io/hardcore-tech/cambricon-mlu370-pytorch:v25.01-20260228 \ -t "$image" . ;; metax-c500) docker build \ --build-arg BASE_IMAGE=harbor.4pd.io/modelhubxc/enginex-metax/vllm:0.9.1 \ --build-arg PYTHON_BIN=/opt/conda/bin/python3 \ --build-arg VLLM_BIN=/opt/conda/bin/vllm \ -t "$image" . ;; vastai-va16) docker build \ --build-arg BASE_IMAGE=harbor.4pd.io/modelhubxc/sunruoxi/enginex-vastai-vllm-vacc-fix-tokenizer:VVI-26.02 \ -t "$image" . ;; *) echo "unknown image target: $target"; exit 1 ;; esac success=0 for attempt in 1 2 3; do if docker push "$image"; then success=1; break; fi echo "docker push attempt $attempt failed for $image" sleep 30 done test "$success" -eq 1 done - name: Notify ModelHub image verification run: | set -eu for mapping in $VERIFY_PAIRS; do gpu="${mapping%%:*}" target="${mapping#*:}" case " $IMAGE_TARGETS " in *" $target "*) ;; *) echo "GPU target was not built: $gpu"; exit 1 ;; esac if [ "$RELEASE_TARGET" = all ]; then image_tag="$RELEASE_TAG-$target" else image_tag="$RELEASE_TAG" fi image="$IMAGE_BASE:$image_tag" payload="$(GPU_TYPE="$gpu" IMAGE="$image" REPO_URL="$SERVER_URL/$REPOSITORY" TAG="$RELEASE_TAG" python3 -c 'import json, os; print(json.dumps({"framework": os.environ["FRAMEWORK"], "gpuType": os.environ["GPU_TYPE"], "imageUrl": os.environ["IMAGE"], "taskType": os.environ["TASK_TYPE"], "createBy": os.environ["ACTOR"], "repoUrl": os.environ["REPO_URL"], "tag": os.environ["TAG"]}))')" response="$(curl --silent --show-error --fail-with-body --location \ --request POST 'https://modelhub.org.cn/adminApi/image-verify' \ --header "Xc-Token: $FIXED_TOKEN" \ --header 'Content-Type: application/json' \ --data-raw "$payload")" VERIFY_RESPONSE="$response" python3 -c 'import json,os,sys; body=json.loads(os.environ["VERIFY_RESPONSE"]); sys.exit(0 if body.get("code")==0 else 1)' echo "submitted image verification for $gpu" done