Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Print KubeRay logs in Buildkite runner when tests fail #2690

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

LeoLiao123
Copy link
Contributor

Why are these changes needed?

See #2652

Related issue number

Closes #2652

Manual tests

I set the timeout to 1 second locally using the following command to make the test fail, and observed the logs to see if there was any output :

go test -timeout 1s -v ./test/e2e || (kubectl logs --tail -1 -l app.kubernetes.io/name=kuberay && exit 1) >> ~/data/kuberay-operator.log

kuberay-operator.log :

{"level":"info","ts":"2024-12-27T06:14:03.982Z","logger":"setup","msg":"Loaded feature gates","featureGates":{"RayClusterStatusConditions":true}}
{"level":"info","ts":"2024-12-27T06:14:03.983Z","logger":"setup","msg":"Flag watchNamespace is not set. Watch custom resources in all namespaces."}
{"level":"info","ts":"2024-12-27T06:14:03.983Z","logger":"setup","msg":"Setup manager"}
{"level":"info","ts":"2024-12-27T06:14:04.185Z","logger":"setup","msg":"starting manager"}
{"level":"info","ts":"2024-12-27T06:14:04.185Z","logger":"controller-runtime.metrics","msg":"Starting metrics server"}
{"level":"info","ts":"2024-12-27T06:14:04.185Z","logger":"controller-runtime.metrics","msg":"Serving metrics server","bindAddress":":8080","secure":false}
{"level":"info","ts":"2024-12-27T06:14:04.186Z","msg":"starting server","kind":"health probe","addr":"[::]:8082"}
{"level":"info","ts":"2024-12-27T06:14:04.387Z","msg":"attempting to acquire leader lease default/ray-operator-leader..."}
{"level":"info","ts":"2024-12-27T06:14:21.213Z","msg":"successfully acquired lease default/ray-operator-leader"}
...

And after setting it properly and passing the test using the following command, I observed the log output:

go test -timeout 30m -v ./test/e2e || (kubectl logs --tail -1 -l app.kubernetes.io/name=kuberay && exit 1) >> ~/data/kuberay-operator.log

kuberay-operator.log :

(empty)

Therefore, it can be confirmed that the logs are printed only when the test fails.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@LeoLiao123
Copy link
Contributor Author

@kevin85421 , @MortalHappiness PTAL.

@kevin85421 kevin85421 merged commit 2fb9465 into ray-project:master Dec 27, 2024
24 checks passed
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.

[Feature] Print KubeRay logs in Buildkite runner when tests fail
2 participants