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().get_job_id()

PublicAPI: This API is stable across Ray releases.