diff --git a/.buildkite/scripts/hardware_ci/run-intel-test.sh b/.buildkite/scripts/hardware_ci/run-intel-test.sh index eae3b231b4..0cbe1b5a0f 100755 --- a/.buildkite/scripts/hardware_ci/run-intel-test.sh +++ b/.buildkite/scripts/hardware_ci/run-intel-test.sh @@ -352,17 +352,31 @@ if [[ -z "${ZE_AFFINITY_MASK:-}" ]]; then echo "Warning: ZE_AFFINITY_MASK is not set. Proceeding without device affinity." >&2 fi -docker run \ +export CMDS="${commands}" +export HF_TOKEN ZE_AFFINITY_MASK + +{ + flock 9 + if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then + echo 'Image missing before container creation, pulling again...' + timeout 900 docker pull "${IMAGE}" + fi + + docker create \ --device /dev/dri:/dev/dri \ --net=host \ --ipc=host \ --privileged \ -v /dev/dri/by-path:/dev/dri/by-path \ - -v ${HOME}/.cache/huggingface:/root/.cache/huggingface \ - --entrypoint="" \ - -e "HF_TOKEN=${HF_TOKEN:-}" \ - -e "ZE_AFFINITY_MASK=${ZE_AFFINITY_MASK:-}" \ - -e "CMDS=${commands}" \ + -v "${HOME}/.cache/huggingface:/root/.cache/huggingface" \ + --entrypoint='' \ + -e HF_TOKEN \ + -e ZE_AFFINITY_MASK \ + -e CMDS \ --name "${container_name}" \ - "${image_name}" \ - bash -c 'set -e; echo "ZE_AFFINITY_MASK is ${ZE_AFFINITY_MASK:-}"; eval "$CMDS"' + "${IMAGE}" \ + bash -c 'set -e; echo "ZE_AFFINITY_MASK is ${ZE_AFFINITY_MASK:-}"; eval "$CMDS"' \ + >/dev/null +} 9>/tmp/docker-pull.lock + +docker start -a "${container_name}"