State API#

Note

APIs are alpha. This feature requires a full installation of Ray using pip install "ray[default]".

For an overview with examples see Monitoring Ray States.

For the CLI reference see Ray State CLI Reference or Ray Log CLI Reference.

State Python SDK#

State APIs are also exported as functions.

Summary APIs#

ray.util.state.summarize_actors

Summarize the actors in cluster.

ray.util.state.summarize_objects

Summarize the objects in cluster.

ray.util.state.summarize_tasks

Summarize the tasks in cluster.

List APIs#

ray.util.state.list_actors

List actors in the cluster.

ray.util.state.list_placement_groups

List placement groups in the cluster.

ray.util.state.list_nodes

List nodes in the cluster.

ray.util.state.list_jobs

List jobs submitted to the cluster by ray job submission.

ray.util.state.list_workers

List workers in the cluster.

ray.util.state.list_tasks

List tasks in the cluster.

ray.util.state.list_objects

List objects in the cluster.

ray.util.state.list_runtime_envs

List runtime environments in the cluster.

Get APIs#

ray.util.state.get_actor

Get an actor by id.

ray.util.state.get_placement_group

Get a placement group by id.

ray.util.state.get_node

Get a node by id.

ray.util.state.get_worker

Get a worker by id.

ray.util.state.get_task

Get task attempts of a task by id.

ray.util.state.get_objects

Get objects by id.

Log APIs#

ray.util.state.list_logs

Listing log files available.

ray.util.state.get_log

Retrieve log file based on file name or some entities ids (pid, actor id, task id).

State APIs Schema#

ray.util.state.common.ActorState

Actor State

ray.util.state.common.TaskState

Task State

ray.util.state.common.NodeState

Node State

ray.util.state.common.PlacementGroupState

PlacementGroup State

ray.util.state.common.WorkerState

Worker State

ray.util.state.common.ObjectState

Object State

ray.util.state.common.RuntimeEnvState

Runtime Environment State

ray.util.state.common.JobState

The state of the job that's submitted by Ray's Job APIs or driver jobs

ray.util.state.common.StateSummary

ray.util.state.common.TaskSummaries

ray.util.state.common.TaskSummaryPerFuncOrClassName

ray.util.state.common.ActorSummaries

ray.util.state.common.ActorSummaryPerClass

ray.util.state.common.ObjectSummaries

ray.util.state.common.ObjectSummaryPerKey

State APIs Exceptions#

ray.util.state.exception.RayStateApiException