Repository navigation
[doc][core] Move four API reference pages into the Ray Core API section - #66751
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request reorganizes the documentation structure by moving several API reference pages (including state, job-submission, compiled-graph, and autoscaler) under the centralized doc/source/core/api/ directory. It updates the corresponding build rules, toctrees, makefiles, and adds redirects to ensure backward compatibility. Feedback on this PR suggests adding the newly moved API reference hub pages (core/api/state, core/api/job-submission, and core/api/autoscaler) to the llms_txt_exclude list in doc/source/conf.py to keep them out of the LLM agent corpus, ensuring consistency with other Core API reference pages.
dstrodtman
force-pushed
the
doc-1747-api-ref-page-moves
branch
from
October 5, 2026 20:22
fc4ec46 to
7a40195
Compare
This was referenced Oct 5, 2026
dstrodtman
force-pushed
the
doc-1710-ray-core-dir-move
branch
from
October 6, 2026 16:28
879e1dc to
f561614
Compare
dstrodtman
force-pushed
the
doc-1747-api-ref-page-moves
branch
from
October 6, 2026 18:34
7a40195 to
a6bbb8c
Compare
Move the reference pages that sit outside the APIs tab into core/api/, so every page the API-consistency check walks lives under an API_PATH_PREFIXES directory: - ray-observability/reference/api.rst -> core/api/state.rst - cluster/running-applications/job-submission/jobs-package-ref.md -> core/api/job-submission.md - core/compiled-graph/compiled-graph-api.rst -> core/api/compiled-graph.rst - cluster/running-applications/autoscaling/reference.md -> core/api/autoscaler.md Pure path change: toctree references follow the files, redirects cover the old page and generated-stub URLs, and the build, llms.txt, and gitignore patterns for the old stub directories are removed. With the observability API page inside core/api/, the doc_api rule no longer needs its ray-observability/reference/ exception. Signed-off-by: Douglas Strodtman <[email protected]>
dstrodtman
force-pushed
the
doc-1747-api-ref-page-moves
branch
from
October 6, 2026 18:36
a6bbb8c to
423257c
Compare
MengjinYan
approved these changes
Oct 6, 2026
dstrodtman
enabled auto-merge (squash)
October 6, 2026 19:03
dstrodtman
added a commit
that referenced
this pull request
Oct 7, 2026
) ## Why are these changes needed? Stacked on #66744. A Sphinx build of master logs 265 `document is referenced in multiple toctrees` messages. They're info-level, so they don't fail the build, but every one marks a page whose sidebar parent and breadcrumb Sphinx has to choose arbitrarily. This PR removes 245 of them. The other 20 are on Ray Core API pages and are left for separate follow-ups. ### Autosummary entries listed twice (240) Most duplicates come from a hand-written API page that lists a class with `:toctree: doc/` and then lists that class's methods in further `:toctree:` blocks. The class stub, rendered from `_templates/autosummary/class.rst`, already lists every documented method in its own `:toctree:` autosummary, so each method stub ends up with two parents. Similarly, `train/api/deprecated.rst` re-lists APIs that the Train API pages also list, and `data/api/saving_data.rst` re-lists `Dataset` methods that the Dataset page owns. The fix drops `:toctree:` from the duplicated entries only. The tables still render and link to the same stub pages, since autosummary links entries by object reference. The stubs are still generated, because autosummary recurses into generated stubs and the class stub's own `:toctree:` block covers them. Where a block mixed duplicated and unique entries, it's split into consecutive blocks in the original order, so only the duplicated runs lose `:toctree:`. That split adds a small gap between table rows on a few pages, for example `Learner` / `Learner.build` / `Learner._make_module` in the RLlib Learner reference. Files: RLlib `package_ref` (12 pages), Tune `api` (9 pages), Data `saving_data` and `preprocessor`, Train `deprecated`. ### Hand-written navigation duplicates (3 pages) - `cluster/vms/user-guides/community/index.md` had a hidden toctree repeating `yarn`, `slurm`, and `lsf` from the visible toctree below it. Removed the hidden one. - `ray-references/faq.md`, an orphan page, listed `tune/faq` in a toctree that competed with `tune/index`. It's now a plain `{doc}` link. - `ray-observability/ray-distributed-debugger.md` sat in both `ray-observability/index.md` and `user-guides/debug-apps/index.md`. Kept it in the top-level observability toctree, which matches the file's location, and removed it from the debug-apps toctree. The debug-apps page still links it from its bullet list. **Reviewer call:** if the debugger should live under Debugging Applications in the sidebar instead, flip which toctree keeps it. ### Left for follow-ups (20) These were deferred while #66605 (Ray Core directory move) and #66751 (API reference page moves) were in flight. Both have merged, and the duplicates remain on the moved pages: - 13 come from #66751 keeping each moved page in its original section's toctree as well as in `core/api/index.md`: `core/api/job-submission.md` and its eight `JobSubmissionClient` method stubs, `job-submission/cli.md`, `core/api/autoscaler.md`, `core/api/compiled-graph.rst`, and the `ActorMethod.bind` stub. Whether those pages keep a second home in their original sections is a navigation decision for that change, not a mechanical fix. - 2 are `core/api/state.rst` and `ray-observability/reference/cli.rst`, listed from both the observability reference index and the Core API index. - 5 are Core API stubs listed twice within `core/api/`: `ray.get`, `ray.put`, and `ray.method` (`core` and `direct-transport`), `ActorClass.options` (the `ActorClass` stub and `core`), and `ray.remote` (twice in `core`). ## Related issue number None. ## Checks - Duplicate-work check: `gh pr list --repo ray-project/ray --state open --search "toctree"` and a review of my open docs PRs found no other PR addressing these messages. None of my other open PRs touch the files changed here. - `pre-commit run --files <changed files>` passed. - The duplicate list comes from the RtD build log for #66744 (build 4527202). Each removed `:toctree:` entry was matched by fully qualified name against a document that log reports as having a second parent, and only entries on that list were changed. - RtD preview build 4532297 succeeded and logged 18 `multiple toctrees` messages, against 263 for #66744 before this change. It reported no Sphinx warnings and no missing autosummary stubs. That build predates the base branch's merge of #66605 and #66751, which brought the leftover count to 20. - After merging the current base, this branch's tree is identical to the base plus the original dedupe commit, checked by applying that commit's patch to the base tree and comparing tree hashes. This PR was prepared with AI assistance (Claude Code). 🤖 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]>
dstrodtman
added a commit
that referenced
this pull request
Oct 7, 2026
## Why are these changes needed? Fourteen guide pages and notebooks run Sphinx autodoc directly. Some of them repeat an API reference entry, and others are the only place an API is documented at all. This PR moves every one of those APIs into an API reference page under `API_PATH_PREFIXES` and replaces the guide-page directives with cross-references. After it merges, autodoc runs only on API reference pages, which is what a future move of the API reference off Sphinx autodoc needs. **New API reference entries** - **Ray integrations API** (`ray-more-libs/api/`, new): Ray on Spark (`setup_ray_cluster`, `shutdown_ray_cluster`, `setup_global_ray_cluster`), Ray Collective, and Dask on Ray (`RayDaskCallback` and its `_ray_*` hook methods). The section is registered in `API_PATH_PREFIXES`, the `doc_api` rule, the APIs landing toctree, and the `llms_txt_exclude` and `remove_from_toctrees` stub patterns. - Ray Collective lists everything the old `automodule ... :members:` rendered (26 documented functions in `ray.util.collective.collective`, plus `register_collective_backend`), grouped by purpose. Only `register_collective_backend` carries an annotation (`PublicAPI(stability="alpha")`), so Ray Core reviewers might want to trim internals such as `GroupManager` and `get_group_handle`. - **RLlib:** the nine algorithm-specific config classes (`PPOConfig` through `MARWILConfig`) go into `algorithm-config.rst`. They use the existing `class_without_autosummary.rst` template, so each class gets one page and no per-member stubs. `MemoryTrackingCallbacks` goes into `callback.rst`, also with the one-page template, and `OldAPIStack` into `utils.rst`. - **Ray Core:** `PublicAPI`, `DeveloperAPI`, and `Deprecated` go into a new "API stability annotations" section, and `AutoscalingCluster` into a new "Testing utilities" section, both in `core/api/utility.rst`. `ray.autoscaler.sdk.request_resources` loses its `:noindex:`, because it had no indexed entry anywhere. **Guide pages now cross-reference instead of rendering** `rllib/algorithms.md`, `rllib/callback.md`, `rllib/dev.md`, `ray-contribute/stability.md` (its `public-api-def` labels are kept), `ray-contribute/fake-autoscaler.md`, `core/miscellaneous.md`, `serve/advanced-guides/gang-scheduling.md`, `cluster/vms/user-guides/community/spark.md`, `ray-more-libs/ray-collective.md`, `ray-more-libs/dask-on-ray.md`, and the Aim, Comet, MLflow, and Wandb Tune notebooks. `DockerCluster` lives in `ray.autoscaler._private`, so instead of an API entry, `fake-autoscaler.md` now links to its source. **Redirects:** `/ray-more-libs/doc/*` → `/ray-more-libs/api/doc/:splat` covers the Dask stubs that moved. The other APIs were rendered inline on guide pages, so they had no standalone URL to redirect. **Base:** #66605 and #66751 have merged, so this PR is rebased onto master as a single commit. The content is unchanged from the version reviewed against #66751. ## Related issue number None. This follows up #66751. ## Checks - [x] I've signed off every commit (DCO). - [x] Duplicate-work check: `gh pr list --repo ray-project/ray --state open --search "<area keywords>"` found no open PR covering these moves. - [x] Autodoc census of `doc/source/` on this branch: no autodoc directive outside `API_PATH_PREFIXES` except a syntax example inside a code fence in `ray-contribute/docs.md`, which Sphinx never runs. - [x] I ran `ci/ray_ci/doc/autodoc.py`, the API consistency check's own doc parser, over the Core and RLlib walks. Every new entry parses to a resolvable dotted name. An early draft listed fully qualified names under an unrelated `currentmodule`, which the parser reads as unresolvable; each new block now sets its own `currentmodule`. The only duplicate names are ones already documented twice on master. I couldn't run the code-side half of the check locally, so premerge is the gate for that half. - [x] `bazel test //ci/pipeline:test_doc_api_rules_sync`: PASSED with the new `ray-more-libs/api/` prefix. - [x] Tag dry run: `ray-more-libs/api/*` emits `doc_api`, and the edited guide pages hit the prose skip rule. - [x] `rtd-redirects validate`: 0 errors. - [x] `make -C doc rtd-build` (RtD-faithful, `-W`), with the base branch's orphaned `_includes/_help.rst` set aside (#66750 already deleted it on master). The full build flagged one warning: `BCConfig` inherits `training()` from `MARWILConfig` rather than overriding it, so the BC line now links to the class and to `MARWILConfig.training()`. After that fix, an incremental `-W` rebuild reports `build succeeded.` I confirmed in the HTML that every new cross-reference resolves to its API page or stub. - [x] `MemoryTrackingCallbacks` uses the one-page template. The default template generated 20 stubs, almost all for members inherited from `RLlibCallback`, which would have shadowed the `RLlibCallback` entries. - [x] `rtd-redirects simulate` for the Dask stub rule on master, latest, and `releases-2.40.0`: no regressions, wrong landings, or new loops. Old stub URLs reach the new stubs in one hop. AI assistance (Claude Code) was used to prepare this change. I reviewed every changed line. Signed-off-by: Douglas Strodtman <[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?
Four API reference pages live outside the APIs tab, so the shared API sidebar and the
API_PATH_PREFIXESpage set don't include them. This PR moves them intocore/api/:ray-observability/reference/api.rstcore/api/state.rstcluster/running-applications/job-submission/jobs-package-ref.mdcore/api/job-submission.mdcore/compiled-graph/compiled-graph-api.rstcore/api/compiled-graph.rstcluster/running-applications/autoscaling/reference.mdcore/api/autoscaler.mdThis is a pure path change: all four files are 100% renames with no content edits. Everything else in the diff follows from the move:
core/api/index.md) now lists all four pages. The old parent toctrees point at the new paths, so the pages stay reachable from their original sections.doc/redirects/current.yamlgains onepagerule per moved page, plus wildcard rules for the generated per-symbol stubs, which move from each page's olddoc/directory tocore/api/doc/. All rules use the defaultforce: false. Existing rules that point at the old paths are left alone, so older doc versions keep resolving them.ray-observability/reference/doc/,cluster/running-applications/job-submission/doc/, andcore/compiled-graph/doc/. Their entries inconf.py(llms_txt_exclude,remove_from_toctrees), thedoc/Makefilecleantarget, anddoc/.gitignoreare removed. Existingcore/api/doc/*patterns cover the new location. One side effect: the compiled graph stubs were missing fromremove_from_toctrees, so they're now pruned like every other API stub.doc_apirouting. Theray-observability/reference/directory was in thedoc_apirule only because the Core API toctree pulled in itsapi.rst. Now that the page lives incore/api/, the exception goes away in both.buildkite/test.rules.txtand_ALLOWED_ONLY_IN_RULEinci/pipeline/test_doc_api_rules_sync.py. The remaining pages in that directory,cli.rst(clickdirectives only),index.md, andsystem-metrics.rst, carry noautosummaryorautoclassblocks, which are the only blocks the API consistency check parses. Thetest.rules.test.txtexpectation moves tocore/api/state.rst.Effect on the Core API consistency check. The check walks the toctree from
core/api/index.md, so it now also reads the job submission and compiled graph pages. The autoscaler page usesautofunction, which the check doesn't parse. I ran the check's Sphinx-free doc parser (ci/ray_ci/doc/autodoc.py) over the new walk. It finds 188 documented APIs, and the only names documented twice areray.get,ray.put,ray.method, andray.remote, all already in Core'sintentional_duplicate_apis.ActorMethod.bind, documented in bothcore.rstand the compiled graph page, is also already exempt. None of the newly walked classes resolves to a private module path. I couldn't run the code-side half of the check locally because it needs a compiled Ray, so premerge'sdoc: check API doc consistencystep is the gate for that half.Stacking. This branch is stacked on #66605 (move Ray Core docs to
doc/source/core), which touches the same surfaces:api_sidebar.py,apis/index.md, the redirects file, and thedoc_apirules. Merge #66605 first. #66744 also editsdoc/redirects/current.yaml, so expect a small rebase there.Related issue number
None. This is groundwork for moving the API reference off Sphinx autodoc: every page the API reference generator needs to reproduce should live under an
API_PATH_PREFIXESdirectory.Checks
gh pr list --repo ray-project/ray --state open --search "<area keywords>"found no open PR moving these pages. The overlapping PRs are [doc][core] Move Ray Core docs to doc/source/core and adopt index.md landings #66605, which this stacks on, and [docs] Group the Serve and Train API references and align API landing pages #66744, which only shares the redirects file.bazel test //ci/pipeline:test_doc_api_rules_sync: PASSED.rtd-redirects validate doc/redirects/current.yaml: 0 errors, 0 warnings. Chain notes went from 171 to 181, from the two-hop paths described above.determine_tests_to_run.pyreference parser):core/api/state.rstandcore/api/job-submission.mdemitdoc_api, andray-observability/reference/{cli.rst,index.md}hit the prose skip rule.make -C doc rtd-build(RtD-faithful,-W --keep-going, Python 3.11 and the docs lock): exactly one warning,_includes/_help.rst: document isn't included in any toctree. That orphan is in this branch's base ([doc][core] Move Ray Core docs to doc/source/core and adopt index.md landings #66605) and was already deleted on master by [doc] Delete the orphaned _includes/_help.rst #66750. With it removed locally, an incremental-Wrebuild reportsbuild succeeded.with zero warnings. The four pages render atcore/api/{state,job-submission,compiled-graph,autoscaler}.html, and their 116 generated stubs render undercore/api/doc/.rtd-redirects simulateagainst [doc][core] Move Ray Core docs to doc/source/core and adopt index.md landings #66605 as the base, covering master (built HTML), latest,releases-2.55.0, andreleases-2.40.0, with--prefixon all three old directories, sample stub URLs, and a stub rename map: 0 regressions and 0 new loops on every version. It still exits nonzero, for two reasons I checked by hand:core/api/doc/in one hop.__simulate-sample__, a name that never existed) now lands on the Core API index instead of the observability landing page. Real stubs on older releases are still served directly, because the rules don't force.AI assistance (Claude Code) was used to prepare this change. I reviewed every changed line.