Repository navigation
[Core] Fix kuberay postmerge by explicitly passing token - #68466
Conversation
Signed-off-by: davik <[email protected]>
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
| 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 |
…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]>
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:
This was because #67523 enabled token authentication across the cluster by default. This meant that simply starting the cluster with
ray start --headwithout 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