-
-
Notifications
You must be signed in to change notification settings - Fork 748
[WIP] Use str for Worker name & address in tests
#4296
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
Conversation
|
Worker names can technically be ints. This comes up with LocalCluster I suspect. We can change this to make things always stringy. |
|
@jacobtomlinson I'm not sure if you have time these days, but if so you might be well positioned to think about this problem |
|
In distributed/distributed/deploy/spec.py Lines 493 to 509 in f018007
@mrocklin do these numbers have any semantic meaning? Or are we just looking for unique names here? If its the latter perhaps this logic should be replaced with uuids? |
|
They need to be unique. It's nice if they're easy to call out, as in client.submit(func, x, workers=[0, 1, 2, 3])
client.submit(func, y, workers=[4, 5, 6, 7])I would be against UUIDs for this reason. My guess/hope is that there is some way to keep using ints in the spec, but to stringify names once they get to the worker |
I'm curious how often this comes up in practice. I've never used this pattern myself. Also I wonder if this could also be achieved more robustly with something like worker_names = [w for w in cluster.workers]
client.submit(func, x, workers=worker_names[:4])
client.submit(func, y, workers=worker_names[4:8]) |
|
Interesting. Thanks for letting me know this is an expected case. Wouldn't have assumed that initially. Using UUIDs or stringifying Mainly am interested in something with a fixed type here as opposed to several. The latter makes it harder to type things under-the-hood. |
It's not super common, but I've used it from time to time. If you're familiar with MPI style programming it's also pretty natural.
Yes, that would be more robust. I'm inclined towards stringification personally. It's also the least disruptive. I'm also personally unlikely to do this work short term though. If others who are going to do this work have strong thoughts then I'm all for those thoughts. |
str for Worker name & address in testsstr for Worker name & address in tests
|
Broke out the Edit: NVM that's of no use on its own. |
|
Going to abandon this. Not going to open a new issue since issue ( #5743 ) already encapsulates this issue well. |
It seems a few tests specified the
Worker'snameandaddresswithints. HoweverScheduler.coerce_address(used in the tests) doesn't actually allowints. Also theWorkerState's docs foraddressimply it is astr, which is also said of thenannyaddress. Here we attempt to resolve this discrepancy by fixing these tests to usestrs instead ofints.