Repository navigation
[doc][serve] Style pass on the Ray Serve advanced guides - #67069
Draft
dstrodtman wants to merge 4 commits into
Draft
dstrodtman wants to merge 4 commits into
dstrodtman wants to merge 4 commits into
Conversation
dstrodtman
force-pushed
the
doc-1547-serve-vale-terms
branch
from
October 29, 2026 20:42
368bd4b to
5f9d68b
Compare
Edit 16 pages under doc/source/serve/advanced-guides/ against the Ray writing-style guide and the Serve terms section. Prose only: no code block, literalinclude, role target, or URL changes. Reworded headings keep their old slug anchors through MyST labels. Two factual fixes are verified against source: the RAY_SERVE_RUN_SYNC_IN_THREADPOOL default and the max_ongoing_requests parameter name. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
…s pass A meaning-diff review of the style pass found three edits that changed what a sentence claims, plus two counts that made incomplete lists read as complete. Restore the original meaning for each. Also correct four pre-existing claims that the Serve source settles, and rename four slug-preserving labels to the section ids that docs.ray.io renders. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
A fresh-context review of the advanced-guides pass flagged list lead-ins, clause-joining colons, bold on inline code, undefined acronyms, missing image alt text, a hardcoded docs.ray.io link, and repeated links. Fix the ones that are guide violations and leave the structural changes for later. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
dstrodtman
force-pushed
the
doc-1547-serve-vale-terms
branch
from
October 30, 2026 16:56
5f9d68b to
d5cc5d1
Compare
dstrodtman
force-pushed
the
doc-1547-serve-prose-advanced-guides
branch
from
October 30, 2026 16:56
fe41edd to
1b80286
Compare
## Description **Stacked on #67069** (Serve advanced guides style pass), because both edit `dev-workflow.md`. Merge #67069 first, then retarget this PR to `master`. Adds a "Write unit and integration tests" section to the Ray Serve development workflow page. It follows the testing approach that Ray Serve maintainers lay out in #44464 and its duplicate #34477: - Keep business logic in a plain base class so you can unit test it without Ray, and reach a deployment's underlying class through `func_or_class`. - Integration test by deploying with `serve.run`, then calling the app through the returned `DeploymentHandle` (`handle.method.remote(...).result()`) and over HTTP with `requests`. The examples live in a new tested file, `doc/source/serve/doc_code/testing_patterns.py`, which the existing `source/serve/doc_code/**/*.py` glob in `doc/BUILD.bazel` already picks up. FastAPI's `TestClient` is left out, because the issue says it's untested with Serve. The `serve.status()` polling pattern is covered separately by #65868 in the contributor guide. Sources: #44464 and #34477, `python/ray/serve/deployment.py` (`func_or_class`), `python/ray/serve/api.py` (`serve.run` returns a `DeploymentHandle`), `python/ray/serve/handle.py` (`DeploymentResponse.result()`). ## Related issues Closes #44464 ## Review notes - The snippets show `from summarizer import ...`. The test file makes that import work by registering `sys.modules["summarizer"]` outside the include markers. Is that acceptable, or should the snippets drop the import lines? - The test target binds port 8000, and the serve `doc_code` targets are tagged `exclusive`. ## Not a duplicate `gh pr list --state open --search "44464 in:body"` returns nothing. #65868 is related but documents a different pattern. ## Testing - `python doc/source/serve/doc_code/testing_patterns.py` with `ray[serve]==2.59.0`: 4 passed (`test_doubler_class`, `test_summarize_truncates_text`, `test_summarize_with_handle`, `test_summarize_with_http`). - `make -C doc rtd-build`: `build succeeded.` with exit code 0 and no Sphinx warnings. - Vale on `dev-workflow.md`: no errors. `ruff check` on the new file: clean. ## AI assistance Drafted with AI assistance (Claude Code). The API usage was checked against the Serve source and the example was run locally. 🤖 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 pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
This branch has not been deployed
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?
This PR is a style and grammar pass over the Ray Serve advanced guides against Ray's writing-style guide. It applies the Serve terminology from #67018, which seeds the Serve Vale rules and adds the "Writing Ray Serve docs" section to the guide.
Stacked on #67018. This PR targets that branch, so its diff shows only the prose changes. Retarget it to
masteronce #67018 merges.The PR covers 16 of the 18 pages under
doc/source/serve/advanced-guides/. Two pages are left out because engineering PRs were rewriting them when this pass started, and a style pass would only have created conflicts:replica-scheduling.md, which the [serve][1/7] Compose replica scheduling from rules and add a node floor #66548 to [serve][7/7] Prefer used slices and zones when packing #66554 stack edited. That stack has since closed without merging.replica-ranks.md, which [serve][in-place-updates][4/n] Addmax_surge_percentfor start-before-stop rolling updates #66267 edited. That PR has since merged.Neither page has an open PR now, so a follow-up can cover both.
What changed
Most changes are prose: voice, tense, word choice, concision, and list and heading structure. No code and no
literalincludeoption changed. The only edits inside code fences are "threadpool" to "thread pool" in the text diagram inasyncio-best-practices.md, and the indentation of twobashblocks inadvanced-autoscaling.mdthat now sit under list items..bind()returns anApplication.asynciois lowercase, and brand casing is fixed for TensorFlow, GitHub, Podman, and ResNet.index.mdnow matches each page's current title.docs.ray.io/en/masterrenders, placed directly above the new heading, sopage.html#old-idlinks keep resolving. I checked every section id on the live pages against the new pages. Eight ids are intentionally not preserved, because the names are too generic to claim as site-wide labels:getting-started,usage,scaling-out,future-roadmap, and four*-a-deploymentids on the experimental Java page. Nothing indoc/sourcelinks to any of them.::{note} ... ::inadvanced-autoscaling.mdrendered as literal text and split the parameter list. It's now a real note, indented under its list item.1.throughout.advanced-autoscaling.mdandcustom-request-router.mdhave descriptive alt text.{doc}path link to the KubeRay GPU guide inmulti-node-gpu-troubleshooting.mdis now a{ref}to its label.asyncio-best-practices.md:defmethods in pure Serve run in a thread pool by default.RAY_SERVE_RUN_SYNC_IN_THREADPOOLdefaults to"1"inpython/ray/serve/_private/constants.py, since [Serve] Run sync deployment methods in a thread pool #66436. The page said they ran on the event loop unless you opted in, and its summary bullet said to "consider enabling" the flag.app-builder-guide.md: Serve builds a typed builder's argument withmodel_validate, the Pydantic v2 API. That'spython/ray/serve/_private/api.py. The page saidparse_obj.managing-java-deployments.md: the example passes the class name tosetDeploymentDef(), not as an argument toServe.deployment().advanced-autoscaling.md: "up to sixDriverdeployments" now says replicas.Driveris one deployment, and the table above the sentence plots its replica count.custom-request-router.md:max_ongoing_requestwas misspelled three times.performance.md: two curly quotes inside inline code made the Python invalid.Questions for Serve maintainers
These claims are pre-existing, and this PR doesn't change them. I'd rather ask than guess.
performance.md, "Enable throughput-optimized serving" note: it says that in Ray v2.54.0 the defaults forRAY_SERVE_RUN_USER_CODE_IN_SEPARATE_THREADandRAY_SERVE_RUN_ROUTER_IN_SEPARATE_LOOP"will change to0." Both still default to"1"inconstants.pyon master, unlessRAY_SERVE_THROUGHPUT_OPTIMIZEDis set, and 2.59.0 has shipped. Did the flip slip, or should the note go?advanced-autoscaling.md, "How do autoscaling metrics work?": the page says replicas record metrics every 10s and push them on theRAY_SERVE_*_AUTOSCALING_METRIC_PUSH_INTERVAL_Sinterval. Inreplica.pyandrouter.py, recording runs atmin(look_back_period_s * RAY_SERVE_AUTOSCALING_METRIC_RECORD_INTERVAL_FACTOR, metrics_interval_s), which is 6s at the defaults, and pushes happen atmetrics_interval_s. The same section saysdownscale_delay_scovers all downscaling "except" the one-to-zero transition, but the source falls back to it whendownscale_to_zero_delay_sis unset.performance.mdvsproduction-guide/config.md: this page says clients retry a request thatrequest_timeout_stimes out.config.mdsays Serve retries it at another replica. Which is right?inplace-updates.md: the lightweight-update and code-update field lists look incomplete.python/ray/serve/_private/config.pyalso marks options such asmax_queued_requests,logging_config, andrequest_router_configas lightweight, andgang_scheduling_configas heavyweight. Should the lists be complete?grpc-guide.md: the error-code list says only the health check methods returnUNAVAILABLE.grpc_util.pyalso mapsDeploymentUnavailableErrortoUNAVAILABLEon regular requests. Theroute_prefixnote also pins "As of Ray 2.7.0 ... Future releases will make it optional for gRPC." Is that still the plan? Separately, the message-size note says 100 MB for104857600bytes, which is 100 MiB.custom-request-router.md: the fault benchmark says it kills "theCapacityQueuerouter", but elsewhereCapacityQueueis the actor andCapacityQueueRouteris the router. "Higher throughput ... lower latency" also has no stated baseline in the prose, though the chart compares against the power-of-two-choices router.dyn-req-batch.md: the page refers to batching "decorators", plural, but names only@serve.batch.deployment-scoped-actors.md: themax_concurrencynote says "If the actor uses threaded execution, Ray defaultsmax_concurrencyto1." Does "threaded" mean sync here?multi-node-gpu-troubleshooting.md: the page namesaws-ofi-plugin, but the linked repository isaws-ofi-nccl.deploy-vm.md: the opening says the page shows how to update an application with the CLI, but no section covers it.advanced-autoscaling.md: the external-scalingcurlexample ends in a stray\and uses/api/serve/applications/, while the scale endpoint uses/api/v1/....Duplicate check
No open PR makes a style pass over these pages. Seven open PRs touch some of these files with feature or doc changes, mostly small edits. I included those files because the rebase is small either way: #64040, #66590, #66512, #61071, #67400, #67507, and #67724.
How this was reviewed
The pass ran in three stages, then two independent reviews:
{ref}/{py:*}targets, labels, and URLs against the page before editing.dyn-req-batch.md, "Prefer" firmed to "Write" inasyncio-best-practices.md, and an ambiguous "override it" inperformance.md. It also showed that two counts the pass had added toinplace-updates.mdmade incomplete lists read as complete. All four are fixed in the second commit.advanced-autoscaling.md.custom-request-router.md.gang-scheduling.md..rststub links to{py:class}roles.Testing
grpcurl./en/masterversion of each page either still exists or is covered by a label, apart from the eight generic ids listed above. No label name is duplicated indoc/source.advanced-autoscaling.mdandcustom-request-router.md.Prepared with AI assistance (Claude Code). Draft until the submitter has reviewed every changed line.
🤖 Generated with Claude Code