JobSubmissionClient.delete_job(job_id: str) bool[source]#

Delete a job in a terminal state and all of its associated data.

If the job is not already in a terminal state, raises an error. This does not delete the job logs from disk. Submitting a job with the same submission ID as a previously deleted job is not supported and may lead to unexpected behavior.


>>> from ray.job_submission import JobSubmissionClient
>>> client = JobSubmissionClient() 
>>> job_id = client.submit_job(entrypoint="echo hello") 
>>> client.delete_job(job_id) 

job_id – submission ID for the job to be deleted.


True if the job was deleted, otherwise False.


RuntimeError – If the job does not exist, if the request to the job server fails, or if the job is not in a terminal state.

PublicAPI (alpha): This API is in alpha and may change before becoming stable.