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([address, ...])

Summarize the actors in cluster.

ray.util.state.summarize_objects([address, ...])

Summarize the objects in cluster.

ray.util.state.summarize_tasks([address, ...])

Summarize the tasks in cluster.

List APIs#

ray.util.state.list_actors([address, ...])

List actors in the cluster.

ray.util.state.list_placement_groups([...])

List placement groups in the cluster.

ray.util.state.list_nodes([address, ...])

List nodes in the cluster.

ray.util.state.list_jobs([address, filters, ...])

List jobs submitted to the cluster by :ref: ray job submission.

ray.util.state.list_workers([address, ...])

List workers in the cluster.

ray.util.state.list_tasks([address, ...])

List tasks in the cluster.

ray.util.state.list_objects([address, ...])

List objects in the cluster.

ray.util.state.list_runtime_envs([address, ...])

List runtime environments in the cluster.

Get APIs#

ray.util.state.get_actor(id[, address, ...])

Get an actor by id.

ray.util.state.get_placement_group(id[, ...])

Get a placement group by id.

ray.util.state.get_node(id[, address, ...])

Get a node by id.

ray.util.state.get_worker(id[, address, ...])

Get a worker by id.

ray.util.state.get_task(id[, address, ...])

Get task attempts of a task by id.

ray.util.state.get_objects(id[, address, ...])

Get objects by id.

Log APIs#

ray.util.state.list_logs([address, node_id, ...])

Listing log files available.

ray.util.state.get_log([address, node_id, ...])

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_id, ...)

Actor State

ray.util.state.common.TaskState(task_id, ...)

Task State

ray.util.state.common.NodeState(node_id, ...)

Node State

ray.util.state.common.PlacementGroupState(...)

PlacementGroup State

ray.util.state.common.WorkerState(worker_id, ...)

Worker State

ray.util.state.common.ObjectState(object_id, ...)

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(summary, ...)

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