ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
34.06k stars 5.78k forks source link

[Core] [Observability]Add `job_id` and `state` filters for "get all actor info" api #39245

Open larrylian opened 1 year ago

larrylian commented 1 year ago

Description

Currently, the GCS GetAllActorInfo request already has the ability to filter actors by job_id and state. image

However, this filtering capability is not available in the ray.state.actors() API in Python/Java. Now there is a need to add the ability to filter by job_id and state in the ray.state.actors() API.

Use case

No response

rickyyx commented 1 year ago

What's the reason for having features parity in ray.state.actors

larrylian commented 1 year ago

What's the reason for having features parity in ray.state.actors

@rickyyx

  1. We both have many jobs in a ray cluster, so a job's manager role want to get this job's actors. Use ray.state.actors to fetching all actors in the cluster can lead to performance degradation.
  2. We only want to get alive actors.

If you also think this requirement is acceptable, I can handle completing this issue.

rickyyx commented 1 year ago

Ah i see- that makes much sense.