#!/bin/bash # This script build the XPU docker image and run the offline inference inside the container. set -ex omni_source_dir=$(git rev-parse --show-toplevel) : "${VLLM_VERSION:?VLLM_VERSION must be set}" # Official upstream XPU image. It is published from vllm's own # docker/Dockerfile.xpu, which is exactly what build_vllm_base() clones and # builds below, so pulling it is equivalent to building the fallback base. upstream_base_image="vllm/vllm-openai-xpu:${VLLM_VERSION}" local_base_image="xpu/vllm-omni-ci-base:${VLLM_VERSION}" image_name="xpu/vllm-omni-ci:${BUILDKITE_COMMIT:?BUILDKITE_COMMIT must be set}" container_name="xpu_${BUILDKITE_COMMIT}_$( tr -dc A-Za-z0-9 &2 base_image_name="${upstream_base_image}" return fi echo "WARNING: ${upstream_base_image} unavailable remotely and locally" >&2 base_image_name="${VLLM_BASE:-${local_base_image}}" if [ -z "$(docker images -q "${base_image_name}")" ]; then echo "WARNING: building ${base_image_name} from vLLM ${VLLM_VERSION} source" >&2 build_vllm_base fi } resolve_vllm_base # Try building the docker image docker_build "${image_name}" --build-arg "VLLM_BASE=${base_image_name}" --build-arg "VLLM_VERSION=${VLLM_VERSION}" # Setup cleanup remove_docker_container() { docker rm -f "${container_name}" || true docker image rm -f "${image_name}" || true docker system prune -f || true } trap remove_docker_container EXIT HF_CACHE="${HF_CACHE:-$(realpath ~)/.cache/huggingface}" mkdir -p "${HF_CACHE}" HF_MOUNT="/root/.cache/huggingface" time timeout -k 30 30m docker run \ --device /dev/dri:/dev/dri \ --net=host \ --ipc=host \ -v /dev/dri/by-path:/dev/dri/by-path \ -v "${HF_CACHE}:${HF_MOUNT}" \ --security-opt seccomp=unconfined \ --entrypoint="" \ -e VLLM_LOGGING_LEVEL \ -e VLLM_OMNI_LOGGING_LEVEL \ -e HF_TOKEN \ -e ZE_AFFINITY_MASK \ --name "${container_name}" \ "${image_name}" \ bash -c ' set -e echo $ZE_AFFINITY_MASK pip install tblib==3.1.0 cd /workspace/vllm-omni XPU_TEST_PATHS="tests/diffusion tests/dfx tests/e2e" pytest -v -s $XPU_TEST_PATHS -m "core_model and xpu and B60" pytest -v -s tests/diffusion/quantization/test_mxfp8_config.py pytest -v -s $XPU_TEST_PATHS -m "advanced_model and xpu and B60" pytest -v -s $XPU_TEST_PATHS -m "omni and xpu and B60" '