@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 0585b5ba2e
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 2, 11:00 UTC

Skip docs build if PR doesn't affect docs (#43972)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

Harry Mellor committed May 29, 2026 at 13:09 UTC 0585b5ba2eaa7860d6976bc7ba376bdbca5119fc
2 files changed +59 -40
.readthedocs.yaml
+1 -1
@@ -9,8 +9,8 @@ build:
9 python: "3.12"
10 jobs:
11 post_checkout:
12 - - bash docs/pre_run_check.sh
12 - git fetch origin main --unshallow --no-tags --filter=blob:none || true
13 + - bash docs/pre_run_check.sh
14 pre_create_environment:
15 - pip install uv
16 create_environment:
docs/pre_run_check.sh
+58 -39
@@ -1,41 +1,60 @@
1 -if [ "$READTHEDOCS_VERSION_TYPE" = "external" ]; then
2 - MAX_WAIT=300
3 - INTERVAL=60
4 - ELAPSED=0
5 - while :; do
6 - RAW=$(curl -sS -w "\n%{http_code}" "https://api.github.com/repos/vllm-project/vllm/commits/${READTHEDOCS_GIT_COMMIT_HASH}/check-runs?check_name=pre-run-check&filter=latest")
7 - HTTP_CODE=$(printf %s "$RAW" | tail -n1)
8 - BODY=$(printf %s "$RAW" | sed '$d')
9 - if [ "$HTTP_CODE" != "200" ]; then
10 - echo "GitHub API returned HTTP $HTTP_CODE (likely rate-limited); skipping pre-run-check gate."
11 - break
12 - fi
13 - STATUS=$(printf %s "$BODY" | python3 -c "import sys, json; r=json.load(sys.stdin).get(\"check_runs\",[]); print((r[0].get(\"status\") or \"\") if r else \"none\")")
14 - CONCLUSION=$(printf %s "$BODY" | python3 -c "import sys, json; r=json.load(sys.stdin).get(\"check_runs\",[]); print((r[0].get(\"conclusion\") or \"\") if r else \"\")")
15 - CHECK_URL=$(printf %s "$BODY" | python3 -c "import sys, json; r=json.load(sys.stdin).get(\"check_runs\",[]); print((r[0].get(\"html_url\") or \"\") if r else \"\")")
16 - if [ "$STATUS" = "none" ]; then
17 - echo "no pre-run-check found for this commit; skipping gate."
18 - break
19 - fi
20 - if [ -n "$CONCLUSION" ]; then
21 - echo "pre-run-check conclusion: $CONCLUSION"
22 - if [ "$CONCLUSION" = "failure" ] || [ "$CONCLUSION" = "cancelled" ] || [ "$CONCLUSION" = "timed_out" ]; then
23 - echo "pre-run-check did not pass; skipping docs build."
24 - if [ -n "$CHECK_URL" ]; then
25 - echo "pre-run-check failure reason: $CHECK_URL"
26 - fi
27 - exit 1
1 +if [ "$READTHEDOCS_VERSION_TYPE" != "external" ]; then
2 + echo "Not a PR build (version type=$READTHEDOCS_VERSION_TYPE); skipping pre-run-check gate."
3 + exit 0
4 +fi
5 +
6 +echo "Checking for changes to docs-affecting files vs origin/main..."
7 +DOCS_PATHS=(
8 + docs/ # Actual docs content
9 + examples/ # Examples are rendered in docs
10 + vllm/ # API & CLI reference
11 + requirements/test/cuda.txt # CLI reference (see docs/mkdocs/hooks/generate_argparse.py)
12 + mkdocs.yaml # Affects build process
13 + .readthedocs.yaml # Affects build process
14 + requirements/docs.txt # Affects build process
15 + requirements/docs.in # Affects build process
16 +)
17 +if git diff --quiet origin/main -- "${DOCS_PATHS[@]}"; then
18 + echo "No docs-affecting files changed vs origin/main; cancelling build."
19 + # See https://docs.readthedocs.com/platform/latest/guides/build/skip-build.html for info on exit code
20 + exit 183
21 +fi
22 +echo "Docs-affecting files changed; continuing pre-run-check."
23 +echo "Checking pre-commit/pre-run-check status..."
24 +MAX_WAIT=300
25 +INTERVAL=60
26 +ELAPSED=0
27 +while :; do
28 + RAW=$(curl -sS -w "\n%{http_code}" "https://api.github.com/repos/vllm-project/vllm/commits/${READTHEDOCS_GIT_COMMIT_HASH}/check-runs?check_name=pre-run-check&filter=latest")
29 + HTTP_CODE=$(printf %s "$RAW" | tail -n1)
30 + BODY=$(printf %s "$RAW" | sed '$d')
31 + if [ "$HTTP_CODE" != "200" ]; then
32 + echo "GitHub API returned HTTP $HTTP_CODE (likely rate-limited); skipping pre-commit/pre-run-check gate."
33 + break
34 + fi
35 + STATUS=$(printf %s "$BODY" | python3 -c "import sys, json; r=json.load(sys.stdin).get(\"check_runs\",[]); print((r[0].get(\"status\") or \"\") if r else \"none\")")
36 + CONCLUSION=$(printf %s "$BODY" | python3 -c "import sys, json; r=json.load(sys.stdin).get(\"check_runs\",[]); print((r[0].get(\"conclusion\") or \"\") if r else \"\")")
37 + CHECK_URL=$(printf %s "$BODY" | python3 -c "import sys, json; r=json.load(sys.stdin).get(\"check_runs\",[]); print((r[0].get(\"html_url\") or \"\") if r else \"\")")
38 + if [ "$STATUS" = "none" ]; then
39 + echo "no pre-commit/pre-run-check found for this commit; skipping gate."
40 + break
41 + fi
42 + if [ -n "$CONCLUSION" ]; then
43 + echo "pre-commit/pre-run-check conclusion: $CONCLUSION"
44 + if [ "$CONCLUSION" = "failure" ] || [ "$CONCLUSION" = "cancelled" ] || [ "$CONCLUSION" = "timed_out" ]; then
45 + echo "pre-commit/pre-run-check did not pass; skipping docs build."
46 + if [ -n "$CHECK_URL" ]; then
47 + echo "pre-commit/pre-run-check failure reason: $CHECK_URL"
48 fi
29 - break
49 + exit 1
50 fi
31 - if [ "$ELAPSED" -ge "$MAX_WAIT" ]; then
32 - echo "pre-run-check status=$STATUS after ${MAX_WAIT}s; skipping gate."
33 - break
34 - fi
35 - echo "pre-run-check status=$STATUS; waiting ${INTERVAL}s..."
36 - sleep "$INTERVAL"
37 - ELAPSED=$((ELAPSED + INTERVAL))
38 - done
39 -else
40 - echo "Not a PR build (version type=$READTHEDOCS_VERSION_TYPE); skipping pre-run-check gate."
41 -fi
\ No newline at end of file
51 + break
52 + fi
53 + if [ "$ELAPSED" -ge "$MAX_WAIT" ]; then
54 + echo "pre-commit/pre-run-check status=$STATUS after ${MAX_WAIT}s; skipping gate."
55 + break
56 + fi
57 + echo "pre-commit/pre-run-check status=$STATUS; waiting ${INTERVAL}s..."
58 + sleep "$INTERVAL"
59 + ELAPSED=$((ELAPSED + INTERVAL))
60 +done