Get actor details based on node id or specific custom resource

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.
  • I am using cluster.yaml file for cluster creation.
  • In my pipeline, each node (head/worker) is having one unique custom resources, which I am using for load balancing.
  • I am running all actors with lifetime=“detached” and with unique name.

Now, for load balancing, one of my requirement is find all running actors in a node. So here, if I can find all running actors based on node id (ip address) or as each node is having a unique custom resource, find all running actors using specific resource, any way will be helpful for me.

Will the recent state API help here?

In python you could do

from ray.experimental.state.api import list_actors

all_actors_in_cluster = list_actors(detail=True)

@rickyyx Thanks for your reply.

We can use this API with get_node API to get desired result but the complexity will be more. That’s why I am looking for some functionality, which can filter out actors based on either node_id or either custom resources.

The state API itself does support filtering by node id:

# Retrieve all running actors on a node
list_actors(detail=True, filters=[('node_id', '=', "xxxx"), ('state', '=', 'ALIVE')])

This is probably the closest we have right now, but happy to see what’s the ideal interface you have in mind and we could add it in the future.

Yes, with use of filters, my job will be easier. If you can add something like: filter actors based on resources it’s using, it would be a lot easier. Thanks for your support.

I see, so something like ?

list_actors(resources={"r1", "r2"})

Yes, Exactly same. It will be very helpful.

1 Like