ray.job_submission.JobSubmissionClient.stop_job#
- JobSubmissionClient.stop_job(job_id: str) bool [source]#
Request a job to exit asynchronously.
Attempts to terminate process first, then kills process after timeout.
Example
>>> from ray.job_submission import JobSubmissionClient >>> client = JobSubmissionClient("http://127.0.0.1:8265") >>> sub_id = client.submit_job(entrypoint="sleep 10") >>> client.stop_job(sub_id) True
- Parameters:
job_id – The job ID or submission ID for the job to be stopped.
- Returns:
True if the job was running, otherwise False.
- Raises:
RuntimeError – If the job does not exist or if the request to the job server fails.