ray.job_submission.JobSubmissionClient
ray.job_submission.JobSubmissionClient#
- class ray.job_submission.JobSubmissionClient(address: Optional[str] = None, create_cluster_if_needed: bool = False, cookies: Optional[Dict[str, Any]] = None, metadata: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, Any]] = None, verify: Optional[Union[str, bool]] = True)[source]#
Bases:
ray.dashboard.modules.dashboard_sdk.SubmissionClient
A local client for submitting and interacting with jobs on a remote cluster.
Submits requests over HTTP to the job server on the cluster using the REST API.
- Parameters
address – Either (1) the address of the Ray cluster, or (2) the HTTP address of the dashboard server on the head node, e.g. “http://<head-node-ip>:8265”. In case (1) it must be specified as an address that can be passed to ray.init(), e.g. a Ray Client address (ray://<head_node_host>:10001), or “auto”, or “localhost:<port>”. If unspecified, will try to connect to a running local Ray cluster. This argument is always overridden by the RAY_ADDRESS environment variable.
create_cluster_if_needed – Indicates whether the cluster at the specified address needs to already be running. Ray doesn’t start a cluster before interacting with jobs, but third-party job managers may do so.
cookies – Cookies to use when sending requests to the HTTP job server.
metadata – Arbitrary metadata to store along with all jobs. New metadata specified per job will be merged with the global metadata provided here via a simple dict update.
headers – Headers to use when sending requests to the HTTP job server, used for cases like authentication to a remote cluster.
verify – Boolean indication to verify the server’s TLS certificate or a path to a file or directory of trusted certificates. Default: True.
Methods
delete_job
(job_id)Delete a job in a terminal state and all of its associated data.
DeveloperAPI: This API may change across minor Ray releases.
get_job_info
(job_id)Get the latest status and other information associated with a job.
get_job_logs
(job_id)Get all logs produced by a job.
get_job_status
(job_id)Get the most recent status of a job.
PublicAPI (beta): This API is in beta and may change before becoming stable.
List all jobs along with their status and other information.
stop_job
(job_id)Request a job to exit asynchronously.
submit_job
(*, entrypoint[, job_id, ...])Submit and execute a job asynchronously.
tail_job_logs
(job_id)Get an iterator that follows the logs of a job.