[ROCm][CI] pass merge-base to container for python-only wheel metadata (#45869)

Signed-off-by: Divakar Verma <divakar.verma@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>

Divakar Verma committed Jun 23, 2026 at 11:44 UTC 568874fec2e6070684ee1a0547fe720dcf7322b9
3 files changed +76 -4
.buildkite/scripts/hardware_ci/run-amd-test.sh
+33
@@ -367,6 +367,20 @@ remove_docker_container() {
367 }
368 trap remove_docker_container EXIT
369
370 +# python_only_compile.sh runs `python setup.py develop` and needs the full repo tree
371 +# under /vllm-workspace (Dockerfile.rocm test stage: mkdir src && mv vllm).
372 +# The ROCm wheel artifact tarball only ships a thin tree (tests, etc.), so
373 +# artifact images cannot satisfy that test — use the full rocm/vllm-ci image.
374 +_cmd_probe="${VLLM_TEST_COMMANDS:-}"
375 +if [[ -z "${_cmd_probe}" ]]; then
376 + _cmd_probe="$*"
377 +fi
378 +if [[ "${VLLM_CI_USE_ARTIFACTS:-0}" == "1" && "${_cmd_probe}" == *python_only_compile.sh* ]]; then
379 + echo "INFO: disabling VLLM_CI_USE_ARTIFACTS for python_only_compile (requires full /vllm-workspace tree)"
380 + export VLLM_CI_USE_ARTIFACTS=0
381 +fi
382 +unset -v _cmd_probe
383 +
384 if ! prepare_artifact_image; then
385 echo "Using full ROCm CI image: ${image_name}"
386 docker pull "${image_name}" || exit 1
@@ -426,6 +440,24 @@ fi
440
441 echo "Final commands: $commands"
442
443 +# The ROCm test image often ships /vllm-workspace without .git (artifact tarball unpack).
444 +# tests/standalone_tests/python_only_compile.sh uses merge-base(HEAD, origin/main) for
445 +# wheels.vllm.ai; compute on the agent (full git checkout) and pass into the container.
446 +vllm_standalone_merge_base=""
447 +checkout="${BUILDKITE_BUILD_CHECKOUT_PATH:-}"
448 +if [[ -z "${checkout}" || ! -d "${checkout}" ]]; then
449 + checkout="."
450 +fi
451 +if git -C "${checkout}" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
452 + vllm_standalone_merge_base="$(
453 + git -C "${checkout}" merge-base HEAD origin/main 2>/dev/null || true
454 + )"
455 +fi
456 +if [[ -z "${vllm_standalone_merge_base}" ]]; then
457 + vllm_standalone_merge_base="${BUILDKITE_COMMIT:-}"
458 +fi
459 +echo "INFO: passing VLLM_STANDALONE_MERGE_BASE into container: ${vllm_standalone_merge_base}"
460 +
461 MYPYTHONPATH="/vllm-workspace"
462
463 container_job_id="${BUILDKITE_JOB_ID:-${BUILDKITE_PARALLEL_JOB:-0}}"
@@ -525,6 +557,7 @@ else
557 -e "VLLM_CACHE_ROOT=${CONTAINER_CACHE_ROOT}/vllm" \
558 -e "XDG_CACHE_HOME=${CONTAINER_CACHE_ROOT}/xdg" \
559 -e "PYTORCH_ROCM_ARCH=" \
560 + -e "VLLM_STANDALONE_MERGE_BASE=${vllm_standalone_merge_base}" \
561 --name "${container_name}" \
562 "${image_name}" \
563 /bin/bash -c "${CONTAINER_PREFLIGHT} && ${commands}"
.buildkite/test_areas/misc.yaml
+10
@@ -262,6 +262,16 @@ steps:
262 - setup.py
263 commands:
264 - bash standalone_tests/python_only_compile.sh
265 + mirror:
266 + amd:
267 + device: mi325_1
268 + timeout_in_minutes: 20
269 + depends_on:
270 + - image-build-amd
271 + source_file_dependencies:
272 + - tests/standalone_tests/python_only_compile.sh
273 + - setup.py
274 + - vllm/platforms/rocm.py
275
276 - label: Async Engine, Inputs, Utils, Worker
277 device: h200_35gb
tests/standalone_tests/python_only_compile.sh
+33 -4
@@ -4,9 +4,26 @@
4
5 set -e
6
7 -merge_base_commit=$(git merge-base HEAD origin/main)
7 +# ROCm CI runs this script inside `run-amd-test.sh` where /vllm-workspace often has no .git
8 +# (wheel artifact layout). The wrapper passes VLLM_STANDALONE_MERGE_BASE from the agent checkout.
9 +merge_base_commit=""
10 +if [[ -n "${VLLM_STANDALONE_MERGE_BASE:-}" ]]; then
11 + merge_base_commit="${VLLM_STANDALONE_MERGE_BASE}"
12 +elif merge_base_commit="$(git -C /vllm-workspace merge-base HEAD origin/main 2>/dev/null)"; then
13 + :
14 +elif merge_base_commit="$(git merge-base HEAD origin/main 2>/dev/null)"; then
15 + :
16 +else
17 + echo "ERROR: need a git checkout or VLLM_STANDALONE_MERGE_BASE to resolve wheels.vllm.ai commit." >&2
18 + exit 1
19 +fi
20 +
21 echo "INFO: current merge base commit with main: $merge_base_commit"
9 -git show --oneline -s "$merge_base_commit"
22 +if git show --oneline -s "$merge_base_commit" 2>/dev/null; then
23 + :
24 +else
25 + echo "INFO: git show unavailable in this environment; using SHA above for precompiled metadata."
26 +fi
27
28 # test whether the metadata.json url is valid, retry each 3 minutes up to 5 times
29 # this avoids cumbersome error messages & manual retries in case the precompiled wheel
@@ -59,7 +76,12 @@ cd /vllm-workspace/
76 # uninstall vllm
77 pip3 uninstall -y vllm
78 # restore the original files
62 -mv src/vllm ./vllm
79 +if [[ -d src/vllm ]]; then
80 + mv src/vllm ./vllm
81 +elif [[ ! -d vllm ]]; then
82 + echo "ERROR: expected vllm package at /vllm-workspace/src/vllm or /vllm-workspace/vllm" >&2
83 + exit 1
84 +fi
85
86 # remove all compilers
87 apt remove --purge build-essential -y
@@ -67,7 +89,14 @@ apt autoremove -y
89
90 echo 'import os; os.system("touch /tmp/changed.file")' >> vllm/__init__.py
91
70 -VLLM_PRECOMPILED_WHEEL_COMMIT=$merge_base_commit VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
92 +# ROCm CI uses setuptools develop for editable installs (see Dockerfile.rocm and run-amd-test.sh).
93 +_vllm_target_lower="$(printf '%s' "${VLLM_TARGET_DEVICE:-}" | tr '[:upper:]' '[:lower:]')"
94 +if [[ "${_vllm_target_lower}" == "rocm" ]]; then
95 + VLLM_PRECOMPILED_WHEEL_COMMIT=$merge_base_commit VLLM_USE_PRECOMPILED=1 python3 setup.py develop
96 +else
97 + VLLM_PRECOMPILED_WHEEL_COMMIT=$merge_base_commit VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
98 +fi
99 +unset -v _vllm_target_lower
100 # Run the script
101 python3 -c 'import vllm'
102