[CI][ROCm] Avoid redundant image pulls during smoke validation (#54408)
Signed-off-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
co-authored by
OpenAI Codex
parent
c28feab989
commit
907b1a7f22
@@ -3,6 +3,53 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
run_smoke_checks() {
|
||||
local required_dir=""
|
||||
|
||||
for required_dir in \
|
||||
/vllm-workspace \
|
||||
/vllm-workspace/tests \
|
||||
/vllm-workspace/src/vllm; do
|
||||
if [[ ! -d "${required_dir}" ]]; then
|
||||
echo "Missing directory: ${required_dir}" >&2
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
if [[ ! -x /vllm-workspace/src/vllm/vllm-rs ]]; then
|
||||
echo "Missing executable: /vllm-workspace/src/vllm/vllm-rs" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
command -v python3
|
||||
command -v uv
|
||||
command -v pytest
|
||||
|
||||
if ! command -v amd-smi >/dev/null 2>&1 \
|
||||
&& ! command -v rocminfo >/dev/null 2>&1; then
|
||||
echo "No ROCm CLI found in image" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 - <<'PY'
|
||||
import torch
|
||||
import vllm
|
||||
|
||||
print(torch.__version__)
|
||||
print(vllm.__version__)
|
||||
PY
|
||||
|
||||
echo "AMD image smoke OK"
|
||||
}
|
||||
|
||||
if [[ "${1:-}" == "--inside" ]]; then
|
||||
run_smoke_checks
|
||||
exit
|
||||
fi
|
||||
if (($#)); then
|
||||
echo "Usage: $0 [--inside]" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ "${ROCM_CI_ARTIFACT_ONLY:-0}" == "1" ]]; then
|
||||
base_refreshed=""
|
||||
if command -v buildkite-agent >/dev/null 2>&1; then
|
||||
@@ -14,30 +61,24 @@ if [[ "${ROCM_CI_ARTIFACT_ONLY:-0}" == "1" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
smoke_marker="./build/rocm-smoke-export/vllm-smoke-ok"
|
||||
expected_smoke_id="${BUILDKITE_BUILD_ID:-local}"
|
||||
if [[ -f "${smoke_marker}" \
|
||||
&& ( -z "${VLLM_CI_SMOKE_IMAGE:-}" \
|
||||
|| "${VLLM_CI_SMOKE_IMAGE}" == "${IMAGE_TAG:-}" ) ]]; then
|
||||
actual_smoke_id="$(< "${smoke_marker}")"
|
||||
if [[ "${actual_smoke_id}" != "${expected_smoke_id}" ]]; then
|
||||
echo "ROCm smoke marker belongs to ${actual_smoke_id}, not ${expected_smoke_id}" \
|
||||
>&2
|
||||
exit 1
|
||||
fi
|
||||
echo "AMD image smoke OK (verified inside BuildKit)"
|
||||
rm -f -- "${smoke_marker}"
|
||||
rmdir -- "$(dirname "${smoke_marker}")" 2>/dev/null || true
|
||||
exit
|
||||
fi
|
||||
|
||||
image_ref="${VLLM_CI_SMOKE_IMAGE:-${IMAGE_TAG:-rocm/vllm-ci:${BUILDKITE_COMMIT:?BUILDKITE_COMMIT is required}}}"
|
||||
|
||||
docker run --rm --network=none --entrypoint /bin/bash "${image_ref}" -ec '
|
||||
if [ ! -d /vllm-workspace ]; then echo Missing directory: /vllm-workspace >&2; exit 1; fi
|
||||
if [ ! -d /vllm-workspace/tests ]; then echo Missing directory: /vllm-workspace/tests >&2; exit 1; fi
|
||||
if [ ! -d /vllm-workspace/src/vllm ]; then echo Missing directory: /vllm-workspace/src/vllm >&2; exit 1; fi
|
||||
if [ ! -x /vllm-workspace/src/vllm/vllm-rs ]; then echo Missing executable: /vllm-workspace/src/vllm/vllm-rs >&2; exit 1; fi
|
||||
|
||||
command -v python3
|
||||
command -v uv
|
||||
command -v pytest
|
||||
|
||||
if ! command -v amd-smi >/dev/null 2>&1 && ! command -v rocminfo >/dev/null 2>&1; then
|
||||
echo No ROCm CLI found in image >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
python3 - <<PY
|
||||
import torch
|
||||
import vllm
|
||||
|
||||
print(torch.__version__)
|
||||
print(vllm.__version__)
|
||||
PY
|
||||
|
||||
echo AMD image smoke OK
|
||||
'
|
||||
docker run --rm -i --network=none --entrypoint /bin/bash "${image_ref}" \
|
||||
-s -- --inside < "${BASH_SOURCE[0]}"
|
||||
|
||||
Reference in New Issue
Block a user