ray.runtime_context.get_runtime_context#

ray.runtime_context.get_runtime_context()[source]#

Get the runtime context of the current driver/worker.

Example

>>> import ray
>>> # Get the job id.
>>> ray.get_runtime_context().job_id 
>>> # Get all the metadata.
>>> ray.get_runtime_context().get() 

PublicAPI: This API is stable across Ray releases.