Repository navigation
[release][Core] Cherry-pick "Fix kuberay postmerge by explicitly passing token" (#68466) onto releases/2.61.0 - #68473
Conversation
## 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]>
There was a problem hiding this comment.
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.
| for _ in {1..60}; do | ||
| if [[ -n "$(kubectl get pod -l ray.io/cluster=raycluster-kuberay -o name)" ]]; then | ||
| break | ||
| fi | ||
| sleep 2 | ||
| done |
There was a problem hiding this comment.
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.
| 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 |
Description
Cherry-pick of #68466 (
65a0a1bd40) ontoreleases/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