ray.job_submission.JobSubmissionClient.list_jobs#

JobSubmissionClient.list_jobs() List[JobDetails][source]#

List all jobs along with their status and other information.

Lists all jobs that have ever run on the cluster, including jobs that are currently running and jobs that are no longer running.

Example

>>> from ray.job_submission import JobSubmissionClient
>>> client = JobSubmissionClient("http://127.0.0.1:8265") 
>>> client.submit_job(entrypoint="echo hello") 
>>> client.submit_job(entrypoint="sleep 2") 
>>> client.list_jobs() 
[JobDetails(status='SUCCEEDED',
job_id='03000000', type='submission',
submission_id='raysubmit_4LamXRuQpYdSMg7J',
message='Job finished successfully.', error_type=None,
start_time=1647388711, end_time=1647388712, metadata={}, runtime_env={}),
JobDetails(status='RUNNING',
job_id='04000000', type='submission',
submission_id='raysubmit_1dxCeNvG1fCMVNHG',
message='Job is currently running.', error_type=None,
start_time=1647454832, end_time=None, metadata={}, runtime_env={})]
Returns:

A dictionary mapping job_ids to their information.

Raises:

RuntimeError – If the request to the job server fails.