Skip to content

Commit 96aabe7

Browse files
author
Ylang Tsou
committed
add check pypi version
Signed-off-by: Ylang Tsou <[email protected]>
1 parent 1bed7e4 commit 96aabe7

File tree

3 files changed

+48
-16
lines changed

3 files changed

+48
-16
lines changed

.buildkite/pipeline_pypi.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,10 @@ steps:
22
# -----------------------------------------------------------------
33
# TEST STEPS - Calling wrapper
44
# -----------------------------------------------------------------
5-
- label: "Wait for 20 mins"
6-
if: build.env("NIGHTLY") == "1"
7-
key: "wait_20_minutes"
8-
depends_on: "record_verified_commit_hashes"
9-
agents:
10-
queue: cpu
11-
commands:
12-
- "echo 'Starting 20 minute delay...'"
13-
- "sleep 1200"
14-
- "echo 'Delay finished, starting benchmarks.'"
15-
165
- label: "Performance benchmarks for meta-llama/Llama-3.1-8B-Instruct"
176
key: "meta-llama_Llama-3_1-8B-Instruct_Benchmark"
18-
if: build.env("NIGHTLY") == "1"
19-
depends_on: "wait_20_minutes"
7+
#if: build.env("NIGHTLY") == "1"
8+
depends_on: "record_verified_commit_hashes"
209
agents:
2110
queue: tpu_v6e_queue
2211
env:
@@ -34,9 +23,9 @@ steps:
3423
.buildkite/scripts/run_with_pypi.sh bash /workspace/tpu_inference/tests/e2e/benchmarking/benchmark.sh
3524
3625
- label: "Performance benchmarks for Qwen/Qwen3-4B"
37-
if: build.env("NIGHTLY") == "1"
26+
#if: build.env("NIGHTLY") == "1"
3827
key: "Qwen_Qwen3-4B_Benchmark"
39-
depends_on: "wait_20_minutes"
28+
depends_on: "record_verified_commit_hashes"
4029
agents:
4130
queue: tpu_v6e_queue
4231
env:

.buildkite/scripts/run_with_pypi.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,43 @@
22
# Exit on error, exit on unset variable, fail on pipe errors.
33
set -euo pipefail
44

5+
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
6+
echo "Error: Not a git repository. Cannot calculate version from tags."
7+
exit 1
8+
fi
9+
# Get the TPU_INFERENCE_VERSION based on the latest stable tag and current date.
10+
LATEST_STABLE_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
11+
BASE_VERSION=${LATEST_STABLE_TAG#v}
12+
DATETIME_STR=$(date -d 'yesterday' +%Y%m%d)
13+
TPU_INFERENCE_VERSION="${BASE_VERSION}.dev${DATETIME_STR}"
14+
15+
echo "Target Nightly Version: ${TPU_INFERENCE_VERSION}"
16+
17+
PACKAGE_NAME="tpu-inference"
18+
MAX_RETRIES=20
19+
SLEEP_SEC=60
20+
FOUND_VERSION=false
21+
22+
echo "Checking PyPI for ${PACKAGE_NAME} == ${TPU_INFERENCE_VERSION}..."
23+
24+
for ((i=1; i<=MAX_RETRIES; i++)); do
25+
if pip index versions "${PACKAGE_NAME}" --pre 2>/dev/null | grep -q "${TPU_INFERENCE_VERSION}"; then
26+
echo "✅ Success! Found version ${TPU_INFERENCE_VERSION} on PyPI."
27+
FOUND_VERSION=true
28+
break
29+
fi
30+
31+
echo "[Attempt $i/$MAX_RETRIES] Version not found yet. Waiting ${SLEEP_SEC} seconds..."
32+
if [ "$i" -lt "$MAX_RETRIES" ]; then
33+
sleep "$SLEEP_SEC"
34+
fi
35+
done
36+
37+
if [ "$FOUND_VERSION" = "false" ]; then
38+
echo "The version ${TPU_INFERENCE_VERSION} was not found on PyPI."
39+
exit 1
40+
fi
41+
542
# Build vllm-tpu with nightly tpu-inference from PyPI (using docker/Dockerfile.pypi instead of docker/Dockerfile).
643
export RUN_WITH_PYPI="true"
744
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

docker/Dockerfile.pypi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ ARG VLLM_COMMIT_HASH=""
55

66
FROM $BASE_IMAGE
77

8+
ARG IS_FOR_V7X="false"
9+
810
# Remove existing versions of dependencies
911
RUN pip uninstall -y torch torch_xla torchvision
1012

@@ -17,7 +19,11 @@ RUN apt-get update && apt-get install -y \
1719
WORKDIR /workspace/tpu_inference
1820
COPY requirements_benchmarking.txt .
1921
# These are needed for the E2E benchmarking tests (i.e. tests/e2e/benchmarking/mlperf.sh)
20-
RUN pip install -r requirements_benchmarking.txt --retries 3
22+
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements_benchmarking.txt --retries 3
23+
COPY requirements_v7x.txt .
24+
RUN --mount=type=cache,target=/root/.cache/pip if [ "$IS_FOR_V7X" = "true" ]; then \
25+
pip install -r requirements_v7x.txt; \
26+
fi
2127
COPY . .
2228

2329
# Build vllm-tpu wheel

0 commit comments

Comments
 (0)