ray.job_submission.JobSubmissionClient.delete_job#

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.

Example

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

job_id – submission ID for the job to be deleted.

Returns:

True if the job was deleted, otherwise False.

Raises:

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.