ray.runtime_context.RuntimeContext.node_id#

property RuntimeContext.node_id#

Get the ID for the node that this process is running on.

This can be called from within a driver, task, or actor. When called from a driver that is connected to a remote Ray cluster using Ray Client, this returns the ID of the head node.

Returns:

A node id for this worker or driver.

Warning

DEPRECATED: This API is deprecated and may be removed in future Ray releases. Use get_node_id() instead