@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 1109f98288
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 12, 02:15 UTC

[CI] fix docker image build by specifying merge-base commit id when downloading pre-compiled wheels (#29930)

Signed-off-by: Shengqi Chen <harry-chen@outlook.com>

Shengqi Chen committed Dec 4, 2025 at 06:08 UTC 1109f98288b4a77f10e6f3b520b07005a0143b13
5 files changed +22 -64
.buildkite/generate_index.py deleted
-46
@@ -1,46 +0,0 @@
1 -# SPDX-License-Identifier: Apache-2.0
2 -# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 -
4 -import argparse
5 -import os
6 -
7 -template = """<!DOCTYPE html>
8 -<html>
9 - <body>
10 - <h1>Links for vLLM</h1/>
11 - <a href="../{x86_wheel_html_escaped}">{x86_wheel}</a><br/>
12 - <a href="../{arm_wheel_html_escaped}">{arm_wheel}</a><br/>
13 - </body>
14 -</html>
15 -"""
16 -
17 -parser = argparse.ArgumentParser()
18 -parser.add_argument("--wheel", help="The wheel path.", required=True)
19 -args = parser.parse_args()
20 -
21 -filename = os.path.basename(args.wheel)
22 -
23 -with open("index.html", "w") as f:
24 - print(f"Generated index.html for {args.wheel}")
25 - # sync the abi tag with .buildkite/scripts/upload-wheels.sh
26 - if "x86_64" in filename:
27 - x86_wheel = filename
28 - arm_wheel = filename.replace("x86_64", "aarch64").replace(
29 - "manylinux1", "manylinux2014"
30 - )
31 - elif "aarch64" in filename:
32 - x86_wheel = filename.replace("aarch64", "x86_64").replace(
33 - "manylinux2014", "manylinux1"
34 - )
35 - arm_wheel = filename
36 - else:
37 - raise ValueError(f"Unsupported wheel: {filename}")
38 - # cloudfront requires escaping the '+' character
39 - f.write(
40 - template.format(
41 - x86_wheel=x86_wheel,
42 - x86_wheel_html_escaped=x86_wheel.replace("+", "%2B"),
43 - arm_wheel=arm_wheel,
44 - arm_wheel_html_escaped=arm_wheel.replace("+", "%2B"),
45 - )
46 - )
docker/Dockerfile
+3
@@ -196,6 +196,7 @@ ARG SCCACHE_S3_NO_CREDENTIALS=0
196
197 # Flag to control whether to use pre-built vLLM wheels
198 ARG VLLM_USE_PRECOMPILED=""
199 +ARG VLLM_MERGE_BASE_COMMIT=""
200 ARG VLLM_MAIN_CUDA_VERSION=""
201
202 # Use dummy version for csrc-build wheel (only .so files are extracted, version doesn't matter)
@@ -216,6 +217,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
217 && export SCCACHE_IDLE_TIMEOUT=0 \
218 && export CMAKE_BUILD_TYPE=Release \
219 && export VLLM_USE_PRECOMPILED="${VLLM_USE_PRECOMPILED}" \
220 + && export VLLM_PRECOMPILED_WHEEL_COMMIT="${VLLM_MERGE_BASE_COMMIT}" \
221 && export VLLM_MAIN_CUDA_VERSION="${VLLM_MAIN_CUDA_VERSION}" \
222 && export VLLM_DOCKER_BUILD_CONTEXT=1 \
223 && sccache --show-stats \
@@ -233,6 +235,7 @@ RUN --mount=type=cache,target=/root/.cache/ccache \
235 rm -rf .deps && \
236 mkdir -p .deps && \
237 export VLLM_USE_PRECOMPILED="${VLLM_USE_PRECOMPILED}" && \
238 + export VLLM_PRECOMPILED_WHEEL_COMMIT="${VLLM_MERGE_BASE_COMMIT}" && \
239 export VLLM_DOCKER_BUILD_CONTEXT=1 && \
240 python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
241 fi
setup.py
+14 -11
@@ -346,10 +346,13 @@ class precompiled_wheel_utils:
346 The order of preference is:
347 1. user-specified wheel location (can be either local or remote, via
348 VLLM_PRECOMPILED_WHEEL_LOCATION)
349 - 2. user-specified variant from nightly repo (current main commit via
350 - VLLM_PRECOMPILED_WHEEL_VARIANT)
349 + 2. user-specified variant (VLLM_PRECOMPILED_WHEEL_VARIANT) from nightly repo
350 3. the variant corresponding to VLLM_MAIN_CUDA_VERSION from nightly repo
352 - 4. the default variant from nightly repo (current main commit)
351 + 4. the default variant from nightly repo
352 +
353 + If downloading from the nightly repo, the commit can be specified via
354 + VLLM_PRECOMPILED_WHEEL_COMMIT; otherwise, the head commit in the main branch
355 + is used.
356 """
357 wheel_location = os.getenv("VLLM_PRECOMPILED_WHEEL_LOCATION", None)
358 if wheel_location is not None:
@@ -362,10 +365,13 @@ class precompiled_wheel_utils:
365 # try to fetch the wheel metadata from the nightly wheel repo
366 main_variant = "cu" + envs.VLLM_MAIN_CUDA_VERSION.replace(".", "")
367 variant = os.getenv("VLLM_PRECOMPILED_WHEEL_VARIANT", main_variant)
365 - commit = os.getenv(
366 - "VLLM_PRECOMPILED_WHEEL_COMMIT",
367 - precompiled_wheel_utils.get_base_commit_in_main_branch(),
368 - )
368 + commit = os.getenv("VLLM_PRECOMPILED_WHEEL_COMMIT", "").lower()
369 + if not commit or len(commit) != 40:
370 + print(
371 + f"VLLM_PRECOMPILED_WHEEL_COMMIT not valid: {commit}"
372 + ", trying to fetch base commit in main branch"
373 + )
374 + commit = precompiled_wheel_utils.get_base_commit_in_main_branch()
375 print(f"Using precompiled wheel commit {commit} with variant {variant}")
376 try_default = False
377 wheels, repo_url, download_filename = None, None, None
@@ -502,10 +508,6 @@ class precompiled_wheel_utils:
508
509 @staticmethod
510 def get_base_commit_in_main_branch() -> str:
505 - # Force to use the nightly wheel. This is mainly used for CI testing.
506 - if envs.VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL:
507 - return "nightly"
508 -
511 try:
512 # Get the latest commit hash of the upstream main branch.
513 resp_json = subprocess.check_output(
@@ -516,6 +518,7 @@ class precompiled_wheel_utils:
518 ]
519 ).decode("utf-8")
520 upstream_main_commit = json.loads(resp_json)["sha"]
521 + print(f"Upstream main branch latest commit: {upstream_main_commit}")
522
523 # In Docker build context, .git may be immutable or missing.
524 if envs.VLLM_DOCKER_BUILD_CONTEXT:
tests/standalone_tests/python_only_compile.sh
+5 -1
@@ -5,6 +5,10 @@
5 set -e
6 set -x
7
8 +merge_base_commit=$(git merge-base HEAD origin/main)
9 +echo "Current merge base commit with main: $merge_base_commit"
10 +git show --oneline -s $merge_base_commit
11 +
12 cd /vllm-workspace/
13
14 # uninstall vllm
@@ -18,7 +22,7 @@ apt autoremove -y
22
23 echo 'import os; os.system("touch /tmp/changed.file")' >> vllm/__init__.py
24
21 -VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL=1 VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
25 +VLLM_PRECOMPILED_WHEEL_COMMIT=$merge_base_commit VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
26
27 # Run the script
28 python3 -c 'import vllm'
vllm/envs.py
-6
@@ -80,7 +80,6 @@ if TYPE_CHECKING:
80 VLLM_USE_PRECOMPILED: bool = False
81 VLLM_SKIP_PRECOMPILED_VERSION_SUFFIX: bool = False
82 VLLM_DOCKER_BUILD_CONTEXT: bool = False
83 - VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL: bool = False
83 VLLM_KEEP_ALIVE_ON_ENGINE_DEATH: bool = False
84 CMAKE_BUILD_TYPE: Literal["Debug", "Release", "RelWithDebInfo"] | None = None
85 VERBOSE: bool = False
@@ -473,11 +472,6 @@ environment_variables: dict[str, Callable[[], Any]] = {
472 .strip()
473 .lower()
474 in ("1", "true"),
476 - # Whether to force using nightly wheel in python build.
477 - # This is used for testing the nightly wheel in python build.
478 - "VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL": lambda: bool(
479 - int(os.getenv("VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL", "0"))
480 - ),
475 # CMake build type
476 # If not set, defaults to "Debug" or "RelWithDebInfo"
477 # Available options: "Debug", "Release", "RelWithDebInfo"