ray.runtime_context.RuntimeContext.get_job_id#

RuntimeContext.get_job_id() str[source]#

Get current job ID for this worker or driver.

Job ID is the id of your Ray drivers that create tasks or actors.

Returns:

If called by a driver, this returns the job ID. If called in a task, return the job ID of the associated driver. The job ID will be hex format.

Raises:

AssertionError – If not called in a driver or worker. Generally, this means that ray.init() was not called.