Skip to content

Move /rllib/ into /python/ray/ - #66096

Merged
elliot-barn merged 7 commits into
ray-project:masterfrom
pseudo-rnd-thoughts:rllib-move-into-python-ray
Oct 2, 2026
Merged

elliot-barn merged 7 commits into
ray-project:masterfrom
pseudo-rnd-thoughts:rllib-move-into-python-ray

Conversation

@pseudo-rnd-thoughts

Copy link
Copy Markdown
Member

Description

Over 7 years ago rllib was moved from python/ray/rllib to the root folder where its lived ever since (#5324).
However, as Ray has grown and rllib positions in the root folder makes less sense and causes more issues for CI and docs to maintain due to its "weird" position relative to the other Ray projects.

This PR moves rllib back to python/ray/rllib updating all the relevant documentation and CI
For users, this should be a primarily internal change and no external users being aware of the changes (other than PRs)

Signed-off-by: Mark Towers <[email protected]>
@pseudo-rnd-thoughts pseudo-rnd-thoughts added rllib RLlib related issues go add ONLY when ready to merge, run all tests labels Sep 11, 2026
@pseudo-rnd-thoughts
pseudo-rnd-thoughts marked this pull request as ready for review September 11, 2026 15:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request relocates the rllib directory from the repository root to python/ray/rllib/ and updates all corresponding references across build configurations, CI scripts, and documentation. The review comments correctly identify a few minor issues in the updated files, including an incorrect implementation path for the APPO algorithm and the use of /tree/master/ instead of /blob/master/ for file links in the RLlib examples documentation.

Comment thread doc/source/rllib/rllib-examples.rst Resolved
Comment thread doc/source/rllib/rllib-examples.rst Resolved
@ArturNiederfahrenhorst

Copy link
Copy Markdown
Contributor

Thanks for doing this!
-> Happy to approve quickly once tests are green and code has settled

@dstrodtman

Copy link
Copy Markdown
Contributor

@pseudo-rnd-thoughts — I went through this from the docs side and it looks good. The doc changes are mechanical path plumbing and I couldn't find anything that breaks:

  • The literalinclude and GitHub-link path updates are a clean line-for-line swap from rllib/… to python/ray/rllib/… (225 insertions, 225 deletions), and all 98 include, figure, and image targets in the changed pages resolve at your current head.
  • No stale references to the old root rllib/ path remain anywhere under doc/.
  • The API reference is unaffected. automodule imports ray.rllib, and the import path is unchanged by the move.
  • doc/BUILD.bazel's doctest[rllib] data dep is correctly updated to //python/ray/rllib:cartpole-v1_large, and that target exists at the new location.

This is static verification rather than a full docs build, but it covers the breakage a directory move introduces.

One heads-up: I have a stack of RLlib changes in flight. Once those merge down, these doc path references will likely need a refresh, since my work will almost certainly introduce merge conflicts with this PR.

How would you like to handle that? Two options:

  1. I run the refresh to resolve the paths and conflicts once my changes have merged down, or
  2. I open a branch stacked on this PR so you can review it directly. In that case my PR merging into yours would be what resolves the merge conflicts my work introduces.

Happy either way — let me know which you'd prefer.

Docs-side verification drafted with Claude Code assistance; I've reviewed it and stand behind it.

Signed-off-by: Mark Towers <[email protected]>
@pseudo-rnd-thoughts

Copy link
Copy Markdown
Member Author

@dstrodtman

One heads-up: I have a stack of RLlib changes in flight. Once those merge down, these doc path references will likely need a refresh, since my work will almost certainly introduce merge conflicts with this PR.

How would you like to handle that? Two options:

  1. I run the refresh to resolve the paths and conflicts once my changes have merged down, or
  2. I open a branch stacked on this PR so you can review it directly. In that case my PR merging into yours would be what resolves the merge conflicts my work introduces.

If you've got the PRs ready to go then lets do 1

@dstrodtman

Copy link
Copy Markdown
Contributor

Hi @pseudo-rnd-thoughts, heads-up: master converted doc pages this PR edits from reStructuredText to MyST Markdown, so those edits need to move to the .md files when you rebase:

If you'd like help translating your edits to Markdown, DM me (Douglas Strodtman) on the Ray Slack and I'll help. If you'd rather handle it yourself, the repo has a Claude Code skill for this conversion at doc/.claude/skills/rst-to-myst/. Most small edits don't need it, though: any coding agent can translate them without the skill loaded.

dstrodtman added a commit that referenced this pull request Sep 28, 2026
…ervability pages to MyST (#66461)

## Why are these changes needed?

Converts the last non-API-reference RST pages under `ray-core/`,
`data/`, and `rllib/` to MyST Markdown, plus the `train/` and
`ray-observability/` pages that `doc/BUILD.bazel` names by path. The API
reference trees (`*/api/`, `rllib/package_ref/`, and
`ray-core/compiled-graph/compiled-graph-api`) stay RST for now.

Each page gets its own commit, so you can review one file at a time.
Every commit renames the page's literal `.rst` paths in
`doc/BUILD.bazel` to `.md`. These paths are in `exclude` lists and in
the explicit `files` lists of `doctest[data-gpu]` and
`doctest[train-gpu]`, and they don't glob. Without the edit, an excluded
page would silently join its target once it's `.md`, and an included
page would silently drop out of it.

Conversions are format-only: labels, headings, and prose are unchanged.
A final whitespace-only commit soft-wraps the prose. `ray-soft-wrap`'s
`verify.py` confirms non-whitespace bytes, rendered HTML, and
idempotence for all 11 files.

### `rllib/getting-started`: doctest target removed

The first commit deletes `doctest[rllib2]`, the only target over
`rllib/getting-started.rst`, before the page converts. The target is
tagged `manual` with a hang TODO, so no premerge or postmerge step has
run it, and nothing else references it (`git grep rllib2` is empty). Its
15 `testcode` blocks had no `testoutput`, so they asserted nothing. The
12 visible blocks become display-only `python` code blocks. The three
`:hide:` blocks held `.stop()` cleanups that never rendered, so they're
deleted. `doctest[rllib]` still excludes the page. If these examples
should be validated later, a `doc_code/` script is the better route than
reviving the hanging target. cc @elliot-barn, who owns the TODO.

This commit isn't buildable on its own. It turns a `.. testcode::` that
had no blank line before its body into a `.. code-block:: python`, still
with no blank line, and docutils reads the body as extra arguments to
the directive. The later conversion commit fixes it in the `.md`, and a
squash merge never puts the intermediate commit on master.

### Doctest coverage

Docs-only PRs don't run doctests premerge. This PR edits
`doc/BUILD.bazel`, so every library's docs example step runs, but
premerge can't show the conversion kept the same blocks. For that, I
parsed each `.md` and the `.rst` it replaced with Ray's `pytest-sphinx`
fork, the same parser the doctest macro runs, and asserted identical
sections (directive, body, `:options:`, `:skipif:`) and examples.

| Page | BUILD role | Examples before → after |
| --- | --- | --- |
| `ray-core/handling-dependencies` | `doctest[core]` exclude | 17 → 17 |
| `ray-core/tasks/nested-tasks` | `doctest[core]` exclude | 0 → 0
(`literalinclude` of a tested `doc_code/` file) |
| `data/batch-inference` | `doctest_each` exclude, `doctest[data-gpu]`
files | 7 → 7 |
| `data/transforming-data` | `doctest_each` exclude, `doctest[data-gpu]`
files | 24 → 24 |
| `data/contributing/contributing` | `doctest_each` glob | 0 → 0
(toctree only) |
| `rllib/getting-started` | `doctest[rllib]` exclude, `doctest[rllib2]`
removed | 15 → 0, by the removal commit |
| `ray-observability/user-guides/cli-sdk` | top-level exclude | 16 → 16
|
| `ray-observability/user-guides/ray-tracing` | top-level exclude | 3 →
3 |
| `train/horovod` | `doctest[train]` exclude | 2 → 2 |
| `train/user-guides/data-loading-preprocessing` | `doctest[train]`
exclude, `doctest[train-gpu]` files | 6 → 6 |
| `train/user-guides/using-accelerators` | `doctest[train]` exclude,
`doctest[train-gpu]` files | 10 → 10 |

To show the check would catch a broken conversion, I mutated each page
with examples three ways: dropping a `testcode` block, altering a line
in one, and turning one into a four-backtick fence. The last renders
fine but is never collected. The check failed on all 24 mutations.

### Rendering changes

I ran `render_diff.py` on all 11 pages against `/en/master`. Six render
identically: `nested-tasks`, `data/contributing/contributing`,
`cli-sdk`, `ray-tracing`, `horovod`, and `using-accelerators`. Every
difference on the other five is listed here.

- `rllib/getting-started`: on master, one `.. testcode::` line had no
blank line after it. docutils read the block's first six lines, the
`best_result = results.get_best_result(...)` call, as the directive's
argument and dropped them. So master shows code that uses `best_result`
without showing where it comes from. The converted page renders all six
lines. This is the one place the conversion deliberately doesn't
reproduce master.
- `rllib/getting-started`: the "Farama gymnasium" link now has
`https://`. On master it's a relative link to `gymnasium.farama.org`
that 404s.
- `ray-core/handling-dependencies`: MyST drops the apostrophe when it
slugifies the "can't import the packages" heading, so the section id
changes. That heading had no label, so the page adds a target carrying
the old docutils slug, and existing `#...-can-t-import-...` links still
resolve. An auto-numbered span id, which nothing links to, also changes
from `id4` to `id2`.
- `data/batch-inference` and
`train/user-guides/data-loading-preprocessing`: each renders an RST
comment as an HTML comment, which readers never see.
- `data/transforming-data`: the "When using" definition list's `<dl>`
gains the unstyled `myst` class.

The first preview diff also caught three regressions that the green
build didn't. MyST's `replacements` extension turned two `(c)` list
markers into `©` and an `etc..` into `etc…`. The anchor above had
changed too. A follow-up commit fixes all three. A sweep of the 11 pages
found no other text that extension rewrites.

### Dead `doc/BUILD.bazel` excludes

A final commit drops four `exclude` entries that name files that have
moved: two in `doctest[serve]` and two in the serve `doc_code` test. A
glob exclude naming a missing file excludes nothing, so these had
silently stopped applying. This doesn't change what any target runs.
#66462 carries the same commit, along with a lint check that fails on
this class of stale path, so the two PRs merge cleanly in either order.

### Open PRs that edit these files

Each of these open PRs edits one of the converted `.rst` files, so each
will need to move its change to the `.md`: #66279, #66191, #65956,
#65933, and #65830 (`handling-dependencies`), #65693 (`cli-sdk`), and
#66419, #66420, #66422, and #66423 (`data/batch-inference`,
`train/user-guides/data-loading-preprocessing`). #66096, #64053, and
#63881 also edit `doc/BUILD.bazel`, and only #66096 edits nearby lines.

## Related issue number

None. No open PR converts these pages. I checked `gh pr list` for open
PRs touching each file.

## Checks

- [x] I've signed off every commit (`git commit -s`).
- [x] Pre-commit hooks passed on every commit.
- Doctest parity: `python3 doctest_parity.py <the 11 .md files>` with
`pytest==7.4.4` and `pytest-sphinx @
git+https://github.com/ray-project/pytest-sphinx`. All OK, run again
after the soft-wrap commit.
- Static checks on every `.md`: fences balance, no leftover RST roles or
directives, every label from the `.rst` is present, and directive counts
match.
- Read the Docs preview builds green under `fail_on_warning`, and the
render diff against `/en/master` is in Rendering changes. The first
build hit the known autosummary-import segfault and passed on rebuild.
- Local doctest run: not done. The GPU targets need hardware, and the
CPU targets run in this PR's premerge because of the `BUILD.bazel`
change.

AI assistance (Claude Code) was used for the conversion and the
verification scripts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…ython-ray

Signed-off-by: Mark Towers <[email protected]>

# Conflicts:
#	.github/CODEOWNERS
#	doc/source/rllib/algorithm-config.rst
#	doc/source/rllib/checkpoints.rst
#	doc/source/rllib/env-to-module-connector.rst
#	doc/source/rllib/external-envs.rst
#	doc/source/rllib/hierarchical-envs.rst
#	doc/source/rllib/index.rst
#	doc/source/rllib/key-concepts.rst
#	doc/source/rllib/learner-connector.rst
#	doc/source/rllib/metrics-logger.rst
#	doc/source/rllib/multi-agent-envs.rst
#	doc/source/rllib/new-api-stack-migration-guide.rst
#	doc/source/rllib/rl-modules.rst
#	doc/source/rllib/rllib-advanced-api.rst
#	doc/source/rllib/rllib-algorithms.rst
#	doc/source/rllib/rllib-callback.rst
#	doc/source/rllib/rllib-dev.rst
#	doc/source/rllib/rllib-env.rst
#	doc/source/rllib/rllib-examples.rst
#	doc/source/rllib/rllib-fault-tolerance.rst
#	doc/source/rllib/rllib-offline.rst
#	doc/source/rllib/rllib-replay-buffers.rst
#	doc/source/rllib/scaling-guide.rst
#	pyproject.toml
#	python/ray/rllib/README.md
#	python/ray/rllib/README.rst

@dstrodtman dstrodtman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ArturNiederfahrenhorst ArturNiederfahrenhorst left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesomeeeee!

Signed-off-by: Mark Towers <[email protected]>
elliot-barn pushed a commit that referenced this pull request Oct 1, 2026
#66626)

## Description

Docs, READMEs and docstrings often link to a file in this repo by its
GitHub URL, such as
`https://github.com/ray-project/ray/blob/master/<path>`. GitHub doesn't
redirect those URLs when a file moves or is deleted. It doesn't resolve
them through symlinked directories either, so
`blob/master/python/ray/rllib/...` returns 404 today. Ten such links are
broken on master. Six are in RLlib READMEs and example docstrings that
the Sphinx linkcheck never sees.

A network check can't catch this on a pull request, because a PR's new
links point at paths that don't exist on master until the PR merges. But
a link like this is correct exactly when its path exists in the tree
being committed, so it can be checked offline and the check can block.

This PR makes three changes.

**1. `ci/lint/check_ray_repo_links.py`**
- Finds every `github.com/ray-project/ray/{blob,tree,raw}/master/<path>`
and
`raw.githubusercontent.com/ray-project/ray/[refs/heads/]master/<path>`
link in tracked text files.
- Checks each path against `git ls-files` and fails on any path that
doesn't exist.
- Ignores pinned SHAs, tags, other branches, and `#L42` line anchors.
- Runs in about 0.8s with no network.

It runs in the `lint-small-prose` matrix (`always`), not in
`pre_commit`. A prose-only change can fail it: renaming or deleting a
doc file breaks links to it elsewhere, and `pre_commit` is filtered out
of prose-only PRs. It also scans the whole tree rather than only changed
files, for the same reason. It's also registered as a local pre-commit
hook.

**2. Link fixes.** These cover everything the new check reports on
master, plus the Ray-owned links that the postmerge `doc: linkcheck`
step confirms broken, wherever a replacement checked out.
- RLlib READMEs, `rl-modules.md` and the `custom_experiment.py`
docstring now point at current paths. The DDPPO and APEX entries for
removed algorithms are dropped.
- `tune-distributed.rst` now points at
`python/ray/tune/examples/tune-default.yaml`.
- `src/ray/.cursor/BUGBOT.md` now points at `rpc-fault-tolerance.md`,
the MyST version of the page.
- Starlette and Uvicorn moved their docs to `starlette.dev` and
`uvicorn.dev`, which are the `homepage` values of their GitHub repos.
The old hosts no longer answer.
- The Arch Wiki, Vale, and Databricks statement execution API links
point at those sites' current URLs.

**3. `linkcheck_report.py` writes a `linkcheck-report.json` artifact
instead of posting to Slack.**
- The step's container already mounts the agent's artifact directory at
`/artifact-mount`.
- The `DOCS_LINKCHECK_SLACK_WEBHOOK` env var it read was never
provisioned, so today every run ends with "not set; skipping Slack
alert" and nobody sees the result.
- A scheduled job maintained by the docs team now reads the result
through the Buildkite API and posts the digest, so no Slack credential
has to enter this repo's CI secrets. That job also parses the printed
lines when the artifact is missing, so the printed format is unchanged.

## Related issues

Related to #66096, which moves `rllib/` under `python/ray/` and rewrites
the RLlib links for the new paths.
- This PR's RLlib edits make the same choices as that PR, but use the
current master paths. Whichever merges second has a small conflict on
those lines.
- Once this lands, the new check covers the move itself: any
`/master/rllib/...` link #66096 misses fails lint on that PR, not after
merge.

Not a duplicate: open PR searches for "link check", "broken links",
"linkcheck", and "dead links" turn up nothing in this area.

## Additional information

**Left out on purpose:**
- **The torch `Stream` link** that linkcheck reports comes from
intersphinx. `conf.py` pins the torch inventory to 2.9 but keeps
`base_url` at `docs/stable/`, and `stable` has since renamed that page.
The fix is a deliberate `conf.py` decision, so it isn't bundled here.
- **19 of the confirmed-broken links** live in the externally fetched
`_collections/` template content, which is fixed in the templates repo,
not here.

**Testing:**
- `python ci/lint/check_ray_repo_links.py` passes on this branch and
reports the 10 links above on master.
- To confirm it catches a move, I removed
`python/ray/tune/examples/tune-default.yaml` from a scratch index
(`GIT_INDEX_FILE`). The check then reported the `tune-distributed.rst`
link and exited 1.
- `bash ci/lint/lint.sh ray_repo_links` passes.
- `pre-commit run --files <changed files>` passes, including the new
hook, ruff, black, pydoclint and docstyle.
- I ran `linkcheck_report.main()` against a synthetic `output.json` with
`LINKCHECK_RECHECK_COOLDOWN=0`. One dead and one live URL produced a
single confirmed entry in the artifact. An empty input produced an empty
report.
- Every URL this PR adds returns HTTP 200, and every anchor
(`#streamingresponse`, `#timeouts`, `#using-pure-asgi-middleware`,
`#Installing_and_upgrading_packages`) exists on its target page.

**Review note:** `.buildkite/lint.rayci.yml` and `ci/lint/lint.sh` are
shared CI surfaces, so this wants a `ray-ci` review. The lint steps
don't carry `oss`, so the check also runs in downstream forks that reuse
this `.buildkite/` tree, against the fork's own tree.

AI assistance (Claude Code) was used to write this change. I reviewed
every changed line and ran the commands above.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
…ython-ray

Resolves conflicts with ray-project#66626 (offline link check + doc link fixes) in
the appo/dqn/ppo READMEs, examples/ray_tune/custom_experiment.py and
doc/source/rllib/rl-modules.md. "Fix links" (9127161) already applied
the same link fixes on top of the moved paths, so this branch's side is
kept. ci/lint/check_ray_repo_links.py passes on the merged tree.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn merged commit b4aefc1 into ray-project:master Oct 2, 2026
5 of 6 checks passed
ArturNiederfahrenhorst added a commit to ArturNiederfahrenhorst/ray that referenced this pull request Oct 2, 2026
Picks up ray-project#66096, which moves rllib/ to python/ray/rllib/.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Artur Niederfahrenhorst <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ervability pages to MyST (ray-project#66461)

## Why are these changes needed?

Converts the last non-API-reference RST pages under `ray-core/`,
`data/`, and `rllib/` to MyST Markdown, plus the `train/` and
`ray-observability/` pages that `doc/BUILD.bazel` names by path. The API
reference trees (`*/api/`, `rllib/package_ref/`, and
`ray-core/compiled-graph/compiled-graph-api`) stay RST for now.

Each page gets its own commit, so you can review one file at a time.
Every commit renames the page's literal `.rst` paths in
`doc/BUILD.bazel` to `.md`. These paths are in `exclude` lists and in
the explicit `files` lists of `doctest[data-gpu]` and
`doctest[train-gpu]`, and they don't glob. Without the edit, an excluded
page would silently join its target once it's `.md`, and an included
page would silently drop out of it.

Conversions are format-only: labels, headings, and prose are unchanged.
A final whitespace-only commit soft-wraps the prose. `ray-soft-wrap`'s
`verify.py` confirms non-whitespace bytes, rendered HTML, and
idempotence for all 11 files.

### `rllib/getting-started`: doctest target removed

The first commit deletes `doctest[rllib2]`, the only target over
`rllib/getting-started.rst`, before the page converts. The target is
tagged `manual` with a hang TODO, so no premerge or postmerge step has
run it, and nothing else references it (`git grep rllib2` is empty). Its
15 `testcode` blocks had no `testoutput`, so they asserted nothing. The
12 visible blocks become display-only `python` code blocks. The three
`:hide:` blocks held `.stop()` cleanups that never rendered, so they're
deleted. `doctest[rllib]` still excludes the page. If these examples
should be validated later, a `doc_code/` script is the better route than
reviving the hanging target. cc @elliot-barn, who owns the TODO.

This commit isn't buildable on its own. It turns a `.. testcode::` that
had no blank line before its body into a `.. code-block:: python`, still
with no blank line, and docutils reads the body as extra arguments to
the directive. The later conversion commit fixes it in the `.md`, and a
squash merge never puts the intermediate commit on master.

### Doctest coverage

Docs-only PRs don't run doctests premerge. This PR edits
`doc/BUILD.bazel`, so every library's docs example step runs, but
premerge can't show the conversion kept the same blocks. For that, I
parsed each `.md` and the `.rst` it replaced with Ray's `pytest-sphinx`
fork, the same parser the doctest macro runs, and asserted identical
sections (directive, body, `:options:`, `:skipif:`) and examples.

| Page | BUILD role | Examples before → after |
| --- | --- | --- |
| `ray-core/handling-dependencies` | `doctest[core]` exclude | 17 → 17 |
| `ray-core/tasks/nested-tasks` | `doctest[core]` exclude | 0 → 0
(`literalinclude` of a tested `doc_code/` file) |
| `data/batch-inference` | `doctest_each` exclude, `doctest[data-gpu]`
files | 7 → 7 |
| `data/transforming-data` | `doctest_each` exclude, `doctest[data-gpu]`
files | 24 → 24 |
| `data/contributing/contributing` | `doctest_each` glob | 0 → 0
(toctree only) |
| `rllib/getting-started` | `doctest[rllib]` exclude, `doctest[rllib2]`
removed | 15 → 0, by the removal commit |
| `ray-observability/user-guides/cli-sdk` | top-level exclude | 16 → 16
|
| `ray-observability/user-guides/ray-tracing` | top-level exclude | 3 →
3 |
| `train/horovod` | `doctest[train]` exclude | 2 → 2 |
| `train/user-guides/data-loading-preprocessing` | `doctest[train]`
exclude, `doctest[train-gpu]` files | 6 → 6 |
| `train/user-guides/using-accelerators` | `doctest[train]` exclude,
`doctest[train-gpu]` files | 10 → 10 |

To show the check would catch a broken conversion, I mutated each page
with examples three ways: dropping a `testcode` block, altering a line
in one, and turning one into a four-backtick fence. The last renders
fine but is never collected. The check failed on all 24 mutations.

### Rendering changes

I ran `render_diff.py` on all 11 pages against `/en/master`. Six render
identically: `nested-tasks`, `data/contributing/contributing`,
`cli-sdk`, `ray-tracing`, `horovod`, and `using-accelerators`. Every
difference on the other five is listed here.

- `rllib/getting-started`: on master, one `.. testcode::` line had no
blank line after it. docutils read the block's first six lines, the
`best_result = results.get_best_result(...)` call, as the directive's
argument and dropped them. So master shows code that uses `best_result`
without showing where it comes from. The converted page renders all six
lines. This is the one place the conversion deliberately doesn't
reproduce master.
- `rllib/getting-started`: the "Farama gymnasium" link now has
`https://`. On master it's a relative link to `gymnasium.farama.org`
that 404s.
- `ray-core/handling-dependencies`: MyST drops the apostrophe when it
slugifies the "can't import the packages" heading, so the section id
changes. That heading had no label, so the page adds a target carrying
the old docutils slug, and existing `#...-can-t-import-...` links still
resolve. An auto-numbered span id, which nothing links to, also changes
from `id4` to `id2`.
- `data/batch-inference` and
`train/user-guides/data-loading-preprocessing`: each renders an RST
comment as an HTML comment, which readers never see.
- `data/transforming-data`: the "When using" definition list's `<dl>`
gains the unstyled `myst` class.

The first preview diff also caught three regressions that the green
build didn't. MyST's `replacements` extension turned two `(c)` list
markers into `©` and an `etc..` into `etc…`. The anchor above had
changed too. A follow-up commit fixes all three. A sweep of the 11 pages
found no other text that extension rewrites.

### Dead `doc/BUILD.bazel` excludes

A final commit drops four `exclude` entries that name files that have
moved: two in `doctest[serve]` and two in the serve `doc_code` test. A
glob exclude naming a missing file excludes nothing, so these had
silently stopped applying. This doesn't change what any target runs.
ray-project#66462 carries the same commit, along with a lint check that fails on
this class of stale path, so the two PRs merge cleanly in either order.

### Open PRs that edit these files

Each of these open PRs edits one of the converted `.rst` files, so each
will need to move its change to the `.md`: ray-project#66279, ray-project#66191, ray-project#65956,
ray-project#65933, and ray-project#65830 (`handling-dependencies`), ray-project#65693 (`cli-sdk`), and
ray-project#66419, ray-project#66420, ray-project#66422, and ray-project#66423 (`data/batch-inference`,
`train/user-guides/data-loading-preprocessing`). ray-project#66096, ray-project#64053, and
ray-project#63881 also edit `doc/BUILD.bazel`, and only ray-project#66096 edits nearby lines.

## Related issue number

None. No open PR converts these pages. I checked `gh pr list` for open
PRs touching each file.

## Checks

- [x] I've signed off every commit (`git commit -s`).
- [x] Pre-commit hooks passed on every commit.
- Doctest parity: `python3 doctest_parity.py <the 11 .md files>` with
`pytest==7.4.4` and `pytest-sphinx @
git+https://github.com/ray-project/pytest-sphinx`. All OK, run again
after the soft-wrap commit.
- Static checks on every `.md`: fences balance, no leftover RST roles or
directives, every label from the `.rst` is present, and directive counts
match.
- Read the Docs preview builds green under `fail_on_warning`, and the
render diff against `/en/master` is in Rendering changes. The first
build hit the known autosummary-import segfault and passed on rebuild.
- Local doctest run: not done. The GPU targets need hardware, and the
CPU targets run in this PR's premerge because of the `BUILD.bazel`
change.

AI assistance (Claude Code) was used for the conversion and the
verification scripts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
ray-project#66626)

## Description

Docs, READMEs and docstrings often link to a file in this repo by its
GitHub URL, such as
`https://github.com/ray-project/ray/blob/master/<path>`. GitHub doesn't
redirect those URLs when a file moves or is deleted. It doesn't resolve
them through symlinked directories either, so
`blob/master/python/ray/rllib/...` returns 404 today. Ten such links are
broken on master. Six are in RLlib READMEs and example docstrings that
the Sphinx linkcheck never sees.

A network check can't catch this on a pull request, because a PR's new
links point at paths that don't exist on master until the PR merges. But
a link like this is correct exactly when its path exists in the tree
being committed, so it can be checked offline and the check can block.

This PR makes three changes.

**1. `ci/lint/check_ray_repo_links.py`**
- Finds every `github.com/ray-project/ray/{blob,tree,raw}/master/<path>`
and
`raw.githubusercontent.com/ray-project/ray/[refs/heads/]master/<path>`
link in tracked text files.
- Checks each path against `git ls-files` and fails on any path that
doesn't exist.
- Ignores pinned SHAs, tags, other branches, and `#L42` line anchors.
- Runs in about 0.8s with no network.

It runs in the `lint-small-prose` matrix (`always`), not in
`pre_commit`. A prose-only change can fail it: renaming or deleting a
doc file breaks links to it elsewhere, and `pre_commit` is filtered out
of prose-only PRs. It also scans the whole tree rather than only changed
files, for the same reason. It's also registered as a local pre-commit
hook.

**2. Link fixes.** These cover everything the new check reports on
master, plus the Ray-owned links that the postmerge `doc: linkcheck`
step confirms broken, wherever a replacement checked out.
- RLlib READMEs, `rl-modules.md` and the `custom_experiment.py`
docstring now point at current paths. The DDPPO and APEX entries for
removed algorithms are dropped.
- `tune-distributed.rst` now points at
`python/ray/tune/examples/tune-default.yaml`.
- `src/ray/.cursor/BUGBOT.md` now points at `rpc-fault-tolerance.md`,
the MyST version of the page.
- Starlette and Uvicorn moved their docs to `starlette.dev` and
`uvicorn.dev`, which are the `homepage` values of their GitHub repos.
The old hosts no longer answer.
- The Arch Wiki, Vale, and Databricks statement execution API links
point at those sites' current URLs.

**3. `linkcheck_report.py` writes a `linkcheck-report.json` artifact
instead of posting to Slack.**
- The step's container already mounts the agent's artifact directory at
`/artifact-mount`.
- The `DOCS_LINKCHECK_SLACK_WEBHOOK` env var it read was never
provisioned, so today every run ends with "not set; skipping Slack
alert" and nobody sees the result.
- A scheduled job maintained by the docs team now reads the result
through the Buildkite API and posts the digest, so no Slack credential
has to enter this repo's CI secrets. That job also parses the printed
lines when the artifact is missing, so the printed format is unchanged.

## Related issues

Related to ray-project#66096, which moves `rllib/` under `python/ray/` and rewrites
the RLlib links for the new paths.
- This PR's RLlib edits make the same choices as that PR, but use the
current master paths. Whichever merges second has a small conflict on
those lines.
- Once this lands, the new check covers the move itself: any
`/master/rllib/...` link ray-project#66096 misses fails lint on that PR, not after
merge.

Not a duplicate: open PR searches for "link check", "broken links",
"linkcheck", and "dead links" turn up nothing in this area.

## Additional information

**Left out on purpose:**
- **The torch `Stream` link** that linkcheck reports comes from
intersphinx. `conf.py` pins the torch inventory to 2.9 but keeps
`base_url` at `docs/stable/`, and `stable` has since renamed that page.
The fix is a deliberate `conf.py` decision, so it isn't bundled here.
- **19 of the confirmed-broken links** live in the externally fetched
`_collections/` template content, which is fixed in the templates repo,
not here.

**Testing:**
- `python ci/lint/check_ray_repo_links.py` passes on this branch and
reports the 10 links above on master.
- To confirm it catches a move, I removed
`python/ray/tune/examples/tune-default.yaml` from a scratch index
(`GIT_INDEX_FILE`). The check then reported the `tune-distributed.rst`
link and exited 1.
- `bash ci/lint/lint.sh ray_repo_links` passes.
- `pre-commit run --files <changed files>` passes, including the new
hook, ruff, black, pydoclint and docstyle.
- I ran `linkcheck_report.main()` against a synthetic `output.json` with
`LINKCHECK_RECHECK_COOLDOWN=0`. One dead and one live URL produced a
single confirmed entry in the artifact. An empty input produced an empty
report.
- Every URL this PR adds returns HTTP 200, and every anchor
(`#streamingresponse`, `#timeouts`, `#using-pure-asgi-middleware`,
`#Installing_and_upgrading_packages`) exists on its target page.

**Review note:** `.buildkite/lint.rayci.yml` and `ci/lint/lint.sh` are
shared CI surfaces, so this wants a `ray-ci` review. The lint steps
don't carry `oss`, so the check also runs in downstream forks that reuse
this `.buildkite/` tree, against the fork's own tree.

AI assistance (Claude Code) was used to write this change. I reviewed
every changed line and ran the commands above.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
## Description
Over 7 years ago `rllib` was moved from `python/ray/rllib` to the root
folder where its lived ever since
(ray-project#5324).
However, as Ray has grown and rllib positions in the root folder makes
less sense and causes more issues for CI and docs to maintain due to its
"weird" position relative to the other Ray projects.

This PR moves `rllib` back to `python/ray/rllib` updating all the
relevant documentation and CI
For users, this should be a primarily internal change and no external
users being aware of the changes (other than PRs)

---------

Signed-off-by: Mark Towers <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
Co-authored-by: Mark Towers <[email protected]>
Co-authored-by: elliot-barn <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
ArturNiederfahrenhorst pushed a commit that referenced this pull request Oct 7, 2026
## Description
A follow up to #63500 as
#66096 has merged rllib into
`python/ray` which means that some of the missing pre-commit hooks now
activate like pydoclint.
This PR uses Opus 5 to add docstring to all of the rllib, according to
the pydoclint configurations.
I've read every line and the PR only changes docstrings and type hint so
there is no breaking changes

---------

Signed-off-by: Mark Towers <[email protected]>
Co-authored-by: Mark Towers <[email protected]>
dstrodtman added a commit that referenced this pull request Oct 14, 2026
## Description

A rolling batch of small, independent docs fixes. Ray's `AGENTS.md` asks
that trivial edits be bundled rather than opened as one-off PRs, so they
collect here. Each item is its own commit or commit pair, so a reviewer
can drop any one without touching the rest.

### Items

1. **RLlib dev install: use `setup-dev.py --allow` instead of
prompt-order instructions** (`doc/source/rllib/dev.md`). The example
said to answer `Y` only at "the first question on linking RLlib."
`setup-dev.py` now prompts for `llm`, `serve/llm`, and `data/llm.py`
before `rllib`, so following the comment as written links `llm` and
declines RLlib. The example now uses `--allow rllib`, with `--allow
rllib tune train` as the opt-in for Tune and Train, which doesn't depend
on prompt order. Found while checking that READMEs and contributor docs
no longer reference the pre-#66096 `rllib/` symlink layout. No such
references remain.
2. **Convert the KubeRay GPU guide to MyST**
(`doc/source/kuberay/user-guides/gpu.rst` to `.md`). It's the last prose
`.rst` page under `doc/source/` outside the API-reference trees. It was
held back from the cluster conversion until #66674 moved it to
`kuberay/`. Two commits: a faithful conversion, then a whitespace-only
soft-wrap verified by `ray-soft-wrap`'s `verify.py`. Both labels
(`kuberay-gpu`, `kuberay-gpu-override`) are preserved, the named
hyperlink targets are inlined, and the heading levels match the live
page (H1 to H4).
3. **Fix the raw RST at the top of the contributor guide**
(`doc/source/ray-contribute/getting-involved.md`). The page includes
`_includes/_latest_contribution_doc.rst` with `{include}` and `:parser:
rst`, which MyST doesn't parse as RST. Since the page converted to
Markdown, docs.ray.io has shown the literal text "… admonition:: Check
your version!" at the top of the page. The page was the partial's only
consumer, so the admonition is now inline as `:::{admonition}` and the
partial is deleted.
4. **Replace an unreachable vSphere link in the VM getting-started
guide** (`doc/source/cluster/vms/getting-started.md`). The vSphere tab
linked to `github-vcf.devops.broadcom.net/vcf/vmray`, an internal
Broadcom host that isn't reachable from the public internet, so the
nightly link check flags it as broken on `master`. The link now points
to the supervisor service section of the in-tree vSphere launch guide,
which covers the same setup step.

## Not a duplicate

- Item 1: no open PR touches `doc/source/rllib/dev.md`, and searches for
`setup-dev rllib`, `rllib dev.md`, and the page title return no open
PRs.
- Items 2 and 3: no open PR touches any of the changed paths. I checked
the file lists of the 400 most recent open PRs, and searched for `MyST`,
`gpu.rst`, and `getting-involved`.
- Item 4: of the 400 most recent open PRs, only #66289 also touches
`doc/source/cluster/vms/getting-started.md`. It adds an OCI tab next to
the vSphere tab and leaves the vSphere link unchanged.

The README and design-note conversions outside `doc/` that were item 4
moved to #66811. Those paths pull in library code-owner approvals, which
this PR shouldn't wait on.

## Testing

- Item 1: installed the `ray==2.59.0` wheel into a clean Python 3.11
venv, then ran both documented commands from this branch:
- `python python/ray/setup-dev.py --allow rllib`: linked only
`site-packages/ray/rllib` to the checkout's `python/ray/rllib` and
skipped every other package.
- `python python/ray/setup-dev.py --allow rllib tune train`: linked
`tune` and `train`, reported `rllib` as already linked, and skipped the
other 20 packages.
- Item 2: static checks on the new `.md` passed. They confirm the
frontmatter parses, the fences balance, and no RST constructs or
scheme-less links are left. The page has no `testcode` or doctest
blocks, and `doc/BUILD.bazel` doesn't name it. Heading levels were
checked against the live `/en/master` page. The Read the Docs preview
build and a render diff against `/en/master` are pending.
- Item 3: the render diff against `/en/master` is expected to differ at
the top of the page. `/en/master` currently shows the broken literal
text, and this PR shows the admonition.
- Item 4: the target heading exists in `vsphere.md`, and
`myst_heading_anchors = 4` in `conf.py` generates its anchor.
- `pre-commit` ran on every commit. The master-branch link check is the
only hook that applies, and it passed.

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests rllib RLlib related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants