Skip to content

[doc] Remove the retired doc/source/templates starter templates - #67008

Merged
edoakes merged 1 commit into
masterfrom
doc-1446-retire-doc-templates
Oct 15, 2026
Merged

edoakes merged 1 commit into
masterfrom
doc-1446-retire-doc-templates

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why are these changes needed?

doc/source/templates/ is the Ray 2.6-era "Ray Starter Templates" directory. The harness that made it a templates mechanism is gone. exclude_patterns in doc/source/conf.py drops templates/* from the Sphinx build, and nothing in it backs a bazel test target. What was left on master:

The DreamBooth example is being rebuilt on current diffusers as a new example, so this PR deletes the old sources rather than moving them. The rebuilt example lands outside templates/.

What this PR changes

  • Deletes doc/source/templates/ (69 files).
  • Deletes the unpublished doc/source/train/examples/pytorch/dreambooth-finetuning.md and its exclude_patterns entry. The temporary redirects in doc/redirects/current.yaml from both old DreamBooth URLs to /train/examples.html stay as they are, to be repointed when the rebuilt example ships.
  • Deletes release/air_examples/dreambooth/ and the two jailed release tests in release/release_tests.yaml (the whole AIR examples group, which held only these two).
  • Removes the dead templates/* patterns from exclude_patterns and llms_txt_exclude in conf.py, and the 04 doctest exclusion from doc/BUILD.bazel.
  • .buildkite/test.rules.txt: drops doc/source/templates/05_dreambooth_finetuning/ from the literalinclude-sources rule and doc/source/templates/ from the skip rule that [ci] Stop routing unexecutable doc assets to the core docs example step #65289 added. _templates/ keeps its skip rule. The comments are updated to match.
  • .buildkite/test.rules.test.txt: drops the templates/ cases. The assertion that the prose-and-image skip still wins inside a doc-routed directory moves from 05 to cluster/doc_code/, so that coverage isn't lost.
  • .github/CODEOWNERS: drops templates from the catch-all comment's directory list.

Questions for reviewers

  • Release tests (ml team): this removes air_example_dreambooth_finetuning and air_example_dreambooth_finetuning_lora. They're manual-only and jailed, and their sources go away with this directory. If you'd rather keep the test definitions as a placeholder for the rebuilt example, say so and I'll restore them.
  • External links: these templates were promoted publicly around Ray 2.6, so blog posts or course material might link to github.com/ray-project/ray/tree/master/doc/source/templates/.... This PR is a clean delete. If maintainers would prefer a tombstone README.md pointing at the Train examples gallery, I can add one.

Related PRs

Once this merges, the following open Dependabot PRs target manifests that no longer exist and can be closed: #65851, #65850, #64851, #64850, #64002, #64001, #62417, #62418, #56096, #54423, #55301.

Duplicate check

Searched open PRs for doc/source/templates and dreambooth. The only matches are the Dependabot bumps listed above, #67006 (my own in-tree-links sweep, which deliberately leaves this directory alone), and #66880 (touches release_tests.yaml but not the DreamBooth entries).

Testing

  • rayci test-rules (built from ray-project/rayci) against the updated .buildkite/test.rules.txt and test.rules.test.txt: 177/177 cases pass. Flipping one new case to a wrong expectation makes it fail, confirming the case is live.
  • git grep for doc/source/templates, each template directory name, and air_example_dreambooth returns no matches outside _templates/.
  • conf.py parses, and release/release_tests.yaml loads with yaml.safe_load.
  • pre-commit passes on the changed files, including buildifier on doc/BUILD.bazel and the master-link resolution check.
  • The docs build runs on this PR's Read the Docs preview.

This PR was prepared with AI assistance (Claude Code). I reviewed every changed line.

🤖 Generated with Claude Code

doc/source/templates/ is the Ray 2.6-era starter-templates directory. The
harness that used it is gone, Sphinx excludes it from the build, and its
only remaining consumers were the unpublished DreamBooth page and two
jailed, manual-only release tests.

Delete the directory, the unpublished DreamBooth page, and the
air_examples/dreambooth release tests that symlinked into it. Drop the
now-dead conf.py patterns, the doctest exclusion, and the CI routing
rules that named it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested review from a team as code owners October 14, 2026 15:16

@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 removes several starter templates, including batch inference, many model training, stable diffusion serving, llama-2 fine-tuning, and Dreambooth fine-tuning, along with their associated scripts, configurations, tests, and documentation. Build rules, CODEOWNERS, and release test configurations have been updated to reflect these deletions. I have no feedback to provide.

@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Oct 14, 2026

@ronny-anyscale ronny-anyscale 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.

bye felicia

@ray-gardener ray-gardener Bot added docs An issue or change related to documentation train Ray Train Related Issue core Issues that should be addressed in Ray Core release-test release test labels Oct 14, 2026
@edoakes
edoakes merged commit 46ed934 into master Oct 15, 2026
5 of 6 checks passed
@edoakes
edoakes deleted the doc-1446-retire-doc-templates branch October 15, 2026 18:31
dstrodtman added a commit that referenced this pull request Oct 15, 2026
…ules (#67089)

## Why are these changes needed?

`test-rules` fails on master, so every premerge build that includes
master since 18:32Z today goes red. For example,
[74953](https://buildkite.com/ray-project/premerge/builds/74953) and
[74954](https://buildkite.com/ray-project/premerge/builds/74954) both
fail on the same line:

```
FAIL: doc/source/cluster/doc_code/README.md (line 180)
  +doc_example (unexpected)
1/192 test(s) failed
```

Two PRs that merged a minute apart conflict, though each passed
`test-rules` on its own base:

- #67008 (merged 18:31Z) removed `doc/source/templates/`. It added the
expected result `doc/source/cluster/doc_code/README.md:` (no tags),
because prose inside a `doc`-routed `doc_code/` directory is skipped.
- #66809 (merged 18:32Z) routes `doc/source/*.md` to `doc_example`. Its
skip rule for prose that Sphinx never renders exempted only
`doc/source/templates/*.md`, which #67008 had just removed.

This PR points that skip rule at the two `doc`-routed `doc_code/`
directories (`cluster/` and `ray-contribute/`) instead of the removed
templates directory. It also drops the stale
`doc/source/templates/README.md:` expected result, which would now fail
the same way, and adds the matching `ray-contribute/doc_code/README.md:`
expected result.

## Duplicate check

I searched open PRs for `test-rules` and `test.rules README` and found
no fix in flight. I'm the author of both PRs that conflict.

## Testing

I built rayci at the repo's pinned version (`.rayciversion` = 0.48.0)
and ran `rayci test-rules` from the repo root:

- On master without this change, it fails with the same
`doc/source/cluster/doc_code/README.md (line 180)` error as CI and exits
1.
- With this change, it passes and exits 0.

AI assistance (Claude Code) was used to diagnose the failure and draft
the change. 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]>
dstrodtman added a commit that referenced this pull request Oct 30, 2026
## Description

This PR retires the notebook authoring templates and the contributor
guidance that points new examples at notebooks.

`doc/source/_templates/template.ipynb` is a Jupyter starter for new doc
examples. It isn't a page, because `templates_path` keeps `_templates/`
out of the source files Sphinx reads. Nothing includes it, and no bazel
target runs it. Its MyST sibling, `template.md`, is out of date. It
imports `ray.rllib.agents.ppo`, demos `{eval-rst}` and `{margin}`, and
teaches `{code-cell}` notebooks that no build or test target executes.
The "Creating a notebook example" section of the contributor guide links
both templates, tells contributors to download the page as an `.ipynb`,
and recommends converting their draft to `.ipynb` when they finish.

This PR deletes the Jupyter template and turns `template.md` into a
template for an end-to-end guide written as an ordinary MyST page. The
contributor guidance now says that a guide like this is a Markdown page
its author ran, not a tested asset, and sends examples that need testing
to the template-collections flow. The template and guidance changes come
from #67428, which merged into this branch.

### What this PR changes

- Deletes `doc/source/_templates/template.ipynb`.
- `doc/source/_templates/template.md`: rewrites it as an end-to-end
guide skeleton. It uses only MyST, sphinx-design (`tab-set`,
`dropdown`), colon-fence admonitions, and `{ref}` and `{py:func}` roles,
with no myst-nb notebook syntax. A maintainer-only HTML comment under
the title records that Ray CI doesn't test the guide and which Ray
version its author last ran it with. The example code is a minimal Ray
Core task. Sphinx still excludes the file through `_templates/`.
- `doc/source/ray-contribute/docs.md`:
- Replaces "Creating a notebook example" (label
`creating-notebook-example`) with "Writing an end-to-end guide"
(`writing-e2e-guide`). The new section points to the template and says
Ray CI doesn't run the guide's code, so the author runs every step and
records the Ray version. It sends tested examples to the
template-collections flow and says not to add notebooks or notebook
front matter. To convert an existing notebook, it gives `jupyter
nbconvert --to markdown`.
- Removes what the old section taught: the Jupyter template link,
downloading the page as an `.ipynb`, the Tune Hyperopt notebook as a
model, the kernel specification front matter, `code-cell` examples, cell
tags, reference labels, removed-cell testing, and the `jupytext`
conversions. It also drops the claim that CI tests every notebook placed
in the Tune `examples` folder.
- Updates the format overview and the "two types of documents" list so
they no longer present notebooks as the format for new examples.
- "Adding code to an `.rST` or `.md` file": drops the claim that every
snippet is tested and the `.. code-cell:: python` recommendation. Tested
code uses `testcode` or a `literalinclude` script, and code that CI
can't run goes in a plain fenced block.
  - Links "How to write code snippets" by its `.md` file name.
- "Writing an end-to-end guide": offers an `examples.yml` gallery only
for Ray Data, Ray Serve, and Ray Train, the only libraries that have
one. `conf.py` marks gallery-linked pages as orphans, so the page needs
no `orphan` front matter. It also says what `nbconvert` does with
outputs and images.
- Replaces "Every Python file in the `doc_code` directory is
automatically tested." Some files and directories have no target in
`doc/BUILD.bazel`, so it now tells contributors to check that a target
covers their script.
- `doc/source/ray-contribute/writing-style.md`, "Code blocks": replaces
"Every runnable snippet in the docs is tested." It now names the two
tested forms, a `testcode` block on a page with a doctest target in
`doc/BUILD.bazel` and a `doc_code/` script included with
`literalinclude`. It limits both to code that runs as written and that
CI should test, and says CI doesn't run a plain fenced block. Since
#67432, no documentation page runs a `>>>` example, and #67429 updates
`writing-code-snippets.md` to match.
- `doc/source/ray-contribute/publishing-examples-legacy.md`: takes over
the cell-tag guidance (`hide-*`, `remove-*`, and overriding realistic
values in a removed cell), rewritten for `.ipynb` cell metadata. It
applies only to the remaining in-tree notebooks.
- `doc/source/ray-contribute/publishing-examples.md`: repoints its
cross-reference to `writing-e2e-guide`. No reference to the old label
remains.
- `.buildkite/test.rules.txt`: deletes the `doc/source/_templates/` skip
rule. It existed to keep `template.ipynb` off the `doc/*.ipynb`
catch-all. Every remaining file under `_templates/` (`.html`, `.rst`,
`.md`, `.gitkeep`) gets the same tags without it: `.md` and `.rst` files
hit the leading prose skip first, and the rest fall through to the broad
`doc/` skip.
- `.buildkite/test.rules.test.txt`: replaces the `template.ipynb` case
with `doc/source/_templates/layout.html:`.

### Merge-order note for #67012

#67012 adds `doc/asset_allowlists/notebooks.txt`, which lists
`doc/source/_templates/template.ipynb`, and its check fails on an entry
whose file is gone. Neither PR depends on the other, and they merge
without textual conflicts. Whichever merges second deletes that line. If
this PR merges first, `python doc/test_doc_assets.py --update` on #67012
removes it. With this branch, current master, and #67012 merged
together, the check fails only on that line and passes once it's
deleted.

## Related issues

Includes #67428, which merged into this branch. #67429 is stacked on
this branch, and #67639 is stacked on #67429. #67639 limits the legacy
notebook page to maintaining the two remaining notebook examples.
Follows #67008, which rewrote the same comment blocks in
`test.rules.txt` and `test.rules.test.txt`, and #66974, which moved
never-run `testcode` blocks to plain code blocks.

## Additional information

### Duplicate check

I searched open PRs for `template.ipynb`, `template.md`, `_templates`,
`notebook template`, `end-to-end guide`, `creating-notebook-example`,
`ray-contribute/docs.md`, `writing-style.md`, and `publishing-examples`,
then compared the files each docs PR in the results changes with this
PR's. No open PR removes either template or rewrites these sections. The
open PRs that touch the same files edit other hunks:

- #66462 and #67012 edit `test.rules.txt` and `test.rules.test.txt`.
Each merges with this branch without conflicts. #67204, which edited
`docs.md` and `writing-style.md`, has merged, and this branch is rebased
on it.
- #67018 edits a section of `writing-style.md` about 170 lines below
this PR's hunk.
- #67429 and #67639 are stacked on this branch.

### Testing

On this branch's head, rebased on master on 2026-10-30:

- `rayci test-rules`, using v0.51.0, the version `.rayciversion` pins,
built from `ray-project/rayci`: 197/197 cases pass, and the check also
passes with the branch merged with current master. Changing the new
`layout.html` case to expect `doc` makes it fail, so the case is live.
- Routing equivalence: I added every file under `doc/source/_templates/`
as a case that expects no tags. `rayci test-rules` passes both with and
without the deleted rule. The only file whose routing the rule changes
is `template.ipynb`, which routes to `doc_example` without it.
- `pre-commit run --files` on the changed files passes, including the
check that links to files on master resolve.
- `vale` on the changed pages: `docs.md` goes from 98 alerts to 71, and
the other pages stay level or drop. The only new alerts are spelling
flags on "toctree" and "doctest", terms these guides already use, and a
passive-voice flag on an unchanged sentence in `docs.md`.
- `jupyter nbconvert your-example.ipynb --to markdown`, with nbconvert
7.17.2 on a copy of a Tune notebook, writes a Markdown file with
`python` code fences and no Jupyter front matter.
- The Read the Docs preview renders "Writing an end-to-end guide", the
`writing-e2e-guide` references in `docs.md` and `publishing-examples.md`
resolve to it, and the legacy page renders "Hide and remove cells".

From #67428:

- The template's example code, run with `ray[default]` 2.59.0 on Python
3.11, prints `[0, 1, 4, 9]`.
- A copy of the template with its placeholders filled in builds without
warnings using Sphinx 8.2.3, myst-parser 5.1.0, sphinx-design, and the
`myst_enable_extensions` from `conf.py`. The tab set, dropdown, and tip
render.

This PR was prepared with AI assistance (Claude Code), including the
commits from #67428. Each author reviewed every line they changed.

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

---------

Signed-off-by: Ronny Roland <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests release-test release test train Ray Train Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants