[CI][Release] Fix release wheel builds: stop excluding tracked recipes/ from Docker context (#62221)

Signed-off-by: khluu <khluu000@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: vllm-agent <claw@inferact.ai>
This commit is contained in:
Kevin H. Luu
2026-10-18 00:48:00 -07:00
committed by GitHub
co-authored by Claude Opus 5.5 vllm-agent
parent b510857d37
commit 83c9a547bf
3 changed files with 54 additions and 2 deletions
-2
View File
@@ -6,8 +6,6 @@
dist
vllm/*.so
vllm/vllm-rs
# Model recipes are rendered by vllm-project/recipes, never part of the image.
/recipes
# Byte-compiled / optimized / DLL files
__pycache__/
+6
View File
@@ -277,6 +277,12 @@ repos:
files: ^docker/(Dockerfile|versions\.json)$
pass_filenames: false
additional_dependencies: [dockerfile-parse]
- id: check-dockerignore-tracked
name: Check .dockerignore does not exclude tracked files
entry: python tools/pre_commit/check_dockerignore_tracked.py
language: python
always_run: true
pass_filenames: false
- id: check-boolean-context-manager
name: Check for boolean ops in with-statements
entry: python tools/pre_commit/check_boolean_context_manager.py
@@ -0,0 +1,48 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
"""Check that no root-anchored `.dockerignore` entry excludes tracked files.
Docker builds bind-mount `.git` but copy the working tree through the build
context, so git sees any tracked file that `.dockerignore` drops as deleted.
That dirty tree fails `tools/check_repo.sh` in release builds
(`GIT_REPO_CHECK=1`) and adds a `.dYYYYMMDD` dirty suffix to the wheel version.
Usage:
python tools/pre_commit/check_dockerignore_tracked.py
"""
import subprocess
import sys
from pathlib import Path
DOCKERIGNORE = Path(".dockerignore")
def main() -> int:
rooted = [
line.strip().strip("/")
for line in DOCKERIGNORE.read_text(encoding="utf-8").splitlines()
if line.startswith("/")
]
if not rooted:
return 0
tracked = subprocess.run(
["git", "ls-files", "--", *rooted],
check=True,
stdout=subprocess.PIPE,
text=True,
).stdout.split()
if not tracked:
return 0
print(
f"{DOCKERIGNORE} excludes {len(tracked)} tracked file(s). Docker builds "
"would see them as deleted and the git tree as dirty, failing "
"tools/check_repo.sh in release builds. First few:"
)
for path in tracked[:10]:
print(f" {path}")
return 1
if __name__ == "__main__":
sys.exit(main())