Skip to content

[doc] Convert the running-applications pages to MyST - #66679

Merged
dstrodtman merged 3 commits into
masterfrom
doc-1526-cluster-myst-running-apps
Oct 5, 2026
Merged

dstrodtman merged 3 commits into
masterfrom
doc-1526-cluster-myst-running-apps

Conversation

@dstrodtman

@dstrodtman dstrodtman commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Converts the seven doc/source/cluster/running-applications/ pages that are still reStructuredText from RST to MyST Markdown, as part of the ongoing RST-to-MyST migration of doc/source/. These are the Ray Jobs quickstart, SDK overview, REST API, CLI reference, and SDK reference, plus Ray Client and the autoscaler SDK reference. This is a format-only change, apart from the fixes noted below. The rendered pages should otherwise match /en/master.

The PR has three commits:

  1. The conversion, which keeps the source line wrapping so it reads line by line against the .rst.
  2. A whitespace-only soft-wrap pass, verified by ray-soft-wrap's verify.py.
  3. Review fixes to the rest examples and the ray-client warning.

Conversion notes

  • sphinx-click (click::), autofunction, autosummary, and currentmodule directives are wrapped in {eval-rst}, following serve/api/cli.md, ray-core/api/sandboxes.md, and serve/api/index.md. Each ray-job-*-doc label stays inside the {eval-rst} block with its click:: directive, so it still targets the generated command section.
  • One quickstart code block was indented with tabs. It's rebuilt with docutils' 8-column tab expansion, and the text matches the /en/master render.
  • ray-client had two empty RST comments (..) above code blocks. They rendered nothing and carried no text, so they're dropped.
  • Rendering fix. In ray-client, the bold warning "Do not expose this to 0.0.0.0/0" shows literal backticks on /en/master, because RST doesn't nest inline markup. Markdown does, so 0.0.0.0/0 now renders as inline code inside the bold text.
  • Broken examples fixed. Two rest examples fail when run, and both bugs predate this PR. The polling loop compared against JobStatus.* without importing it, which raises NameError. It now compares against the status strings the REST API returns. The stop example called .json() on an already-parsed dict and rebound the json module name. It now uses resp.json().
  • Bare URLs in quickstart are wrapped as <https://...> autolinks because MyST's linkify is off.

Every label is preserved. cluster/package-overview.rst lists three of these pages in its toctree with an .rst suffix. Sphinx strips a known source suffix from toctree entries, so those entries still resolve, and a separate conversion PR converts that page. No other caller references these pages by file path. None of the pages has doctest blocks, and doc/BUILD.bazel doesn't name them.

Overlapping open PRs

#65693 adds 8 lines to job-submission/sdk.rst. After this merges, that change moves to sdk.md.

Duplicate check

No other open PR converts these files. I checked every open PR's file list.

Testing

  • Static checks on each new .md: frontmatter parses, fences balance, no residual RST outside fences, no .html# or .rst link targets, every label present.
  • python3 doc/.claude/skills/ray-soft-wrap/scripts/verify.py: passed.
  • RtD preview build: green under fail_on_warning before the review fixes. The rebuild for the latest commit is pending.
  • render_diff.py against /en/master, run before the review fixes: 7 of 7 pages render identically. The review fixes intentionally change the ray-client warning and the rest code blocks.

AI assistance (Claude Code) was used for this conversion. I review every changed line before requesting review.

🤖 Generated with Claude Code

dstrodtman and others added 2 commits October 2, 2026 15:35
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Whitespace only, verified by ray-soft-wrap's verify.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman dstrodtman added the docs An issue or change related to documentation label Oct 2, 2026
@dstrodtman
dstrodtman marked this pull request as ready for review October 5, 2026 16:03
@dstrodtman
dstrodtman requested review from a team as code owners October 5, 2026 16:03
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Oct 5, 2026

@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 migrates several documentation files related to Ray Job Submission and Cluster Scaling from reStructuredText (.rst) to MyST Markdown (.md) format. The review feedback highlights a few issues in the newly formatted files: specifically, two Python code errors in rest.md (an undefined JobStatus reference causing a NameError and an invalid .json() call on a dictionary causing an AttributeError), as well as minor syntax formatting issues in sdk.md and ray-client.md where backticks are incorrectly formatted or escaped.

rst = json.loads(resp.text)
status = rst["status"]
print(f"status: {status}")
if status in {JobStatus.SUCCEEDED, JobStatus.STOPPED, JobStatus.FAILED}:

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.

medium

The REST API returns the job status as a string (e.g., "SUCCEEDED", "STOPPED", "FAILED"). Since JobStatus is not imported or defined in this Python example, referencing JobStatus.SUCCEEDED will raise a NameError. Using string literals directly is cleaner and works out of the box without requiring Ray imports.

Suggested change
if status in {JobStatus.SUCCEEDED, JobStatus.STOPPED, JobStatus.FAILED}:
if status in {"SUCCEEDED", "STOPPED", "FAILED"}:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied in 240dee9. The REST API returns the status as a plain string, so the literals work without importing JobStatus.

Comment on lines +83 to +86
rst = json.loads(resp.text)
json = rst.json()
stopped = json["stopped"]
print(stopped)

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.

medium

The current code parses the response body using json.loads(resp.text) into a dictionary rst, and then attempts to call rst.json(). This will raise an AttributeError: 'dict' object has no attribute 'json'. Additionally, assigning the result to a variable named json overrides the imported json module. Using resp.json() directly is the standard and correct way to parse JSON responses with the requests library.

Suggested change
rst = json.loads(resp.text)
json = rst.json()
stopped = json["stopped"]
print(stopped)
rst = resp.json()
stopped = rst["stopped"]
print(stopped)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied in 240dee9.

```

:::{tip}
By default, the Ray job server will generate a new `job_id` and return it, but you can alternatively choose a unique `job_id` string first and pass it into {code}`submit_job`. In this case, the Job will be executed with your given id, and will throw an error if the same `job_id` is submitted more than once for the same Ray cluster.

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.

medium

The Sphinx-style role {code}submit_jobcan be simplified to standard Markdown inline code submit_job `` for better readability and consistency with MyST Markdown guidelines.

Suggested change
By default, the Ray job server will generate a new `job_id` and return it, but you can alternatively choose a unique `job_id` string first and pass it into {code}`submit_job`. In this case, the Job will be executed with your given id, and will throw an error if the same `job_id` is submitted more than once for the same Ray cluster.
By default, the Ray job server will generate a new `job_id` and return it, but you can alternatively choose a unique `job_id` string first and pass it into `submit_job`. In this case, the Job will be executed with your given id, and will throw an error if the same `job_id` is submitted more than once for the same Ray cluster.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Leaving this as is. The original RST uses the :code: role, and {code} is its direct MyST equivalent. Switching to plain backticks changes the rendered HTML classes, which this format-only conversion avoids.

:::{warning}
Anyone with Ray Client access can execute arbitrary code on the Ray Cluster.

**Do not expose this to \`0.0.0.0/0\`.**

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.

medium

The backticks around the IP address are escaped (\0.0.0.0/0`), which renders them as literal backticks in the output. Using standard Markdown inline code backticks (`` 0.0.0.0/0` ``) will correctly render the IP address as monospaced text inside the bold warning block.

Suggested change
**Do not expose this to \`0.0.0.0/0\`.**
**Do not expose this to `0.0.0.0/0`.**

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied in 240dee9. The escape matched the literal backticks that /en/master shows, but those are an RST rendering bug, so this fixes them.

Addresses gemini-code-assist review comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman merged commit f28aa8c into master Oct 5, 2026
6 checks passed
@dstrodtman
dstrodtman deleted the doc-1526-cluster-myst-running-apps branch October 5, 2026 19:06
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
## Summary

Converts the seven `doc/source/cluster/running-applications/` pages that
are still reStructuredText from RST to MyST Markdown, as part of the
ongoing RST-to-MyST migration of `doc/source/`. These are the Ray Jobs
quickstart, SDK overview, REST API, CLI reference, and SDK reference,
plus Ray Client and the autoscaler SDK reference. This is a format-only
change, apart from the fixes noted below. The rendered pages should
otherwise match `/en/master`.

The PR has three commits:

1. The conversion, which keeps the source line wrapping so it reads line
by line against the `.rst`.
2. A whitespace-only soft-wrap pass, verified by `ray-soft-wrap`'s
`verify.py`.
3. Review fixes to the `rest` examples and the `ray-client` warning.

## Conversion notes

- `sphinx-click` (`click::`), `autofunction`, `autosummary`, and
`currentmodule` directives are wrapped in `{eval-rst}`, following
`serve/api/cli.md`, `ray-core/api/sandboxes.md`, and
`serve/api/index.md`. Each `ray-job-*-doc` label stays inside the
`{eval-rst}` block with its `click::` directive, so it still targets the
generated command section.
- One `quickstart` code block was indented with tabs. It's rebuilt with
docutils' 8-column tab expansion, and the text matches the `/en/master`
render.
- `ray-client` had two empty RST comments (`..`) above code blocks. They
rendered nothing and carried no text, so they're dropped.
- **Rendering fix.** In `ray-client`, the bold warning "Do not expose
this to `0.0.0.0/0`" shows literal backticks on `/en/master`, because
RST doesn't nest inline markup. Markdown does, so `0.0.0.0/0` now
renders as inline code inside the bold text.
- **Broken examples fixed.** Two `rest` examples fail when run, and both
bugs predate this PR. The polling loop compared against `JobStatus.*`
without importing it, which raises `NameError`. It now compares against
the status strings the REST API returns. The stop example called
`.json()` on an already-parsed dict and rebound the `json` module name.
It now uses `resp.json()`.
- Bare URLs in `quickstart` are wrapped as `<https://...>` autolinks
because MyST's `linkify` is off.

Every label is preserved. `cluster/package-overview.rst` lists three of
these pages in its toctree with an `.rst` suffix. Sphinx strips a known
source suffix from toctree entries, so those entries still resolve, and
a separate conversion PR converts that page. No other caller references
these pages by file path. None of the pages has doctest blocks, and
`doc/BUILD.bazel` doesn't name them.

## Overlapping open PRs

ray-project#65693 adds 8 lines to `job-submission/sdk.rst`. After this merges, that
change moves to `sdk.md`.

## Duplicate check

No other open PR converts these files. I checked every open PR's file
list.

## Testing

- Static checks on each new `.md`: frontmatter parses, fences balance,
no residual RST outside fences, no `.html#` or `.rst` link targets,
every label present.
- `python3 doc/.claude/skills/ray-soft-wrap/scripts/verify.py`: passed.
- RtD preview build: green under `fail_on_warning` before the review
fixes. The rebuild for the latest commit is pending.
- `render_diff.py` against `/en/master`, run before the review fixes: 7
of 7 pages render identically. The review fixes intentionally change the
`ray-client` warning and the `rest` code blocks.

AI assistance (Claude Code) was used for this conversion. I review every
changed line before requesting review.

🤖 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

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants