ray.runtime_context.RuntimeContext#

class ray.runtime_context.RuntimeContext(worker)[source]#

A class used for getting runtime context.

Methods

get

Get a dictionary of the current context.

get_accelerator_ids

Get the current worker's visible accelerator ids.

get_actor_id

Get the current actor ID in this worker.

get_actor_name

Get the current actor name of this worker.

get_assigned_resources

Get the assigned resources to this worker.

get_job_id

Get current job ID for this worker or driver.

get_node_id

Get current node ID for this worker or driver.

get_placement_group_id

Get the current Placement group ID of this worker.

get_resource_ids

get_runtime_env_string

Get the runtime env string used for the current driver or worker.

get_task_id

Get current task ID for this worker or driver.

get_worker_id

Get current worker ID for this worker or driver process.

Attributes

actor_id

Get the current actor ID in this worker.

current_actor

Get the current actor handle of this actor itself.

current_placement_group_id

Get the current Placement group ID of this worker.

gcs_address

Get the GCS address of the ray cluster.

job_id

Get current job ID for this worker or driver.

namespace

Get the current namespace of this worker.

node_id

Get current node ID for this worker or driver.

runtime_env

Get the runtime env used for the current driver or worker.

should_capture_child_tasks_in_placement_group

Get if the current task should capture parent's placement group.

task_id

Get current task ID for this worker or driver.

was_current_actor_reconstructed

Check whether this actor has been restarted.