Repository navigation
[doc][serve][llm] Remove Serve doc scripts no page shows, and show the ones a Dockerfile downloads - #66964
Merged
Conversation
…s a Dockerfile downloads Delete test_service_pb2.py, test_service_pb2_grpc.py, and vllm_example.py from serve/doc_code. No page includes them and nothing imports them, and custom-vllm.md uses custom_vllm_example.py. Drop vllm_example.py from the serve example test exclude list. The multi-app container guide downloads whisper_example.py and resnet50_example.py from their raw GitHub URLs on master. Show both on the page, and add a comment to each script naming the page so a rename doesn't break it silently. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the documentation and associated code examples for Ray Serve. Specifically, it adds new examples for Whisper and ResNet to the multi-app container guide, updates the Bazel build configuration to remove an obsolete vLLM example, and adds warning comments to the example files to prevent breaking external references. There are no review comments to address.
No page includes sglang_batch_example.py. The SGLang guide shows the serving, query, and multinode scripts only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
ronny-anyscale
approved these changes
Oct 13, 2026
dstrodtman
added a commit
that referenced
this pull request
Oct 13, 2026
…ta-loading page's testcode (#66967) ## Why are these changes needed? `doc/source/train/doc_code/data_ingest_torch_new.py` copies code that `train/user-guides/data-loading-preprocessing.md` already shows inline as `testcode`. No page `literalinclude`s the script, but the `train/doc_code/*.py` glob in `doc/BUILD.bazel` still runs it. So the same examples live in two places and get tested twice, and the two copies have drifted. A fix to the page doesn't reach the script, and a fix to the script doesn't reach the page. This PR deletes the script. Before deleting it, I compared each of its marked sections with the page: - `__basic__`: The page's quickstart and the cache block cover reading Iris, `normalize_length`, `map_batches`, and passing `datasets=` to `TorchTrainer`. The script's other extras, a commented-out `randomize_block_order` and `local_shuffle_buffer_size`, are covered by the page's links to the Ray Data shuffling guide. - `__custom_split__`: The page's "Split datasets" block is a superset. It splits only `train` with `datasets_to_split` and calls `fit()`. The script built the trainer but never ran it. - `__materialized__`: The page's "Cache the preprocessed dataset" block is a superset of this section. - `__custom__`: Matches the page's "Advanced: Full customization" block line for line, except that the page reads a different dataset. - `__options__`: `DataConfig.default_ingest_options()` with an `object_store_memory` override passed as `execution_options`. No page shows this snippet. It only built a trainer and asserted nothing. `DataConfig(execution_options=...)` is covered by the unit tests in `python/ray/train/v2/tests/test_data_config.py`, and the Ray Data performance tips page documents `resource_limits`. So I dropped it rather than moving it onto the page. The page needs no changes, and neither does `doc/BUILD.bazel`. The glob picks the script up implicitly, so deleting the file removes its test target. `git grep data_ingest_torch_new` returns nothing after this change. Reviewers: Is dropping the `__options__` snippet right, or should the Train data-loading page document per-trainer ingest resource limits? ## Duplicate check `gh pr list --state all --search data_ingest_torch_new` returns no PRs. This is one in a series of PRs that remove doc code no page shows, alongside #66966 (Core), #66965 (RLlib), and #66964 (Serve). None of them touch Train. ## Testing - `git grep data_ingest_torch_new` shows no remaining references in `.buildkite`, BUILD files, CODEOWNERS, or docs. - The pre-commit hooks pass on the commit. - The page's own `doctest[train-gpu]` target still runs the blocks that replace the script. This PR doesn't change them. This PR was prepared with AI assistance (Claude Code). I reviewed every changed line. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 14, 2026
dstrodtman
added a commit
that referenced
this pull request
Nov 3, 2026
#67012) ## Why are these changes needed? Ray's docs are retiring notebooks and the `doc_code` scripts that no page shows. This PR adds a guard so that debt can't grow back while it's being burned down. It follows the shape of `doc/test_no_new_rst.py`. `doc/test_doc_assets.py` checks the tracked tree, not the diff, and fails in three cases: 1. **A new notebook.** Any `.ipynb` under `doc/source/` that isn't on `doc/asset_allowlists/notebooks.txt`. 2. **A `doc_code` script that no page shows.** A `.py` under `doc/source/**/doc_code/` counts as shown if any of these holds: - A page pulls it in with `literalinclude` or `include`. RST and MyST forms both count, as do relative and `/`-rooted paths. - A shown script imports it, transitively. - It's a test wrapper. That means it imports an included script, or it names an included file in a string literal. The second form covers the `llm/doc_code/serve/**/*_yaml_config_example.py` scripts that load and deploy an included YAML config, so they need no permanent exemption. Anything else has to be on `doc/asset_allowlists/doc_code.txt`. 3. **A stale allowlist entry.** A listed file that's gone, or that a page now shows, also fails, so both lists only shrink. Each conversion or cleanup PR deletes its own lines. `python doc/test_doc_assets.py --update` rewrites both lists from the tree. It's there for re-seeding after a rebase. The contributor docs say not to use it to get a new file through. ### Seeded debt at this commit - 52 notebooks. - 10 unshown `doc_code` scripts. Two open PRs clear 7 of them: #66964 handles 5 Serve and LLM scripts, and #66965 handles the 2 RLlib scripts. If either merges first, this PR re-seeds with `--update`. If either merges after this one, it deletes its own allowlist lines. The scripts with no open PR are `cluster/doc_code/simple-trainer.py` (run by the included `slurm-basic.sh`, never shown), `cluster/doc_code/yarn/dashboard.py`, and `llm/doc_code/serve/custom_vllm/qwen3_reward_plugin/qwen3_rm.py` (linked on GitHub, not included). ### Where it runs: a lint matrix entry, not a `py_test` The check runs as `lint: doc_assets` in the `lint-small-prose` matrix next to `doc_no_new_rst`. It doesn't run as a Bazel `py_test`, for two reasons: - A prose-only change can fail it. Deleting a page's last `literalinclude` of a script orphans that script. That step keeps the `always` tag, so it runs on every PR, including prose-only ones. A `doc`-tagged test would miss them. - It reads the whole `doc/source/` tree. As a `py_test`, it would need all of `doc/source/` as `data` to get into the Bazel sandbox. It runs postmerge as well, because non-PR builds run everything. **REEf: please confirm this placement, the premerge gating, and the rule changes below.** ### Routing - `doc/test_doc_assets.py` joins `doc/test_no_new_rst.py` in the `doc` build-infra rule in `test.rules.txt`. Without that, it falls to the `doc/*.py` catch-all and emits `doc_example`. - The allowlists route to nothing in `test.rules.txt`. Only the lint step reads them, and that step runs on every PR. They get `always lint` from the `always.rules.txt` catch-all. - Expectations for both paths are added to `test.rules.test.txt` and `always.rules.test.txt`. ### Limits - The check doesn't apply Sphinx `exclude_patterns`, so a page excluded from the build still counts as showing what it includes. At this commit, honoring the excludes changes nothing. - `doc/source/ray-contribute/docs.md` still describes authoring notebooks. Rewriting it is separate work, which removes the notebook template and replaces that guidance. Until then, the check's failure message points to the new section in `ci.md`. ## Related issue number None. Before opening this PR, I searched open PRs for notebook, allowlist, `doc_code`, and orphan keywords and found no other ratchet. #66964, #66965, #67008, and #66884 shrink or move the seeded debt, and none of them adds a check. #64053 adds a new Serve example plus a test that names the example script by filename. The test-wrapper rule passes it, provided its page includes the example script. ## Checks - [x] I've signed off every commit (DCO). - [x] `./ci/lint/lint.sh doc_assets`: passes on this branch with the seeded lists. - [x] Each failure mode, exercised locally and then reverted: a new `.ipynb` fails, a new unshown `doc_code` script fails, removing a page's `literalinclude` fails along with the scripts that only it imported, a stale allowlist line fails, and a test script that imports an included script passes. - [x] `--update` is idempotent on this tree. - [x] `rayci test-rules`, built from `ray-project/rayci` master: all rule tests pass, including the new expectations. - [x] `pre-commit run` on the changed files: passed, including black and ruff. - [x] Cross-checked the seed against an independent scan of the same tree. It lists the same 9 scripts, and also flags `test_service_pb2.py`, which only an unshown script imports. #66964 deletes both of those `pb2` scripts. AI assistance (Claude Code) was used to prepare this PR. I reviewed every changed line. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Some scripts under
doc/source/serve/doc_code/aren't shown on any docs page, and some are tested but read by no reader. Docs example code should either appear on a page, be a test wrapper for content that does, or be deleted. This PR applies that rule to the Serve and Serve LLMdoc_codetrees:test_service_pb2.py,test_service_pb2_grpc.pygrpc_proxy/user_defined_protos_pb2*.pyinstead.vllm_example.pycustom-vllm.mdusescustom_vllm_example.py.excludelist indoc/BUILD.bazelllm/doc_code/serve/sglang/sglang_batch_example.pysglang/**glob. No page includes it. The SGLang guide shows the serving, query, and multinode scripts.doc/BUILD.bazeldoesn't change for this one.whisper_example.py,resnet50_example.pymulti-app-container.mddownloads both in its Dockerfiles withcurlfromraw.githubusercontent.com/ray-project/ray/master/.... Whisper wasn't shown on any page.literalinclude. Each script now has a comment naming the page that depends on its path, so a rename or a move ofserve/doc_code/doesn't break the Dockerfiles silently.The Dockerfiles keep the raw URL, so the guide's procedure doesn't change.
resnet50_example.pyalready uses__serve_example_begin__and__serve_example_end__markers for the autoscaling guide, andwhisper_example.pygains the same markers.#66884 moves
llm/doc_code/serve/sglang/toserve/llm/doc_code/sglang/. If this PR merges first, #66884 needs a rebase that drops its rename ofsglang_batch_example.py.Related issue number
None. No open issue or PR covers these files. I searched open PRs for each filename and checked my own open PRs. #66884 is the only overlap. It renames
sglang_batch_example.py, which this PR deletes.Checks
pre-commit run --files <changed files>: passed, including buildifier and the master-link check.python -m py_compileon the two edited scripts: passed.git grepfortest_service_pb2,serve/doc_code/vllm_example, andsglang_batch_example: no remaining references.literalincludeblocks.AI assistance (Claude Code) was used to prepare this PR. I reviewed every changed line.
🤖 Generated with Claude Code