Skip to content

[release][Core] Cherry-pick "Fix kuberay postmerge by explicitly passing token" (#68466) onto releases/2.61.0 - #68473

Merged
elliot-barn merged 1 commit into
releases/2.61.0from
elliot-barn/2.61.0-pick-68466
Nov 23, 2026
Merged

elliot-barn merged 1 commit into
releases/2.61.0from
elliot-barn/2.61.0-pick-68466

Conversation

@elliot-barn

Copy link
Copy Markdown
Collaborator

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

## Description
The [post merge kuberay
tests](https://buildkite.com/ray-project/postmerge/builds/21065#01a1ea91-4a88-4d8e-862f-bc611fa93702)
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

Signed-off-by: davik <[email protected]>
(cherry picked from commit 65a0a1b)
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn requested review from a team as code owners November 23, 2026 07:22

@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-based authentication for Ray in chaos tests by retrieving and exporting the RAY_AUTH_TOKEN to the test container, and updating the Helm deployment to configure token auth options. It also adds a polling loop to wait for pods to be created before running kubectl wait, along with enhanced debugging logs on failure. The review feedback recommends refining the polling loop to safely handle transient kubectl errors under set -e by assigning the command output to a local variable and redirecting stderr.

Comment on lines +47 to +52
for _ in {1..60}; do
if [[ -n "$(kubectl get pod -l ray.io/cluster=raycluster-kuberay -o name)" ]]; then
break
fi
sleep 2
done

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, a transient failure of the kubectl command inside the command substitution $(kubectl ...) can cause the script to exit prematurely on some Bash versions, or print confusing error messages to stderr during the polling phase.

Using a local variable assignment within the if condition safely handles any transient kubectl errors (e.g., API server temporarily unavailable during startup) without triggering set -e, and redirecting stderr to /dev/null keeps the CI logs clean.

Suggested change
for _ in {1..60}; do
if [[ -n "$(kubectl get pod -l ray.io/cluster=raycluster-kuberay -o name)" ]]; then
break
fi
sleep 2
done
for _ in {1..60}; do
if pods=$(kubectl get pod -l ray.io/cluster=raycluster-kuberay -o name 2>/dev/null) && [[ -n "$pods" ]]; then
break
fi
sleep 2
done

@elliot-barn
elliot-barn merged commit dfaa2cf into releases/2.61.0 Nov 23, 2026
4 of 5 checks passed
@elliot-barn
elliot-barn deleted the elliot-barn/2.61.0-pick-68466 branch November 23, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants