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

Support using pod names as worker names #333

Closed
bnaul opened this issue May 4, 2021 · 3 comments
Closed

Support using pod names as worker names #333

bnaul opened this issue May 4, 2021 · 3 comments

Comments

@bnaul
Copy link
Contributor

bnaul commented May 4, 2021

In our helm chart we pass dask-worker --name $(POD_NAME) in the deployment definition; I tried to set something similar up when migrating to KubeCluster, but it seems that these lines https://github.com/dask/dask-kubernetes/blob/main/dask_kubernetes/core.py#L149-L151 make it impossible to set your worker name at runtime bc you'll get a duplicate version of that argument (obviously the pod names are not known yet when you call KubeCluster()).

I would think using pod names instead of 0, 1, ... would be preferable for almost all use cases, it makes the logs/dashboard a lot more interpretable. Maybe making this the default would be too drastic but I think at least supporting it would be a nice usability improvement.

@jacobtomlinson
Copy link
Member

Agree this would be nice!

@bhperry
Copy link
Contributor

bhperry commented Aug 19, 2021

So the name gets set to the index in SpecCluster, but only if there isn't another name parameter set in the worker_spec.

There could be a parameter for kube-cluster like worker_name_from_env where you pass in the env var name that you want, and it sets "name": f"$({worker_name_from_env}) under opts in the worker_spec.

Or another way that might be a bit more flexible would be to have an arg like worker_name_func that accepts a function with index as a parameter. And then you can return anything you want from that, including $(POD_NAME)

@jacobtomlinson
Copy link
Member

The classic KubeCluster was removed in #890. All users will need to migrate to the Dask Operator. Closing.

@jacobtomlinson jacobtomlinson closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants