Skip to content

[Core] Fix kuberay postmerge by explicitly passing token - #68466

Merged
Sparks0219 merged 2 commits into
ray-project:masterfrom
Kunchd:fix-kuberay-chaos-token-auth
Nov 23, 2026
Merged

Sparks0219 merged 2 commits into
ray-project:masterfrom
Kunchd:fix-kuberay-chaos-token-auth

Conversation

@Kunchd

@Kunchd Kunchd commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

The post merge kuberay tests are currently failing due to timeout. Upon, running the tests on master locally via a kind cluster, we see the kuberay operator failing to bring pods up due to:

PANIC scripts.py:1081 -- Token authentication is enabled but no authentication token was found. Run `ray get-auth-token --generate` to create one, then put that token on every node of the cluster before starting it.

This was because #67523 enabled token authentication across the cluster by default. This meant that simply starting the cluster with ray start --head without a token present on the cluster will lead to the failure we see above. Instead, the kuberay operator must create the token and pass it to the cluster. This PR adds this mechanism to the kuberay post merge tests.

Once kuberay side comes up with a standard way of handling this in future versions, we can get rid of this fix: kuberay-project/kuberay#5496.

Related issues

Additional information

Kuberay test postmerge run: https://buildkite.com/ray-project/postmerge/builds/21179

@Kunchd
Kunchd requested review from a team as code owners November 23, 2026 03:23
@Kunchd Kunchd added the go add ONLY when ready to merge, run all tests label Nov 23, 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 enables token authentication for Ray chaos tests by retrieving and exporting RAY_AUTH_TOKEN to the test container, updating the Helm installation to use template rendering with a patch for token auth options, and adding a robust polling loop to wait for pods to be created before running kubectl wait. A review comment suggests making the polling loop more resilient under set -euo pipefail by handling potential transient failures of the kubectl get pod command.

# Wait for the operator to create the pods; `kubectl wait` fails at once when
# no pod matches the selector yet.
for _ in {1..60}; do
if [[ -n "$(kubectl get pod -l ray.io/cluster=raycluster-kuberay -o name)" ]]; then

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

Under set -euo pipefail, if kubectl get pod fails due to a transient network or API server issue, the command substitution $(kubectl ...) will return a non-zero exit code, causing the script to terminate immediately.

Adding || true inside the command substitution and redirecting stderr to /dev/null ensures the script is robust against transient failures and does not pollute the logs during the polling loop.

Suggested change
if [[ -n "$(kubectl get pod -l ray.io/cluster=raycluster-kuberay -o name)" ]]; then
if [[ -n "$(kubectl get pod -l ray.io/cluster=raycluster-kuberay -o name 2>/dev/null || true)" ]]; then

@Sparks0219 Sparks0219 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.

noice 🚢

@Sparks0219
Sparks0219 enabled auto-merge (squash) November 23, 2026 04:44
@Sparks0219
Sparks0219 merged commit 65a0a1b into ray-project:master Nov 23, 2026
7 checks passed
elliot-barn added a commit that referenced this pull request Nov 23, 2026
…ing token" (#68466) onto releases/2.61.0 (#68473)

## Description

Cherry-pick of #68466 (`65a0a1bd40`) onto `releases/2.61.0`. The KubeRay
chaos tests time out because token authentication is now on by default
(#67523) and the cluster starts without a token; this passes one
explicitly.

Clean pick. The two touched files (`ci/k8s/run-chaos-test.sh`,
`python/ray/tests/chaos/prepare_env.sh`) are identical to master after
the pick.

## Testing

Not run locally. The KubeRay tests run in the release branch's postmerge
build.

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

Signed-off-by: davik <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
Co-authored-by: Kunchen (David) Dai <[email protected]>
@Kunchd
Kunchd deleted the fix-kuberay-chaos-token-auth branch November 23, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants