Repository navigation
[docs] Add a Kubernetes and Ray scheduling orientation guide - #65263
Conversation
Ray on Kubernetes involves two schedulers: Kubernetes places pods on machines, and Ray places tasks and actors on pods. The docs cover each layer well on its own, but nothing explains how they relate or which one a user should investigate when a workload doesn't start. The closest existing page is the Ray autoscaler comparison guide, but it's scoped to autoscaling and marked advanced, so a user debugging a pending actor is unlikely to find it. Add a user guide that names the two layers, documents how KubeRay derives Ray's logical resource capacity from the container spec, and maps pod state to the layer worth investigating. The page defers all mechanism to the existing Ray Core scheduling, RayCluster config, and autoscaler pages rather than restating them. Also link to the new page from the autoscaler guide. Signed-off-by: Douglas Strodtman <[email protected]>
The page said Ray integrates with four batch schedulers and listed Kueue, KAI Scheduler, Volcano, and YuniKorn. The k8s-ecosystem section documents a fifth: the kubernetes-sigs scheduler-plugins integration, which supports gang scheduling for RayCluster through the PodGroup API as of KubeRay v1.4.0. Signed-off-by: Douglas Strodtman <[email protected]>
Brings this page in line with the rules under review in ray-project#65239. Pod is a Kubernetes API object, so it takes UpperCamelCase in prose, and the page wrote it lowercase throughout. The `kubectl describe pod` command keeps its casing, since it's code rather than prose. Also drops the one use of "Ray pod" in the opening paragraph. The mapping it was reaching for now gets stated directly instead, which is what the page needs anyway: KubeRay runs each Ray node as a Kubernetes Pod, and each scheduler acts on a different half of that arrangement. Removes the later restatement in "The two layers", since one statement up front covers it. Signed-off-by: Douglas Strodtman <[email protected]>
|
Pushed a terminology pass in 6d3603d and marking this ready for review. This page originally wrote "pod" lowercase throughout and used "Ray pod" once in the opening. Both are now fixed against the rules under review in #65239: Pod is a Kubernetes API object, so it takes UpperCamelCase in prose, and the qualified compound "Ray pod" is out. The opening paragraph gained the node-to-Pod mapping outright, which the page wanted regardless: KubeRay runs each Ray node as a Kubernetes Pod, and each scheduler acts on a different half of that arrangement. That let me drop the later restatement under "The two layers." Two notes for reviewers:
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new user guide on scheduling, explaining how Kubernetes and Ray divide scheduling responsibilities, how KubeRay maps container resources to Ray's logical capacity, and how to troubleshoot pending workloads. Feedback on the documentation suggests clarifying that KubeRay reads resource limits specifically from the main Ray container (the first container in the list) and adding a <pod-name> placeholder to the kubectl describe pod command for better clarity.
andrewsykim
left a comment
There was a problem hiding this comment.
Overall LGTM, @rueian @machichima @win5923 PTAL
|
|
||
| (kuberay-scheduling)= | ||
|
|
||
| # Scheduling on Kubernetes |
There was a problem hiding this comment.
Somewhere in the intro we should just say a "Ray Node" is a Kubernetes Pod. I noticed that it's not immediately obvious for folks new to Ray / KubeRay
There was a problem hiding this comment.
Yup; same conclusion just came out of some parallel discussion I was having elsewhere. Will make sure this is emphasized here.
There was a problem hiding this comment.
Done in 983186c. The mapping now opens the page in its own paragraph instead of riding along inside the two-schedulers sentence, with the head/worker corollary and a note on why the page switches between "Pod" and "Ray node".
One deliberate difference from your wording: the page says a Ray node runs as a Pod rather than is one. The Pod is a logical host that can also hold the autoscaler sidecar, a Fluent Bit log shipper, or a RayJob submitter, so it's a superset of the Ray node rather than the same thing. Also fixed a table cell that had the identity phrasing.
That said, your comment prompted a wider look at the term "Ray Pod", which turns out not to hold up for the same reason, and whose casing is split four ways across 89 uses in this repo. #65423 retires it and adds this same mapping sentence to the KubeRay landing and getting-started pages, which is where it was missing. kuberay#5137 asks the same question on your side rather than assuming the call carries.
Reviewer feedback asked for the Ray node to Kubernetes Pod mapping stated explicitly in the intro, because it isn't obvious to readers new to Ray or KubeRay. The mapping was present but buried as a subordinate clause serving the two-schedulers point. It now opens the page in its own paragraph, with the head and worker corollary and a note on why this page switches between "Pod" and "Ray node". Also correct the resource table, which said a Ray node "is" a Pod. It runs as one. The Pod is a logical host that can also hold an autoscaler sidecar, a log shipper, or a job submitter, so the identity phrasing is the exact conflation this page is trying to clear up. Two review comments from the bot: - Name the main Ray container as the source of the limits KubeRay reads, and note that it must be first in the containers list. Verified against kuberay: RayContainerIndex is 0 and generateRayStartCommand receives pod.Spec.Containers[RayContainerIndex].Resources. Added that sidecar limits don't count, since that's the reason the detail matters. - Add a <pod-name> placeholder to the kubectl describe pod command. Signed-off-by: Douglas Strodtman <[email protected]>
|
|
||
| Override any of these with `rayStartParams`. See {ref}`rayStartParams` for the full list. The common override is `num-cpus: "0"` on the head group, which tells Ray the head Pod has no CPU capacity and so keeps CPU-requiring workloads off it. The head Pod still has real CPU from Kubernetes' point of view. You're only changing what Ray believes it can schedule there. | ||
|
|
||
| Check this seam first when the layers seem to disagree. A Pod that Kubernetes considers healthy and well-provisioned can still look full, or empty, to Ray. |
There was a problem hiding this comment.
Promote to a note at the top? Personally not sure what the 'seam' is ref'ing here, though.
There was a problem hiding this comment.
Fair on both counts, and "seam" was doing no work. Fixed in 4f98ddf: it now names what to check, which is the logical capacity KubeRay derived, and says why the layers can disagree about the same Pod.
I promoted it to a note in place rather than to the top of the page. The reason is that it's diagnostic rather than orientation, so at the top it would compete with the terminology paragraph Andrew just asked me to tighten, and it also reads better immediately after the three derivation rules it depends on. The admonition gives it the visual weight it was missing at the end of a body section. Happy to move it up if you still think it belongs there.
|
|
||
| The following table summarizes the split: | ||
|
|
||
| | | Kubernetes | Ray | |
There was a problem hiding this comment.
No heading seems weird? Maybe 'concept' or 'scheduling concept'
There was a problem hiding this comment.
Labeled it "Scheduling aspect" in 4f98ddf. I went with "aspect" over "concept" because the last row is a symptom rather than a concept, but the empty cell was the real problem and you were right to flag it.
| # Scheduling on Kubernetes | ||
|
|
||
| When you run Ray on Kubernetes, two schedulers are at work. KubeRay runs each Ray node as a Kubernetes Pod, and each scheduler acts on a different half of that arrangement. Kubernetes decides which machine each Pod runs on. Ray decides which Pod each task and actor runs on. Knowing which of the two is holding up your workload is the difference between a quick fix and an afternoon of guessing. | ||
| KubeRay runs each Ray node as a Kubernetes Pod. A Ray cluster's head node is its head Pod, and its worker nodes are its worker Pods. Elsewhere in Ray's documentation a node is just a node, because a Ray node can equally be a VM or a physical machine. On Kubernetes it's a Pod, so this page says "Pod" where the Kubernetes object is the point and "Ray node" where Ray's view of it is. |
There was a problem hiding this comment.
this feels a bit verbose, maybe simplify to:
KubeRay runs each Ray node (head or worker) as a Kubernetes Pod. While Ray nodes can generally be VMs or physical machines, this guide uses "Pod" when referring to the Kubernetes object and "Ray node" when referring to Ray's perspective.
There was a problem hiding this comment.
Taken verbatim in 4f98ddf. You were right that four sentences were doing the work of two, and the parenthetical carries the head/worker split more cleanly than the extra sentence I had.
…y note Three review comments: - Tighten the terminology paragraph to the reviewer's suggested wording. Four sentences did the work of two, and folding head and worker into a parenthetical keeps the mapping as the first thing on the page. - Label the resource table's first column. It had an empty header cell. - Replace "check this seam" with what the reader should actually check, which is the capacity KubeRay derived, and promote it to a note so it carries the weight its position at the end of a body section didn't. Signed-off-by: Douglas Strodtman <[email protected]>
Checked the page against doc/source/ray-contribute/writing-style.md, including the Kubernetes section proposed in ray-project#65239, and against Vale using that PR's KubeRay ruleset. - Replace bold-for-emphasis on "limits" and "requests" with backticks. The guide reserves bold for UI elements, admonition lead-ins, and definition lists. Both words name container spec fields, so backticks are also the more accurate marking. - Make two passive constructions active where the actor is nameable: "when you don't set a CPU limit" and "so Kubernetes can place those Pods." - Convert the two task headings from gerund to imperative, per the guide's heading rule. Neither is a cross-reference target. - Drop a mid-prose colon in the rule-of-thumb sentence. The guide reserves colons for introducing a list or a code block. - Replace the parenthetical in the opening with a comma aside. The guide says to restructure rather than use parentheticals, and Vale's Google.Parens fires on it. Vale on this file now reports only the known baseline for these paths: Vale.Spelling on "tolerations" and "autoscalers", and one Google.OxfordComma false positive on a two-item disjunction. Signed-off-by: Douglas Strodtman <[email protected]>
## Why this change Ray on Kubernetes docs use "Ray Pod" 89 times, and this PR removes the term. It's the concrete counterpart to the discussion in #65239, where a reviewer asked whether the Kubernetes casing rule should capitalize Pod in "Ray pod". Investigating that question produced a better answer than either casing. **A Pod isn't a Ray node, it's a host that contains one.** Kubernetes defines a Pod as an "application-specific logical host" holding one or more containers. KubeRay indexes exactly one Ray container per Pod through `utils.RayContainerIndex`, and routinely places non-Ray containers alongside it: the autoscaler sidecar, the history-server collector, the RayJob submitter in `SidecarMode`, and the Fluent Bit sidecars that `persist-kuberay-custom-resource-logs.md` documents. The Pod is a strict superset of the Ray node, so naming it after Ray overstates what it is. It's the same category error as "head node pod", one level up. **"Pod" is already taken in these docs, by something that isn't a Kubernetes object.** A TPU Pod is a group of interconnected TPU chips. `user-guides/tpu.md` writes "The name of the TPU Pod or slice" and "The TPU pod type" three lines apart, and `ray.util.tpu.get_current_pod_name()` is a public API whose docstring reads "Return the name of the TPU pod that the worker is a part of". Standardizing on a capitalized `Ray Pod` would put it beside a capitalized `TPU Pod` on the same pages, distinguished only by the preceding word. **The mapping is already documented.** `user-guides/k8s-autoscaler.md` says "each Ray node is run as a Kubernetes Pod", so two defined terms already cover what the compound names. **There was no convention to preserve.** Across the 55 prose lines using the term, casing split four ways: | Form | Occurrences | |---|---| | Ray Pods | 20 | | Ray pods | 16 | | Ray pod | 16 | | Ray Pod | 15 | Meanwhile "head Pod" and "worker Pod" already outnumber it 284 to 86 under `doc/source/cluster/kubernetes/`, so the replacement vocabulary is the one these docs mostly use. ## What changed 83 lines across 31 files. The term becomes "Pod" where context is unambiguous, which is most of them. Where a bare "Pod" would lose meaning I used an explicit form instead: - Headings, which have no surrounding context: "Check logs of the head and worker Pods", "Verify the Ray cluster's Pods and PodGroup", "Configuring Kubernetes Pods for TPU usage". - Pages where other kinds of Pod are in scope: "the Ray cluster's Pods" in `network-policy.md`, `prometheus-grafana.md`, `k8s-events.md`, and `scheduler-plugins.md`. - `rayservice-high-availability.md` listed "Ray Pod: This Pod sends requests to the RayService". That Pod is a client that isn't part of the RayCluster, and it's named `ray-pod` in the sample manifest, so it's now listed by its actual object name. ## What replaces it on the orientation pages Removing the compound takes away the handle a Ray-first reader was using for the node-and-Pod relationship, so the relationship now gets stated where readers form their mental model. It was only in `user-guides/k8s-autoscaler.md`, whose title begins "(Advanced)", and absent from `index.md`, `getting-started.md`, and `user-guides/config.md`. One sentence each on the two orientation pages: - `index.md`: "KubeRay runs each Ray node as a Kubernetes Pod, so each Ray cluster consists of a head Pod and a collection of worker Pods." - `getting-started.md`: "It runs each Ray node as a Kubernetes Pod, so a Ray cluster's head node is its head Pod and its worker nodes are its worker Pods." `getting-started/raycluster-quick-start.md` is the natural third location, since line 53 is where the two vocabularies genuinely first meet for a reader following the quickstart. It's left alone deliberately: that paragraph writes "pods" lowercase throughout, and adding a capitalized sentence into it would either read inconsistently or drag the casing sweep into this PR. It belongs to whoever runs that pass. The rules behind both changes are in #65239, which now carries a "State the node-to-Pod mapping once, early" section and a "Keep Pods out of Ray-general pages" section. The second one is why this PR touches `ray-core/scheduling/placement-group.rst` and `serve/production-guide/fault-tolerance.md`. ## What this deliberately doesn't touch - **`Ray head Pod` and `Ray worker Pod` stay.** Those qualify by role, which is the form these docs already prefer and the one Google's Ray on GKE docs use. Only the unqualified compound goes. - **No casing sweep.** Lowercase "head pod" occurrences are left alone. That's the Vale rule in #65239, not this PR. - **`python/` code comments and docstrings keep the term.** About 10 occurrences under `python/ray/autoscaler`, `python/ray/dashboard`, and the KubeRay tests identify which Pods the operator manages, which is reasonable for a code comment. This PR is scoped to documentation prose. - **The `kuberay` repo is out of scope.** Its authored prose has a handful of uses and its `docs/reference/api.md` is generated from Go doc comments. That's a maintainer call for that repo, and I'll raise it there separately rather than assume the same decision carries. ## Two fixes on lines this change already rewrites - `k8s-autoscaler.md` linked to `.../horizontal-Pod-autoscale/`, which returns **404**. The correct URL is all-lowercase and returns 200. An earlier Pod-casing sweep appears to have capitalized inside the URL. - `index.md` described a Ray cluster as "a head node pod and a collection of worker node pods", stacking both vocabularies in one phrase. Now "a head Pod and a collection of worker Pods". - `index.md` also wrote "heterogenous compute nodes" on that same line. Now "heterogeneous". ## One casing fix folded in `k8s-ecosystem/kai-scheduler.md` wrote "KAI scheduler deployment" in one place and "KAI Scheduler" everywhere else. The KubeRay Vale vocabulary proposed in #65239 surfaced it, and @win5923 confirmed the two-word title-case form on that PR. Folded in here rather than opened as a one-line PR, per the guidance in `AGENTS.md` about standalone trivial changes. The other hyphenated spellings in that file stay as they are. They sit inside links to `NVIDIA/KAI-Scheduler`, the Helm release name, and the `<KAI_SCHEDULER_VERSION>` placeholder, so none of them are prose. ## Testing ``` pre-commit run --files $(git diff --name-only) ``` Every hook reports "no files to check". Stating that plainly rather than implying coverage it doesn't give: no pre-commit hook applies to Markdown or reStructuredText under `doc/source/`, and the `vale` hook is scoped to `^doc/source/data/.*`, so none of these files are linted in CI today. What I verified by hand instead: - **No residual term.** `grep -rIniE '\bray [*_`]* ?pods?\b' .` over the whole repo returns only the `python/` code comments listed above as intentionally out of scope. This includes a markup-split case, "Ray \*\*Pod quantities\*\*", that a naive search misses. - **reStructuredText heading integrity.** `gpu.rst` has a section whose title shortened, so its underline was resized to match. Title and underline are both 30 characters. - **No broken anchors.** Four headings changed text. Searched for inbound references to their generated anchors and found none, and none carries an explicit MyST anchor. - **The URL fix.** `curl` returns 404 for the old casing and 200 for the new one. - **Config comments included.** `configs/static-ray-cluster.tls.yaml` carried the term in two YAML comments mirroring `config.md` prose, so the removal is complete rather than Markdown-only. Rendering is verified by the Read the Docs preview build on this PR. No code, no API, no behavior change. ## Not a duplicate ``` gh pr list --repo ray-project/ray --state open --search "Ray Pod" gh pr list --repo ray-project/ray --state open --search "pod terminology" ``` No open PR proposes this change. #65239 is the style-guide PR where the question came up and is the discussion surface for the rule; this PR is the cleanup and stands on its own against master. Two of my open PRs touch nearby files: #65287 rewrites lines in `jax-tpu-profiling.md`, which this PR doesn't touch, and #65263 is a draft adding `scheduling.md`, which introduces one new use of the term that I'll fix there rather than here. Per `AGENTS.md`, mechanical cleanups need maintainer coordination. That's the thread on #65239 with @win5923, who reviewed and approved the style-guide change and raised the question this PR answers. ## AI assistance Written with AI assistance (Claude). I've reviewed every changed line, generated and inspected the counts myself, and can defend the change end to end. --- ### Update: four casing defects folded in (f9fc8ea) Extending the KubeRay Vale vocabulary in #65239 turned four latent casing errors into alerts. They belong with the rest of the terminology cleanup rather than in a PR of their own. - `configuring-ippr.md`, two uses: "Kubelet" to "kubelet". Kubernetes writes the component lowercase in prose. - `rayservice-incremental-upgrade.md`: "Install istio" to "Install Istio" in a step label, where the word names the project. The lowercase `istio` elsewhere on that page is correct and stays, since it's a GatewayClass `metadata.name` and a `controllerName` value rather than the project name. - `resource-isolation-with-writable-cgroups.md`: the H1 read "Resource Isolation with Writable Cgroups on Google Kubernetes Engine (GKE)". Lowercasing only "Cgroups" would leave a title-case heading with one lowercase word, so the whole heading moves to sentence case, which the style guide requires anyway. **One coupling worth flagging for review.** The explicit MyST label above that H1 is unchanged, so every `{ref}` to the page still resolves, and the bare `{ref}` in `cluster/kubernetes/user-guides.md` picks up the new title automatically. But `ray-core/resource-isolation-with-cgroupv2.rst` passes custom link text that mirrored the old title case, so that text moves to sentence case too. That's the one file this PR touches outside `doc/source/cluster/kubernetes/`, and it's a one-line consistency fix caused directly by the heading change. Verified against the #65239 ruleset by diffing the alert set for these files before and after the change: the four alerts clear and no new alert appears. AI assistance was used for this commit and for that verification. ### Update: a bad replacement in this PR, plus three defects in the same files (89b0e49) **This PR had a bug.** The term replacement turned "KubeRay pods" into "KubePods" in `tpu.md`: the pattern matched "Ray pods" inside "KubeRay pods" and left the "Kube" prefix glued to the replacement. `git log -S` traces it to the retirement commit, so it isn't pre-existing. It's now "Pods", which is what the rule asks for when the qualifier only names the framework. I swept every added line in this PR for the same signature, a lowercase letter glued to "Pod" or "Pods", and this was the only instance. The other repo-wide matches are Kubernetes event reasons such as `CreatedHeadPod`, correct as literal strings. Three more defects, in files this PR already edits: - `tpu.md`: "GKE nodepool" to "GKE node pool" in prose. The `az aks nodepool` spelling elsewhere in the docs is a CLI subcommand and stays. - `prometheus-grafana.md`: "spawned by replicaset controller" to "spawned by a ReplicaSet controller", fixing the API object casing and a missing article. - `rayservice-incremental-upgrade.md`: "utilizing" to "using", "like" to "such as" for an example, and "(e.g. `istio`)" to "for example `istio`", plus the imperative in place of "You will need to". Verified against the #65239 ruleset with a column-independent diff of the alert set for these files: five alerts clear, no new finding. The two passive-voice alerts that change column position are pre-existing and unchanged in substance. **Deliberately not in this PR.** These sit in files this PR doesn't otherwise touch, so folding them in would widen its file scope for unrelated reasons: "Deepseek" for DeepSeek in `examples/rayserve-deepseek-example.md` (an H1) and `serve/llm/architecture/overview.md`; `gsutil` in `examples/distributed-checkpointing-with-gcsfuse.md`, where `gcloud storage` supersedes it and swapping a documented command needs someone who can verify the equivalent invocation; and "nodepool" in the prose of `user-guides/azure-aks-gpu-cluster.md`. AI assistance was used for this commit and for the verification above. ### Update: adopt the RayCluster possessive the style guide settled on (68041df) #65239 merged after this PR was written, and the rule it landed is more specific than the form used here. It says to use the resource name in the possessive: the operator creates these Pods, sets their `ownerReferences` to the RayCluster, and labels them `ray.io/cluster`, so ownership, selection, and lifecycle are facts about the resource rather than about the Ray cluster it produces. Its worked example is the exact sentence this PR introduced in six places: "List the RayCluster's Pods" above `kubectl get pods -l=ray.io/is-ray-node=yes`. All 16 possessives become "the RayCluster's Pods". Each turns on one of the three: - **Selection**, nine uses. Six step comments above label-filtered `kubectl` commands in `rayservice.md`, `rayservice-quick-start.md`, `configuring-autoscaling.md`, `label-based-scheduling.md`, and `rayservice-no-ray-serve-replica.md` (twice); the PodMonitor and the `kubectl wait -l ray.io/cluster=` in `prometheus-grafana.md`; and the `podSelector` in `network-policy.md`. - **Ownership**, four uses. The Pods the RayCluster owns and places in one PodGroup in `scheduler-plugins.md` (three), and the Pods KubeRay injects environment variables into in `k8s-events.md`. - **Membership**, three uses. Which Pods carry the proxy in `kuberay-serve-high-throughput.md`, and which Pods to `exec` into in `serve/production-guide/fault-tolerance.md` (twice). Non-possessive uses of "Ray cluster" are unchanged, since they name the running thing. Two of them the style guide now carries verbatim as its own `Use:` examples: "Each Ray cluster consists of a head Pod and a collection of worker Pods" on the landing page, and "a Ray cluster's head node is its head Pod" on the getting-started page. That's a check on the earlier commits rather than a change to them. One thing left alone. `config.md` reads "manages Pods in order to match the `RayCluster`'s spec", with the resource name in backticks. The backticks predate this PR and code-formatting the resource name is a separate question from the possessive, so it stays as it is. --------- Signed-off-by: Douglas Strodtman <[email protected]>
…ject#65263) ## Description Running Ray on Kubernetes involves two schedulers. Kubernetes places pods on machines, and Ray places tasks and actors on pods. The docs cover each layer well on its own, but nothing explains how they relate or which one to investigate when a workload doesn't start. The closest existing page is `k8s-autoscaler.md`, but it's scoped to autoscaling and marked advanced, so a user debugging a pending actor is unlikely to find it. This PR adds a user guide that: - Names the two layers and what each one places. - Documents how KubeRay derives Ray's logical resource capacity from the container spec, which is where the two layers most often disagree. - Maps pod state to the layer worth investigating. - Defers all mechanism to the existing Ray Core scheduling, RayCluster config, and autoscaler pages rather than restating them. It also adds a pointer to the new page from the autoscaler guide. The KubeRay resource-derivation details are drawn from `user-guides/config.md` (container limits, the CPU-request fallback as of KubeRay 1.3.0, integer rounding, and ignored memory and GPU requests). ## Related issues None. This came out of a documentation gap audit, not a filed issue. ## Additional information ### Not a duplicate Searched open PRs against `ray-project/ray` for "kubernetes scheduling", "scheduling overview", and related area keywords. No open PR covers this. No existing page in `doc/source` joins the two scheduling layers. ### Testing **Source verification against the KubeRay implementation.** Every claim about how KubeRay derives Ray's logical capacity was checked against `ray-operator/controllers/ray/common/pod.go` in `ray-project/kuberay`, not just against the existing docs: - `generateRayStartCommand` reads `resource.Limits[ResourceCPU]` for `num-cpus`, and falls back to `resource.Requests[ResourceCPU]` when the limit is zero. - The CPU-request fallback landed in kuberay commit `ba50bfa8` (ray-project#2365). It's absent from `v1.2.1` and present in `v1.3.0`, which confirms the "starting with KubeRay 1.3.0" attribution. - Integer rounding follows from `Quantity.Value()`, which rounds up away from zero, so a `500m` limit becomes one logical CPU. - Memory reads `Limits[ResourceMemory]` only, with no request fallback, and accelerators go through `addWellKnownAcceleratorResources(rayStartParams, resource.Limits)`. Both confirm that requests are ignored for memory and GPU. **Other checks:** - `vale doc/source/cluster/kubernetes/user-guides/scheduling.md` — remaining errors are `Vale.Spelling` on "tolerations" and "autoscalers" (standard terms used throughout the existing KubeRay docs, absent from the Vale vocabulary) and one `Google.OxfordComma` false positive on a two-item disjunction. The existing `k8s-autoscaler.md` reports a comparable baseline. - `pre-commit run` on the staged files — every hook reports "no files to check". No pre-commit hook currently covers Markdown under `doc/source/`. - Every `{ref}` target used on the page was verified to exist by grepping for its label definition. - **A full Sphinx docs build was not run locally.** Link resolution and toctree wiring rely on CI. Flagging this explicitly rather than implying broader verification than was performed. ### Self-review findings already fixed A critical pass before requesting review caught that the page claimed Ray integrates with four batch schedulers. There are five: the `kubernetes-sigs/scheduler-plugins` integration provides gang scheduling for RayCluster through the PodGroup API as of KubeRay v1.4.0. Corrected, with the fifth link added. ### AI assistance AI assistance was used to draft this page. The content is grounded in the repository sources cited above rather than generated from prior knowledge. It still needs a final human review pass before it should be considered ready, which is why this is opened as a draft. --- ### Update: review feedback addressed (983186c) No longer a draft, so the "final human review pass" caveat above is satisfied. @andrewsykim asked for the Ray node to Kubernetes Pod mapping stated in the intro, since it isn't obvious to readers new to Ray or KubeRay. It was present but buried as a subordinate clause. It now opens the page in its own paragraph, with the head and worker corollary and a note on why the page switches between "Pod" and "Ray node". The resource table also said a Ray node "is" a Pod; it runs as one, and the Pod is a superset that can hold the autoscaler sidecar, a log shipper, or a RayJob submitter. Both bot comments applied. One added a technical claim, verified the same way as the rest: - **The limits come from the main Ray container, which must be first in the `containers` list.** `utils.RayContainerIndex` is `0` in `ray-operator/controllers/ray/utils/constant.go`, and `BuildPod` passes `pod.Spec.Containers[utils.RayContainerIndex].Resources` into `generateRayStartCommand`. So limits set on a sidecar don't contribute to the Pod's logical capacity, which is the reason the detail is worth stating. - Added a `<pod-name>` placeholder to the `kubectl describe pod` command. `pre-commit run` again reports "no files to check" for every hook, consistent with the note above that nothing covers Markdown under `doc/source/`. Still no local Sphinx build. --------- Signed-off-by: Douglas Strodtman <[email protected]> Signed-off-by: 400Ping <[email protected]>
…t#65423) ## Why this change Ray on Kubernetes docs use "Ray Pod" 89 times, and this PR removes the term. It's the concrete counterpart to the discussion in ray-project#65239, where a reviewer asked whether the Kubernetes casing rule should capitalize Pod in "Ray pod". Investigating that question produced a better answer than either casing. **A Pod isn't a Ray node, it's a host that contains one.** Kubernetes defines a Pod as an "application-specific logical host" holding one or more containers. KubeRay indexes exactly one Ray container per Pod through `utils.RayContainerIndex`, and routinely places non-Ray containers alongside it: the autoscaler sidecar, the history-server collector, the RayJob submitter in `SidecarMode`, and the Fluent Bit sidecars that `persist-kuberay-custom-resource-logs.md` documents. The Pod is a strict superset of the Ray node, so naming it after Ray overstates what it is. It's the same category error as "head node pod", one level up. **"Pod" is already taken in these docs, by something that isn't a Kubernetes object.** A TPU Pod is a group of interconnected TPU chips. `user-guides/tpu.md` writes "The name of the TPU Pod or slice" and "The TPU pod type" three lines apart, and `ray.util.tpu.get_current_pod_name()` is a public API whose docstring reads "Return the name of the TPU pod that the worker is a part of". Standardizing on a capitalized `Ray Pod` would put it beside a capitalized `TPU Pod` on the same pages, distinguished only by the preceding word. **The mapping is already documented.** `user-guides/k8s-autoscaler.md` says "each Ray node is run as a Kubernetes Pod", so two defined terms already cover what the compound names. **There was no convention to preserve.** Across the 55 prose lines using the term, casing split four ways: | Form | Occurrences | |---|---| | Ray Pods | 20 | | Ray pods | 16 | | Ray pod | 16 | | Ray Pod | 15 | Meanwhile "head Pod" and "worker Pod" already outnumber it 284 to 86 under `doc/source/cluster/kubernetes/`, so the replacement vocabulary is the one these docs mostly use. ## What changed 83 lines across 31 files. The term becomes "Pod" where context is unambiguous, which is most of them. Where a bare "Pod" would lose meaning I used an explicit form instead: - Headings, which have no surrounding context: "Check logs of the head and worker Pods", "Verify the Ray cluster's Pods and PodGroup", "Configuring Kubernetes Pods for TPU usage". - Pages where other kinds of Pod are in scope: "the Ray cluster's Pods" in `network-policy.md`, `prometheus-grafana.md`, `k8s-events.md`, and `scheduler-plugins.md`. - `rayservice-high-availability.md` listed "Ray Pod: This Pod sends requests to the RayService". That Pod is a client that isn't part of the RayCluster, and it's named `ray-pod` in the sample manifest, so it's now listed by its actual object name. ## What replaces it on the orientation pages Removing the compound takes away the handle a Ray-first reader was using for the node-and-Pod relationship, so the relationship now gets stated where readers form their mental model. It was only in `user-guides/k8s-autoscaler.md`, whose title begins "(Advanced)", and absent from `index.md`, `getting-started.md`, and `user-guides/config.md`. One sentence each on the two orientation pages: - `index.md`: "KubeRay runs each Ray node as a Kubernetes Pod, so each Ray cluster consists of a head Pod and a collection of worker Pods." - `getting-started.md`: "It runs each Ray node as a Kubernetes Pod, so a Ray cluster's head node is its head Pod and its worker nodes are its worker Pods." `getting-started/raycluster-quick-start.md` is the natural third location, since line 53 is where the two vocabularies genuinely first meet for a reader following the quickstart. It's left alone deliberately: that paragraph writes "pods" lowercase throughout, and adding a capitalized sentence into it would either read inconsistently or drag the casing sweep into this PR. It belongs to whoever runs that pass. The rules behind both changes are in ray-project#65239, which now carries a "State the node-to-Pod mapping once, early" section and a "Keep Pods out of Ray-general pages" section. The second one is why this PR touches `ray-core/scheduling/placement-group.rst` and `serve/production-guide/fault-tolerance.md`. ## What this deliberately doesn't touch - **`Ray head Pod` and `Ray worker Pod` stay.** Those qualify by role, which is the form these docs already prefer and the one Google's Ray on GKE docs use. Only the unqualified compound goes. - **No casing sweep.** Lowercase "head pod" occurrences are left alone. That's the Vale rule in ray-project#65239, not this PR. - **`python/` code comments and docstrings keep the term.** About 10 occurrences under `python/ray/autoscaler`, `python/ray/dashboard`, and the KubeRay tests identify which Pods the operator manages, which is reasonable for a code comment. This PR is scoped to documentation prose. - **The `kuberay` repo is out of scope.** Its authored prose has a handful of uses and its `docs/reference/api.md` is generated from Go doc comments. That's a maintainer call for that repo, and I'll raise it there separately rather than assume the same decision carries. ## Two fixes on lines this change already rewrites - `k8s-autoscaler.md` linked to `.../horizontal-Pod-autoscale/`, which returns **404**. The correct URL is all-lowercase and returns 200. An earlier Pod-casing sweep appears to have capitalized inside the URL. - `index.md` described a Ray cluster as "a head node pod and a collection of worker node pods", stacking both vocabularies in one phrase. Now "a head Pod and a collection of worker Pods". - `index.md` also wrote "heterogenous compute nodes" on that same line. Now "heterogeneous". ## One casing fix folded in `k8s-ecosystem/kai-scheduler.md` wrote "KAI scheduler deployment" in one place and "KAI Scheduler" everywhere else. The KubeRay Vale vocabulary proposed in ray-project#65239 surfaced it, and @win5923 confirmed the two-word title-case form on that PR. Folded in here rather than opened as a one-line PR, per the guidance in `AGENTS.md` about standalone trivial changes. The other hyphenated spellings in that file stay as they are. They sit inside links to `NVIDIA/KAI-Scheduler`, the Helm release name, and the `<KAI_SCHEDULER_VERSION>` placeholder, so none of them are prose. ## Testing ``` pre-commit run --files $(git diff --name-only) ``` Every hook reports "no files to check". Stating that plainly rather than implying coverage it doesn't give: no pre-commit hook applies to Markdown or reStructuredText under `doc/source/`, and the `vale` hook is scoped to `^doc/source/data/.*`, so none of these files are linted in CI today. What I verified by hand instead: - **No residual term.** `grep -rIniE '\bray [*_`]* ?pods?\b' .` over the whole repo returns only the `python/` code comments listed above as intentionally out of scope. This includes a markup-split case, "Ray \*\*Pod quantities\*\*", that a naive search misses. - **reStructuredText heading integrity.** `gpu.rst` has a section whose title shortened, so its underline was resized to match. Title and underline are both 30 characters. - **No broken anchors.** Four headings changed text. Searched for inbound references to their generated anchors and found none, and none carries an explicit MyST anchor. - **The URL fix.** `curl` returns 404 for the old casing and 200 for the new one. - **Config comments included.** `configs/static-ray-cluster.tls.yaml` carried the term in two YAML comments mirroring `config.md` prose, so the removal is complete rather than Markdown-only. Rendering is verified by the Read the Docs preview build on this PR. No code, no API, no behavior change. ## Not a duplicate ``` gh pr list --repo ray-project/ray --state open --search "Ray Pod" gh pr list --repo ray-project/ray --state open --search "pod terminology" ``` No open PR proposes this change. ray-project#65239 is the style-guide PR where the question came up and is the discussion surface for the rule; this PR is the cleanup and stands on its own against master. Two of my open PRs touch nearby files: ray-project#65287 rewrites lines in `jax-tpu-profiling.md`, which this PR doesn't touch, and ray-project#65263 is a draft adding `scheduling.md`, which introduces one new use of the term that I'll fix there rather than here. Per `AGENTS.md`, mechanical cleanups need maintainer coordination. That's the thread on ray-project#65239 with @win5923, who reviewed and approved the style-guide change and raised the question this PR answers. ## AI assistance Written with AI assistance (Claude). I've reviewed every changed line, generated and inspected the counts myself, and can defend the change end to end. --- ### Update: four casing defects folded in (f9fc8ea) Extending the KubeRay Vale vocabulary in ray-project#65239 turned four latent casing errors into alerts. They belong with the rest of the terminology cleanup rather than in a PR of their own. - `configuring-ippr.md`, two uses: "Kubelet" to "kubelet". Kubernetes writes the component lowercase in prose. - `rayservice-incremental-upgrade.md`: "Install istio" to "Install Istio" in a step label, where the word names the project. The lowercase `istio` elsewhere on that page is correct and stays, since it's a GatewayClass `metadata.name` and a `controllerName` value rather than the project name. - `resource-isolation-with-writable-cgroups.md`: the H1 read "Resource Isolation with Writable Cgroups on Google Kubernetes Engine (GKE)". Lowercasing only "Cgroups" would leave a title-case heading with one lowercase word, so the whole heading moves to sentence case, which the style guide requires anyway. **One coupling worth flagging for review.** The explicit MyST label above that H1 is unchanged, so every `{ref}` to the page still resolves, and the bare `{ref}` in `cluster/kubernetes/user-guides.md` picks up the new title automatically. But `ray-core/resource-isolation-with-cgroupv2.rst` passes custom link text that mirrored the old title case, so that text moves to sentence case too. That's the one file this PR touches outside `doc/source/cluster/kubernetes/`, and it's a one-line consistency fix caused directly by the heading change. Verified against the ray-project#65239 ruleset by diffing the alert set for these files before and after the change: the four alerts clear and no new alert appears. AI assistance was used for this commit and for that verification. ### Update: a bad replacement in this PR, plus three defects in the same files (89b0e49) **This PR had a bug.** The term replacement turned "KubeRay pods" into "KubePods" in `tpu.md`: the pattern matched "Ray pods" inside "KubeRay pods" and left the "Kube" prefix glued to the replacement. `git log -S` traces it to the retirement commit, so it isn't pre-existing. It's now "Pods", which is what the rule asks for when the qualifier only names the framework. I swept every added line in this PR for the same signature, a lowercase letter glued to "Pod" or "Pods", and this was the only instance. The other repo-wide matches are Kubernetes event reasons such as `CreatedHeadPod`, correct as literal strings. Three more defects, in files this PR already edits: - `tpu.md`: "GKE nodepool" to "GKE node pool" in prose. The `az aks nodepool` spelling elsewhere in the docs is a CLI subcommand and stays. - `prometheus-grafana.md`: "spawned by replicaset controller" to "spawned by a ReplicaSet controller", fixing the API object casing and a missing article. - `rayservice-incremental-upgrade.md`: "utilizing" to "using", "like" to "such as" for an example, and "(e.g. `istio`)" to "for example `istio`", plus the imperative in place of "You will need to". Verified against the ray-project#65239 ruleset with a column-independent diff of the alert set for these files: five alerts clear, no new finding. The two passive-voice alerts that change column position are pre-existing and unchanged in substance. **Deliberately not in this PR.** These sit in files this PR doesn't otherwise touch, so folding them in would widen its file scope for unrelated reasons: "Deepseek" for DeepSeek in `examples/rayserve-deepseek-example.md` (an H1) and `serve/llm/architecture/overview.md`; `gsutil` in `examples/distributed-checkpointing-with-gcsfuse.md`, where `gcloud storage` supersedes it and swapping a documented command needs someone who can verify the equivalent invocation; and "nodepool" in the prose of `user-guides/azure-aks-gpu-cluster.md`. AI assistance was used for this commit and for the verification above. ### Update: adopt the RayCluster possessive the style guide settled on (68041df) ray-project#65239 merged after this PR was written, and the rule it landed is more specific than the form used here. It says to use the resource name in the possessive: the operator creates these Pods, sets their `ownerReferences` to the RayCluster, and labels them `ray.io/cluster`, so ownership, selection, and lifecycle are facts about the resource rather than about the Ray cluster it produces. Its worked example is the exact sentence this PR introduced in six places: "List the RayCluster's Pods" above `kubectl get pods -l=ray.io/is-ray-node=yes`. All 16 possessives become "the RayCluster's Pods". Each turns on one of the three: - **Selection**, nine uses. Six step comments above label-filtered `kubectl` commands in `rayservice.md`, `rayservice-quick-start.md`, `configuring-autoscaling.md`, `label-based-scheduling.md`, and `rayservice-no-ray-serve-replica.md` (twice); the PodMonitor and the `kubectl wait -l ray.io/cluster=` in `prometheus-grafana.md`; and the `podSelector` in `network-policy.md`. - **Ownership**, four uses. The Pods the RayCluster owns and places in one PodGroup in `scheduler-plugins.md` (three), and the Pods KubeRay injects environment variables into in `k8s-events.md`. - **Membership**, three uses. Which Pods carry the proxy in `kuberay-serve-high-throughput.md`, and which Pods to `exec` into in `serve/production-guide/fault-tolerance.md` (twice). Non-possessive uses of "Ray cluster" are unchanged, since they name the running thing. Two of them the style guide now carries verbatim as its own `Use:` examples: "Each Ray cluster consists of a head Pod and a collection of worker Pods" on the landing page, and "a Ray cluster's head node is its head Pod" on the getting-started page. That's a check on the earlier commits rather than a change to them. One thing left alone. `config.md` reads "manages Pods in order to match the `RayCluster`'s spec", with the resource name in backticks. The backticks predate this PR and code-formatting the resource name is a separate question from the possessive, so it stays as it is. --------- Signed-off-by: Douglas Strodtman <[email protected]> Signed-off-by: 400Ping <[email protected]>
…ject#65263) ## Description Running Ray on Kubernetes involves two schedulers. Kubernetes places pods on machines, and Ray places tasks and actors on pods. The docs cover each layer well on its own, but nothing explains how they relate or which one to investigate when a workload doesn't start. The closest existing page is `k8s-autoscaler.md`, but it's scoped to autoscaling and marked advanced, so a user debugging a pending actor is unlikely to find it. This PR adds a user guide that: - Names the two layers and what each one places. - Documents how KubeRay derives Ray's logical resource capacity from the container spec, which is where the two layers most often disagree. - Maps pod state to the layer worth investigating. - Defers all mechanism to the existing Ray Core scheduling, RayCluster config, and autoscaler pages rather than restating them. It also adds a pointer to the new page from the autoscaler guide. The KubeRay resource-derivation details are drawn from `user-guides/config.md` (container limits, the CPU-request fallback as of KubeRay 1.3.0, integer rounding, and ignored memory and GPU requests). ## Related issues None. This came out of a documentation gap audit, not a filed issue. ## Additional information ### Not a duplicate Searched open PRs against `ray-project/ray` for "kubernetes scheduling", "scheduling overview", and related area keywords. No open PR covers this. No existing page in `doc/source` joins the two scheduling layers. ### Testing **Source verification against the KubeRay implementation.** Every claim about how KubeRay derives Ray's logical capacity was checked against `ray-operator/controllers/ray/common/pod.go` in `ray-project/kuberay`, not just against the existing docs: - `generateRayStartCommand` reads `resource.Limits[ResourceCPU]` for `num-cpus`, and falls back to `resource.Requests[ResourceCPU]` when the limit is zero. - The CPU-request fallback landed in kuberay commit `ba50bfa8` (ray-project#2365). It's absent from `v1.2.1` and present in `v1.3.0`, which confirms the "starting with KubeRay 1.3.0" attribution. - Integer rounding follows from `Quantity.Value()`, which rounds up away from zero, so a `500m` limit becomes one logical CPU. - Memory reads `Limits[ResourceMemory]` only, with no request fallback, and accelerators go through `addWellKnownAcceleratorResources(rayStartParams, resource.Limits)`. Both confirm that requests are ignored for memory and GPU. **Other checks:** - `vale doc/source/cluster/kubernetes/user-guides/scheduling.md` — remaining errors are `Vale.Spelling` on "tolerations" and "autoscalers" (standard terms used throughout the existing KubeRay docs, absent from the Vale vocabulary) and one `Google.OxfordComma` false positive on a two-item disjunction. The existing `k8s-autoscaler.md` reports a comparable baseline. - `pre-commit run` on the staged files — every hook reports "no files to check". No pre-commit hook currently covers Markdown under `doc/source/`. - Every `{ref}` target used on the page was verified to exist by grepping for its label definition. - **A full Sphinx docs build was not run locally.** Link resolution and toctree wiring rely on CI. Flagging this explicitly rather than implying broader verification than was performed. ### Self-review findings already fixed A critical pass before requesting review caught that the page claimed Ray integrates with four batch schedulers. There are five: the `kubernetes-sigs/scheduler-plugins` integration provides gang scheduling for RayCluster through the PodGroup API as of KubeRay v1.4.0. Corrected, with the fifth link added. ### AI assistance AI assistance was used to draft this page. The content is grounded in the repository sources cited above rather than generated from prior knowledge. It still needs a final human review pass before it should be considered ready, which is why this is opened as a draft. --- ### Update: review feedback addressed (983186c) No longer a draft, so the "final human review pass" caveat above is satisfied. @andrewsykim asked for the Ray node to Kubernetes Pod mapping stated in the intro, since it isn't obvious to readers new to Ray or KubeRay. It was present but buried as a subordinate clause. It now opens the page in its own paragraph, with the head and worker corollary and a note on why the page switches between "Pod" and "Ray node". The resource table also said a Ray node "is" a Pod; it runs as one, and the Pod is a superset that can hold the autoscaler sidecar, a log shipper, or a RayJob submitter. Both bot comments applied. One added a technical claim, verified the same way as the rest: - **The limits come from the main Ray container, which must be first in the `containers` list.** `utils.RayContainerIndex` is `0` in `ray-operator/controllers/ray/utils/constant.go`, and `BuildPod` passes `pod.Spec.Containers[utils.RayContainerIndex].Resources` into `generateRayStartCommand`. So limits set on a sidecar don't contribute to the Pod's logical capacity, which is the reason the detail is worth stating. - Added a `<pod-name>` placeholder to the `kubectl describe pod` command. `pre-commit run` again reports "no files to check" for every hook, consistent with the note above that nothing covers Markdown under `doc/source/`. Still no local Sphinx build. --------- Signed-off-by: Douglas Strodtman <[email protected]>
…t#65423) ## Why this change Ray on Kubernetes docs use "Ray Pod" 89 times, and this PR removes the term. It's the concrete counterpart to the discussion in ray-project#65239, where a reviewer asked whether the Kubernetes casing rule should capitalize Pod in "Ray pod". Investigating that question produced a better answer than either casing. **A Pod isn't a Ray node, it's a host that contains one.** Kubernetes defines a Pod as an "application-specific logical host" holding one or more containers. KubeRay indexes exactly one Ray container per Pod through `utils.RayContainerIndex`, and routinely places non-Ray containers alongside it: the autoscaler sidecar, the history-server collector, the RayJob submitter in `SidecarMode`, and the Fluent Bit sidecars that `persist-kuberay-custom-resource-logs.md` documents. The Pod is a strict superset of the Ray node, so naming it after Ray overstates what it is. It's the same category error as "head node pod", one level up. **"Pod" is already taken in these docs, by something that isn't a Kubernetes object.** A TPU Pod is a group of interconnected TPU chips. `user-guides/tpu.md` writes "The name of the TPU Pod or slice" and "The TPU pod type" three lines apart, and `ray.util.tpu.get_current_pod_name()` is a public API whose docstring reads "Return the name of the TPU pod that the worker is a part of". Standardizing on a capitalized `Ray Pod` would put it beside a capitalized `TPU Pod` on the same pages, distinguished only by the preceding word. **The mapping is already documented.** `user-guides/k8s-autoscaler.md` says "each Ray node is run as a Kubernetes Pod", so two defined terms already cover what the compound names. **There was no convention to preserve.** Across the 55 prose lines using the term, casing split four ways: | Form | Occurrences | |---|---| | Ray Pods | 20 | | Ray pods | 16 | | Ray pod | 16 | | Ray Pod | 15 | Meanwhile "head Pod" and "worker Pod" already outnumber it 284 to 86 under `doc/source/cluster/kubernetes/`, so the replacement vocabulary is the one these docs mostly use. ## What changed 83 lines across 31 files. The term becomes "Pod" where context is unambiguous, which is most of them. Where a bare "Pod" would lose meaning I used an explicit form instead: - Headings, which have no surrounding context: "Check logs of the head and worker Pods", "Verify the Ray cluster's Pods and PodGroup", "Configuring Kubernetes Pods for TPU usage". - Pages where other kinds of Pod are in scope: "the Ray cluster's Pods" in `network-policy.md`, `prometheus-grafana.md`, `k8s-events.md`, and `scheduler-plugins.md`. - `rayservice-high-availability.md` listed "Ray Pod: This Pod sends requests to the RayService". That Pod is a client that isn't part of the RayCluster, and it's named `ray-pod` in the sample manifest, so it's now listed by its actual object name. ## What replaces it on the orientation pages Removing the compound takes away the handle a Ray-first reader was using for the node-and-Pod relationship, so the relationship now gets stated where readers form their mental model. It was only in `user-guides/k8s-autoscaler.md`, whose title begins "(Advanced)", and absent from `index.md`, `getting-started.md`, and `user-guides/config.md`. One sentence each on the two orientation pages: - `index.md`: "KubeRay runs each Ray node as a Kubernetes Pod, so each Ray cluster consists of a head Pod and a collection of worker Pods." - `getting-started.md`: "It runs each Ray node as a Kubernetes Pod, so a Ray cluster's head node is its head Pod and its worker nodes are its worker Pods." `getting-started/raycluster-quick-start.md` is the natural third location, since line 53 is where the two vocabularies genuinely first meet for a reader following the quickstart. It's left alone deliberately: that paragraph writes "pods" lowercase throughout, and adding a capitalized sentence into it would either read inconsistently or drag the casing sweep into this PR. It belongs to whoever runs that pass. The rules behind both changes are in ray-project#65239, which now carries a "State the node-to-Pod mapping once, early" section and a "Keep Pods out of Ray-general pages" section. The second one is why this PR touches `ray-core/scheduling/placement-group.rst` and `serve/production-guide/fault-tolerance.md`. ## What this deliberately doesn't touch - **`Ray head Pod` and `Ray worker Pod` stay.** Those qualify by role, which is the form these docs already prefer and the one Google's Ray on GKE docs use. Only the unqualified compound goes. - **No casing sweep.** Lowercase "head pod" occurrences are left alone. That's the Vale rule in ray-project#65239, not this PR. - **`python/` code comments and docstrings keep the term.** About 10 occurrences under `python/ray/autoscaler`, `python/ray/dashboard`, and the KubeRay tests identify which Pods the operator manages, which is reasonable for a code comment. This PR is scoped to documentation prose. - **The `kuberay` repo is out of scope.** Its authored prose has a handful of uses and its `docs/reference/api.md` is generated from Go doc comments. That's a maintainer call for that repo, and I'll raise it there separately rather than assume the same decision carries. ## Two fixes on lines this change already rewrites - `k8s-autoscaler.md` linked to `.../horizontal-Pod-autoscale/`, which returns **404**. The correct URL is all-lowercase and returns 200. An earlier Pod-casing sweep appears to have capitalized inside the URL. - `index.md` described a Ray cluster as "a head node pod and a collection of worker node pods", stacking both vocabularies in one phrase. Now "a head Pod and a collection of worker Pods". - `index.md` also wrote "heterogenous compute nodes" on that same line. Now "heterogeneous". ## One casing fix folded in `k8s-ecosystem/kai-scheduler.md` wrote "KAI scheduler deployment" in one place and "KAI Scheduler" everywhere else. The KubeRay Vale vocabulary proposed in ray-project#65239 surfaced it, and @win5923 confirmed the two-word title-case form on that PR. Folded in here rather than opened as a one-line PR, per the guidance in `AGENTS.md` about standalone trivial changes. The other hyphenated spellings in that file stay as they are. They sit inside links to `NVIDIA/KAI-Scheduler`, the Helm release name, and the `<KAI_SCHEDULER_VERSION>` placeholder, so none of them are prose. ## Testing ``` pre-commit run --files $(git diff --name-only) ``` Every hook reports "no files to check". Stating that plainly rather than implying coverage it doesn't give: no pre-commit hook applies to Markdown or reStructuredText under `doc/source/`, and the `vale` hook is scoped to `^doc/source/data/.*`, so none of these files are linted in CI today. What I verified by hand instead: - **No residual term.** `grep -rIniE '\bray [*_`]* ?pods?\b' .` over the whole repo returns only the `python/` code comments listed above as intentionally out of scope. This includes a markup-split case, "Ray \*\*Pod quantities\*\*", that a naive search misses. - **reStructuredText heading integrity.** `gpu.rst` has a section whose title shortened, so its underline was resized to match. Title and underline are both 30 characters. - **No broken anchors.** Four headings changed text. Searched for inbound references to their generated anchors and found none, and none carries an explicit MyST anchor. - **The URL fix.** `curl` returns 404 for the old casing and 200 for the new one. - **Config comments included.** `configs/static-ray-cluster.tls.yaml` carried the term in two YAML comments mirroring `config.md` prose, so the removal is complete rather than Markdown-only. Rendering is verified by the Read the Docs preview build on this PR. No code, no API, no behavior change. ## Not a duplicate ``` gh pr list --repo ray-project/ray --state open --search "Ray Pod" gh pr list --repo ray-project/ray --state open --search "pod terminology" ``` No open PR proposes this change. ray-project#65239 is the style-guide PR where the question came up and is the discussion surface for the rule; this PR is the cleanup and stands on its own against master. Two of my open PRs touch nearby files: ray-project#65287 rewrites lines in `jax-tpu-profiling.md`, which this PR doesn't touch, and ray-project#65263 is a draft adding `scheduling.md`, which introduces one new use of the term that I'll fix there rather than here. Per `AGENTS.md`, mechanical cleanups need maintainer coordination. That's the thread on ray-project#65239 with @win5923, who reviewed and approved the style-guide change and raised the question this PR answers. ## AI assistance Written with AI assistance (Claude). I've reviewed every changed line, generated and inspected the counts myself, and can defend the change end to end. --- ### Update: four casing defects folded in (f9fc8ea) Extending the KubeRay Vale vocabulary in ray-project#65239 turned four latent casing errors into alerts. They belong with the rest of the terminology cleanup rather than in a PR of their own. - `configuring-ippr.md`, two uses: "Kubelet" to "kubelet". Kubernetes writes the component lowercase in prose. - `rayservice-incremental-upgrade.md`: "Install istio" to "Install Istio" in a step label, where the word names the project. The lowercase `istio` elsewhere on that page is correct and stays, since it's a GatewayClass `metadata.name` and a `controllerName` value rather than the project name. - `resource-isolation-with-writable-cgroups.md`: the H1 read "Resource Isolation with Writable Cgroups on Google Kubernetes Engine (GKE)". Lowercasing only "Cgroups" would leave a title-case heading with one lowercase word, so the whole heading moves to sentence case, which the style guide requires anyway. **One coupling worth flagging for review.** The explicit MyST label above that H1 is unchanged, so every `{ref}` to the page still resolves, and the bare `{ref}` in `cluster/kubernetes/user-guides.md` picks up the new title automatically. But `ray-core/resource-isolation-with-cgroupv2.rst` passes custom link text that mirrored the old title case, so that text moves to sentence case too. That's the one file this PR touches outside `doc/source/cluster/kubernetes/`, and it's a one-line consistency fix caused directly by the heading change. Verified against the ray-project#65239 ruleset by diffing the alert set for these files before and after the change: the four alerts clear and no new alert appears. AI assistance was used for this commit and for that verification. ### Update: a bad replacement in this PR, plus three defects in the same files (89b0e49) **This PR had a bug.** The term replacement turned "KubeRay pods" into "KubePods" in `tpu.md`: the pattern matched "Ray pods" inside "KubeRay pods" and left the "Kube" prefix glued to the replacement. `git log -S` traces it to the retirement commit, so it isn't pre-existing. It's now "Pods", which is what the rule asks for when the qualifier only names the framework. I swept every added line in this PR for the same signature, a lowercase letter glued to "Pod" or "Pods", and this was the only instance. The other repo-wide matches are Kubernetes event reasons such as `CreatedHeadPod`, correct as literal strings. Three more defects, in files this PR already edits: - `tpu.md`: "GKE nodepool" to "GKE node pool" in prose. The `az aks nodepool` spelling elsewhere in the docs is a CLI subcommand and stays. - `prometheus-grafana.md`: "spawned by replicaset controller" to "spawned by a ReplicaSet controller", fixing the API object casing and a missing article. - `rayservice-incremental-upgrade.md`: "utilizing" to "using", "like" to "such as" for an example, and "(e.g. `istio`)" to "for example `istio`", plus the imperative in place of "You will need to". Verified against the ray-project#65239 ruleset with a column-independent diff of the alert set for these files: five alerts clear, no new finding. The two passive-voice alerts that change column position are pre-existing and unchanged in substance. **Deliberately not in this PR.** These sit in files this PR doesn't otherwise touch, so folding them in would widen its file scope for unrelated reasons: "Deepseek" for DeepSeek in `examples/rayserve-deepseek-example.md` (an H1) and `serve/llm/architecture/overview.md`; `gsutil` in `examples/distributed-checkpointing-with-gcsfuse.md`, where `gcloud storage` supersedes it and swapping a documented command needs someone who can verify the equivalent invocation; and "nodepool" in the prose of `user-guides/azure-aks-gpu-cluster.md`. AI assistance was used for this commit and for the verification above. ### Update: adopt the RayCluster possessive the style guide settled on (68041df) ray-project#65239 merged after this PR was written, and the rule it landed is more specific than the form used here. It says to use the resource name in the possessive: the operator creates these Pods, sets their `ownerReferences` to the RayCluster, and labels them `ray.io/cluster`, so ownership, selection, and lifecycle are facts about the resource rather than about the Ray cluster it produces. Its worked example is the exact sentence this PR introduced in six places: "List the RayCluster's Pods" above `kubectl get pods -l=ray.io/is-ray-node=yes`. All 16 possessives become "the RayCluster's Pods". Each turns on one of the three: - **Selection**, nine uses. Six step comments above label-filtered `kubectl` commands in `rayservice.md`, `rayservice-quick-start.md`, `configuring-autoscaling.md`, `label-based-scheduling.md`, and `rayservice-no-ray-serve-replica.md` (twice); the PodMonitor and the `kubectl wait -l ray.io/cluster=` in `prometheus-grafana.md`; and the `podSelector` in `network-policy.md`. - **Ownership**, four uses. The Pods the RayCluster owns and places in one PodGroup in `scheduler-plugins.md` (three), and the Pods KubeRay injects environment variables into in `k8s-events.md`. - **Membership**, three uses. Which Pods carry the proxy in `kuberay-serve-high-throughput.md`, and which Pods to `exec` into in `serve/production-guide/fault-tolerance.md` (twice). Non-possessive uses of "Ray cluster" are unchanged, since they name the running thing. Two of them the style guide now carries verbatim as its own `Use:` examples: "Each Ray cluster consists of a head Pod and a collection of worker Pods" on the landing page, and "a Ray cluster's head node is its head Pod" on the getting-started page. That's a check on the earlier commits rather than a change to them. One thing left alone. `config.md` reads "manages Pods in order to match the `RayCluster`'s spec", with the resource name in backticks. The backticks predate this PR and code-formatting the resource name is a separate question from the possessive, so it stays as it is. --------- Signed-off-by: Douglas Strodtman <[email protected]>
Description
Running Ray on Kubernetes involves two schedulers. Kubernetes places pods on machines, and Ray places tasks and actors on pods. The docs cover each layer well on its own, but nothing explains how they relate or which one to investigate when a workload doesn't start.
The closest existing page is
k8s-autoscaler.md, but it's scoped to autoscaling and marked advanced, so a user debugging a pending actor is unlikely to find it.This PR adds a user guide that:
It also adds a pointer to the new page from the autoscaler guide.
The KubeRay resource-derivation details are drawn from
user-guides/config.md(container limits, the CPU-request fallback as of KubeRay 1.3.0, integer rounding, and ignored memory and GPU requests).Related issues
None. This came out of a documentation gap audit, not a filed issue.
Additional information
Not a duplicate
Searched open PRs against
ray-project/rayfor "kubernetes scheduling", "scheduling overview", and related area keywords. No open PR covers this. No existing page indoc/sourcejoins the two scheduling layers.Testing
Source verification against the KubeRay implementation. Every claim about how KubeRay derives Ray's logical capacity was checked against
ray-operator/controllers/ray/common/pod.goinray-project/kuberay, not just against the existing docs:generateRayStartCommandreadsresource.Limits[ResourceCPU]fornum-cpus, and falls back toresource.Requests[ResourceCPU]when the limit is zero.ba50bfa8(Add 0.5 release notes. #2365). It's absent fromv1.2.1and present inv1.3.0, which confirms the "starting with KubeRay 1.3.0" attribution.Quantity.Value(), which rounds up away from zero, so a500mlimit becomes one logical CPU.Limits[ResourceMemory]only, with no request fallback, and accelerators go throughaddWellKnownAcceleratorResources(rayStartParams, resource.Limits). Both confirm that requests are ignored for memory and GPU.Other checks:
vale doc/source/cluster/kubernetes/user-guides/scheduling.md— remaining errors areVale.Spellingon "tolerations" and "autoscalers" (standard terms used throughout the existing KubeRay docs, absent from the Vale vocabulary) and oneGoogle.OxfordCommafalse positive on a two-item disjunction. The existingk8s-autoscaler.mdreports a comparable baseline.pre-commit runon the staged files — every hook reports "no files to check". No pre-commit hook currently covers Markdown underdoc/source/.{ref}target used on the page was verified to exist by grepping for its label definition.Self-review findings already fixed
A critical pass before requesting review caught that the page claimed Ray integrates with four batch schedulers. There are five: the
kubernetes-sigs/scheduler-pluginsintegration provides gang scheduling for RayCluster through the PodGroup API as of KubeRay v1.4.0. Corrected, with the fifth link added.AI assistance
AI assistance was used to draft this page. The content is grounded in the repository sources cited above rather than generated from prior knowledge. It still needs a final human review pass before it should be considered ready, which is why this is opened as a draft.
Update: review feedback addressed (983186c)
No longer a draft, so the "final human review pass" caveat above is satisfied.
@andrewsykim asked for the Ray node to Kubernetes Pod mapping stated in the intro, since it isn't obvious to readers new to Ray or KubeRay. It was present but buried as a subordinate clause. It now opens the page in its own paragraph, with the head and worker corollary and a note on why the page switches between "Pod" and "Ray node". The resource table also said a Ray node "is" a Pod; it runs as one, and the Pod is a superset that can hold the autoscaler sidecar, a log shipper, or a RayJob submitter.
Both bot comments applied. One added a technical claim, verified the same way as the rest:
containerslist.utils.RayContainerIndexis0inray-operator/controllers/ray/utils/constant.go, andBuildPodpassespod.Spec.Containers[utils.RayContainerIndex].ResourcesintogenerateRayStartCommand. So limits set on a sidecar don't contribute to the Pod's logical capacity, which is the reason the detail is worth stating.<pod-name>placeholder to thekubectl describe podcommand.pre-commit runagain reports "no files to check" for every hook, consistent with the note above that nothing covers Markdown underdoc/source/. Still no local Sphinx build.