-
Notifications
You must be signed in to change notification settings - Fork 402
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] Inject cluster name as an environment variable into head and worker pods #928
Comments
@Yicheng-Lu-llll are you interested in this issue? |
Sure |
Hi @JoshKarpel, I would like to double-check if this is what you want. |
Oh, I think maybe that isn't what I meant, though that looks useful too. What I was thinking of was the same name that ends up getting used in keys for GCS Fault Tolerance with Redis, which is presumably uniquely generated across different instances of the cluster during e.g. a rolling deploy. |
So, It is not the ray cluster name defined in ray cluster CR but the Redis's key? I am not sure if kuberay is able to get the Redis's key and make it as env var. I wonder if you could give me an example so that I can better understand what env var you want. |
What I'm looking for is a unique, cluster-global, cluster-instance-unique string that I can use to store information that should be namespaced to a particular instance of my Ray cluster. My assumption was that this was generated by KubeRay and was used as part of the prefix of the pod names, e.g. in https://ray-project.github.io/kuberay/guidance/rayservice/#run-an-example-cluster
the cluster name is I was also assuming in my previous message that this string was used as part of the namespace key for GCS Fault Tolerance to prevent state from leaking between clusters, but I don't actually know that - sorry if that was misleading. |
Hi @JoshKarpel, I get your idea, thank you for explaining! #934 actually meet your need. In your case, rayservice name is In my previous example, I use raycluster directly while in your case, you use rayservice. So, in my PR, After running You can get |
D'oh! I get it! That is indeed exactly what I need. Thanks for bearing with me! |
Search before asking
Description
The cluster name should be easily available from inside Kubernetes pods inside the cluster. An env var would be more convenient than e.g. a Ray API call, so that this would be available both from inside Python and from e.g. bash scripts.
Use case
I'd like to use the cluster name for namespacing extra information I'll be storing in an external Redis.
Related issues
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: