Repository navigation
[Doc] KubeRay SidecarSubmitterRestart User Guide - #64303
andrewsykim merged 9 commits into
Conversation
Signed-off-by: justinyeh1995 <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates the rayjob-quick-start.md documentation to detail the new SidecarSubmitterRestart feature gate, which allows the submitter container to restart on transient failures. The review feedback highlights two critical inaccuracies in the added documentation: first, Kubernetes native sidecar containers only support Always as a container-level restartPolicy rather than OnFailure; second, the specified version requirements (Kubernetes v1.35+ and Ray v2.54.0+) are incorrect and appear to be typos.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| * `submitterConfig` (Optional): Additional configurations for the submitter. Used in `K8sJobMode` and `SidecarMode` when `SidecarSubmitterRestart` is enabled. | ||
| * `backoffLimit` (Optional, added in version 1.2.0): The number of retries before marking the submitter as failed. The default value is 2. | ||
| * `SidecarSubmitterRestart` (alpha in v1.7): This feature gate (disabled by default), when set, allows the submitter container to restart on transient submitter failures. | ||
| * The submitter container's `restartPolicy` is set to `OnFailure` at the container level. It is independent of the head Pod's pod-level `RestartPolicy: Never`, so a non-zero exit restarts only the submitter container in place without touching the `ray-head` container. Note that a failure of the Ray job's own code does not make the submitter exit non-zero, so it won't trigger a restart by itself. |
There was a problem hiding this comment.
In Kubernetes, native sidecar containers (configured as initContainers with a container-level restartPolicy under the ContainerRestartRules feature) only support Always as the valid value for restartPolicy. There is no native OnFailure container-level restart policy in the Kubernetes Pod specification.
Could you clarify if KubeRay is setting Always under the hood and managing the exit behavior, or if there is a custom controller mechanism? If it actually uses Always, the documentation should be updated to reflect that, as setting OnFailure at the container level is not supported by the Kubernetes API.
There was a problem hiding this comment.
ContainerRestartRules is a stable feature for configuring restart policy for containers in K8s v1.35+, and OnFailure is a valid value there.
| * Requires Kubernetes v1.35+ (`ContainerRestartRules` supported by default) and Ray v2.54.0+. | ||
| * The KubeRay operator only validates the API server version. Per the Kubernetes version skew policy, worker node kubelets can be up to 3 minor versions older, so make sure the node running the Ray head Pod is also on v1.35+. If that kubelet doesn't support `ContainerRestartRules`, the per-container restart policy is silently ignored, and the operator's default 30-second submitter-finished timeout can mark the RayJob `Failed` even though the Ray job is still running. |
There was a problem hiding this comment.
The version requirements mentioned here seem to contain typos:
- Kubernetes v1.35+: Kubernetes v1.35 does not exist yet (v1.32 is the latest release as of late 2024/early 2025). The
ContainerRestartRulesfeature (sidecar containers) was introduced in v1.28 and enabled by default in v1.29. This should likely be corrected tov1.29+(orv1.28+). - Ray v2.54.0+: Ray v2.54.0 does not exist yet (current versions are in the v2.30s/v2.40s). Please verify and correct this to the actual Ray version that introduced or supports this feature (e.g.,
v2.35.0+or similar).
There was a problem hiding this comment.
K8s version is already v1.36. Ray is also v2.55
| * `HTTPMode`: The KubeRay operator sends a request to the RayCluster to create a Ray job. | ||
| * `InteractiveMode`: The KubeRay operator waits for the user to submit a job to the RayCluster. This mode is currently in alpha and the [KubeRay kubectl plugin](kubectl-plugin) relies on it. | ||
| * `SidecarMode`: The KubeRay operator injects a container into the Ray head Pod to submit the Ray job. This mode does not support `clusterSelector`, `submitterPodTemplate`, and `submitterConfig`, and requires the head Pod's restart policy to be `Never`. | ||
| * `SidecarMode`: The KubeRay operator injects a container into the Ray head Pod to submit the Ray job. This mode does not support `clusterSelector`, `submitterPodTemplate`, and requires the head Pod's restart policy to be `Never`. When the `SidecarSubmitterRestart` feature gate is enabled, `submitterConfig.backoffLimit` is used to cap the submitter sidecar's restart count. |
There was a problem hiding this comment.
can you also mention the required
- kubernetes version
- kuberay version
Signed-off-by: justinyeh1995 <[email protected]>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the rayjob-quick-start.md documentation to introduce the new SidecarSubmitterRestart feature gate, which allows the submitter container to restart on transient failures in SidecarMode. The review feedback focuses on improving the clarity, grammatical correctness, and professionalism of the documentation. Key suggestions include correcting list structures, clarifying configuration usage, using consistent casing for Kubernetes API fields, and refining the phrasing for better technical accuracy.
Signed-off-by: justinyeh1995 <[email protected]>
Signed-off-by: justinyeh1995 <[email protected]>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds documentation for the new SidecarSubmitterRestart feature gate in RayJob, including a detailed user guide with step-by-step verification instructions. The review feedback suggests improving the prerequisites list formatting for clarity and correcting the Helm chart version parameter in the installation command to avoid errors.
| * This feature requires Kubernetes v1.35+. | ||
| * KubeRay v1.7.0 or higher: Ray v2.54.0 or higher. |
There was a problem hiding this comment.
The current nesting makes KubeRay and Ray appear as sub-requirements of Kubernetes v1.35+, which is semantically incorrect as they are independent prerequisites. Additionally, using a colon : between KubeRay and Ray is a bit unclear. It would be cleaner and more accurate to list them as separate, flat bullet points.
| * This feature requires Kubernetes v1.35+. | |
| * KubeRay v1.7.0 or higher: Ray v2.54.0 or higher. | |
| * This feature requires Kubernetes v1.35+. | |
| * KubeRay v1.7.0 or higher. | |
| * Ray v2.54.0 or higher. |
| ### Step 2: Install the KubeRay operator with `SidecarSubmitterRestart` enabled | ||
|
|
||
| ```sh | ||
| helm upgrade --install kuberay-operator kuberay/kuberay-operator --version v1.7.0 \ |
There was a problem hiding this comment.
The Helm chart version for KubeRay does not use the v prefix (e.g., it is 1.7.0 instead of v1.7.0). Specifying --version v1.7.0 will cause the helm upgrade command to fail with a "chart not found" error.
| helm upgrade --install kuberay-operator kuberay/kuberay-operator --version v1.7.0 \ | |
| helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \ |
Signed-off-by: justinyeh1995 <[email protected]>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces documentation and a new user guide for the SidecarSubmitterRestart feature gate in KubeRay, which enables the submitter container to restart on transient failures without failing the RayJob. The review feedback suggests two improvements to the new user guide: using a higher index when setting the feature gate via Helm to prevent overwriting default feature gates, and utilizing a more targeted JSONPath expression to query the restart count of the submitter container.
| helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \ | ||
| --set "featureGates[0].name=SidecarSubmitterRestart" \ | ||
| --set "featureGates[0].enabled=true" |
There was a problem hiding this comment.
Using index 0 for featureGates will overwrite the default feature gate at index 0 (which is RayClusterStatusConditions, enabled by default). To avoid disabling default feature gates, it is safer to append the new feature gate at the next available index (index 5 in KubeRay v1.7.0).
| helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \ | |
| --set "featureGates[0].name=SidecarSubmitterRestart" \ | |
| --set "featureGates[0].enabled=true" | |
| helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \ | |
| --set "featureGates[5].name=SidecarSubmitterRestart" \ | |
| --set "featureGates[5].enabled=true" |
There was a problem hiding this comment.
I think setting it to 0 is correct.
the values.yaml in helm repo defines 5 feature gates and 3 of them are turned on by default.
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \
--set "featureGates[0].name=SidecarSubmitterRestart" \
--set "featureGates[0].enabled=true"replace it with only SidecarSubmitterRestart set to true. This is fine because in features.go. The three of the turned on feature gates are mark as on here as well, so the operator will fall back to use it.
On the other hand, the suggestion of using
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \
--set "featureGates[5].name=SidecarSubmitterRestart" \
--set "featureGates[5].enabled=true"will break the installation.
| kubectl get pod $HEAD_POD \ | ||
| -o jsonpath='{range .status.containerStatuses[*]}{.name}{" restartCount="}{.restartCount}{"\n"}{end}' |
There was a problem hiding this comment.
Instead of printing the restart counts of all containers in the pod, you can target the ray-job-submitter container directly using a filtered JSONPath expression. This makes the output cleaner and easier to verify.
| kubectl get pod $HEAD_POD \ | |
| -o jsonpath='{range .status.containerStatuses[*]}{.name}{" restartCount="}{.restartCount}{"\n"}{end}' | |
| kubectl get pod $HEAD_POD \ | |
| -o jsonpath='{.status.containerStatuses[?(@.name=="ray-job-submitter")].restartCount}{"\n"}' |
There was a problem hiding this comment.
kubectl get pod $HEAD_POD \
-o jsonpath='{range .status.containerStatuses[*]}{.name}{" restartCount="}{.restartCount}{"\n"}{end}'
# ray-head restartCount=0
# ray-job-submitter restartCount=1I would like the user to see ray-head is not restarted as well.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation to introduce and explain the new SidecarSubmitterRestart feature gate (alpha in KubeRay v1.7). It updates the RayJob quickstart guide to detail how this feature allows the submitter container to restart on transient failures without restarting the head container. Additionally, it adds a new user guide with step-by-step instructions to enable and verify this feature on a local Kubernetes cluster using kind. There are no review comments, so no feedback is provided.
Signed-off-by: Justin Yeh <[email protected]>
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
comment to unstale it |
dstrodtman
left a comment
There was a problem hiding this comment.
I'm unfamiliar with this tech; we'll need review and approval from a technical SME before I do a docs edit pass. Please ping me once you get that.
Will do just that! Hi @Future-Outlier, would love to get another round of review when you have the time. Thanks. |
| * KubeRay v1.7.0 or higher. | ||
| * Ray v2.54.0 or higher. | ||
|
|
||
| ## Behavior and caveats |
There was a problem hiding this comment.
I'm sure this was mentioned in the original user guide for sidecar mode, but we should also highlight the benefits and reasons to use sidecar mode here as well
| The submitter container should restart and reattach to the log stream. The RayJob should remain `Running`: | ||
|
|
||
| ```sh | ||
| # restartCount for ray-job-submitter should increment to 1 |
There was a problem hiding this comment.
should also mention ray-head container should remain at 0
There was a problem hiding this comment.
Done in fbcb0d5. Thank you for the review!
Signed-off-by: Justin Yeh <[email protected]>
|
Also, I modified the heredoc in Step 3 and clarified how submitterConfig behaves in SidecarMode. The memory limit for ray-head changed to 5Gi as 2Gi OOMed when I ran it. |
|
Hi @dstrodtman, the changes had been reviewed by Andrew. Would love to get your review once you get the time. Thank you. |
Signed-off-by: JustinYeh <[email protected]>
## Description This PR documents the usage and limitation of the feature gate `SidecarSubmitterRestart`. ## Related issues KubeRay [ray-project#4285](kuberay-project/kuberay#4285) ## Additional information Preview links can be reviewed at [RayJob Quick Start Submission configuration](https://anyscale-ray--64303.com.readthedocs.build/en/64303/cluster/kubernetes/getting-started/rayjob-quick-start.html#rayjob-configuration) & [A more detailed user guide](https://anyscale-ray--64303.com.readthedocs.build/en/64303/cluster/kubernetes/user-guides/rayjob-sidecar-submitter-restart.html#kuberay-rayjob-sidecar-submitter-restart) --------- Signed-off-by: justinyeh1995 <[email protected]> Signed-off-by: Justin Yeh <[email protected]> Signed-off-by: JustinYeh <[email protected]>
## Description This PR documents the usage and limitation of the feature gate `SidecarSubmitterRestart`. ## Related issues KubeRay [ray-project#4285](kuberay-project/kuberay#4285) ## Additional information Preview links can be reviewed at [RayJob Quick Start Submission configuration](https://anyscale-ray--64303.com.readthedocs.build/en/64303/cluster/kubernetes/getting-started/rayjob-quick-start.html#rayjob-configuration) & [A more detailed user guide](https://anyscale-ray--64303.com.readthedocs.build/en/64303/cluster/kubernetes/user-guides/rayjob-sidecar-submitter-restart.html#kuberay-rayjob-sidecar-submitter-restart) --------- Signed-off-by: justinyeh1995 <[email protected]> Signed-off-by: Justin Yeh <[email protected]> Signed-off-by: JustinYeh <[email protected]> Signed-off-by: 400Ping <[email protected]>
## Why The [KubeRay v1.7 blog](https://www.anyscale.com/blog/kuberay-v1-7) highlights several features whose docs currently live only on `master`. The corresponding pages are missing (404) or incomplete on the `latest` (2.58.0) docs build, and several blog links point at `/master` as a result. This backports the doc pages so the 2.58.0 `latest` docs cover the released KubeRay v1.7 surface. ## What (cherry-picks onto `releases/2.58.0`) | Commit | Blog feature | Gap on `latest` | |---|---|---| | #64303 | RayJob `SidecarMode` retry | new page was missing | | #65249 | RayService incremental upgrade rollback (beta) | `#rollback` section missing | | #65074 | NetworkPolicy support (alpha) | new page was missing | | #65429 | Embedded RocksDB GCS backend | example version pin missing | | #65513 | Fix docs for KubeRay v1.7 | wrong NetworkPolicy field names + incorrect `kubernetes` pip guidance | | #65483 | Customizable Ingress options | `ingressOptions` undocumented | Each commit is applied with `cherry-pick -x` (provenance preserved) and DCO sign-off. ## Not duplicating - No open PR cherry-picks these into `releases/2.58.0` (checked by PR number and by `--base releases/2.58.0`). - The two History Server refinements (#65441, #65505) are intentionally **excluded** — they already landed on `releases/2.58.0` (`c6061c10b97`, `d8277b53b0d`) and that page is already identical to `master`. - Broad, non-feature changes touching these files on `master` (llms.txt page descriptions #65115, the "Ray Pod" terminology rename #65423, the vendored CRD API reference #65428) are deliberately left out to keep this a tight, low-risk release-branch backport. ## Testing - Verified every new/changed page's `{ref}`/`{doc}` cross-reference target resolves on this branch (`fail_on_warning: true` build safety). - Verified both new toctree entries (`network-policy`, `rayjob-sidecar-submitter-restart`) point at files that exist on the branch. - Confirmed each touched file matches `master` except for the intentionally-excluded frontmatter/rename hunks above. - A full local Sphinx docs build is recommended before marking ready for review. AI assistance (Claude Code) was used to prepare this backport. --------- Signed-off-by: justinyeh1995 <[email protected]> Signed-off-by: Justin Yeh <[email protected]> Signed-off-by: JustinYeh <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]> Signed-off-by: win5923 <[email protected]> Signed-off-by: Paul Nolan <[email protected]> Signed-off-by: machichima <[email protected]> Signed-off-by: wuallen57730 <[email protected]> Co-authored-by: JustinYeh <[email protected]> Co-authored-by: Jun-Hao Wan <[email protected]> Co-authored-by: Pat O'Connor <[email protected]> Co-authored-by: David Adamache <[email protected]> Co-authored-by: Paul Nolan <[email protected]> Co-authored-by: Nary Yeh <[email protected]> Co-authored-by: Lima <[email protected]>
## Description This PR documents the usage and limitation of the feature gate `SidecarSubmitterRestart`. ## Related issues KubeRay [ray-project#4285](kuberay-project/kuberay#4285) ## Additional information Preview links can be reviewed at [RayJob Quick Start Submission configuration](https://anyscale-ray--64303.com.readthedocs.build/en/64303/cluster/kubernetes/getting-started/rayjob-quick-start.html#rayjob-configuration) & [A more detailed user guide](https://anyscale-ray--64303.com.readthedocs.build/en/64303/cluster/kubernetes/user-guides/rayjob-sidecar-submitter-restart.html#kuberay-rayjob-sidecar-submitter-restart) --------- Signed-off-by: justinyeh1995 <[email protected]> Signed-off-by: Justin Yeh <[email protected]> Signed-off-by: JustinYeh <[email protected]>
Description
This PR documents the usage and limitation of the feature gate
SidecarSubmitterRestart.Related issues
KubeRay #4285
Additional information
Preview links can be reviewed at RayJob Quick Start Submission configuration & A more detailed user guide