You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/codeflare_sdk/ray/client/ray_jobs.py
+115-30
Original file line number
Diff line number
Diff line change
@@ -24,16 +24,28 @@
24
24
25
25
classRayJobClient:
26
26
"""
27
-
A class that functions as a wrapper for the Ray Job Submission Client.
28
-
29
-
parameters:
30
-
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(),
31
-
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.
32
-
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.
33
-
cookies -- Cookies to use when sending requests to the HTTP job server.
34
-
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.
35
-
headers -- Headers to use when sending requests to the HTTP job server, used for cases like authentication to a remote cluster.
36
-
verify -- Boolean indication to verify the server's TLS certificate or a path to a file or directory of trusted certificates. Default: True.
27
+
A wrapper class for the Ray Job Submission Client, used for interacting with Ray clusters to manage job
28
+
submissions, deletions, and other job-related information.
29
+
30
+
Args:
31
+
address (Optional[str]):
32
+
The Ray cluster's address, which may be either the Ray Client address, HTTP address
33
+
of the dashboard server on the head node, or "auto" / "localhost:<port>" for a local cluster.
34
+
This is overridden by the RAY_ADDRESS environment variable if set.
35
+
create_cluster_if_needed (bool):
36
+
If True, a new cluster will be created if not already running at the
37
+
specified address. By default, Ray requires an existing cluster.
38
+
cookies (Optional[Dict[str, Any]]):
39
+
HTTP cookies to send with requests to the job server.
40
+
metadata (Optional[Dict[str, Any]]):
41
+
Global metadata to store with all jobs, merged with job-specific
42
+
metadata during job submission.
43
+
headers (Optional[Dict[str, Any]]):
44
+
HTTP headers to send with requests to the job server, used for
45
+
authentication.
46
+
verify (Optional[Union[str, bool]]):
47
+
If True, verifies the server's TLS certificate. Can also be a path
Method for submitting jobs to a Ray Cluster and returning the job id with entrypoint being a mandatory field.
71
-
72
-
Parameters:
73
-
entrypoint -- The shell command to run for this job.
74
-
submission_id -- A unique ID for this job.
75
-
runtime_env -- The runtime environment to install and run this job in.
76
-
metadata -- Arbitrary data to store along with this job.
77
-
job_id -- DEPRECATED. This has been renamed to submission_id
78
-
entrypoint_num_cpus -- The quantity of CPU cores to reserve for the execution of the entrypoint command, separately from any tasks or actors launched by it. Defaults to 0.
79
-
entrypoint_num_gpus -- The quantity of GPUs to reserve for the execution of the entrypoint command, separately from any tasks or actors launched by it. Defaults to 0.
80
-
entrypoint_memory –- The quantity of memory to reserve for the execution of the entrypoint command, separately from any tasks or actors launched by it. Defaults to 0.
81
-
entrypoint_resources -- The quantity of custom resources to reserve for the execution of the entrypoint command, separately from any tasks or actors launched by it.
82
+
Submits a job to the Ray cluster with specified resources and returns the job ID.
83
+
84
+
Args:
85
+
entrypoint (str):
86
+
The command to execute for this job.
87
+
job_id (Optional[str]):
88
+
Deprecated, use `submission_id`. A unique job identifier.
89
+
runtime_env (Optional[Dict[str, Any]]):
90
+
The runtime environment for this job.
91
+
metadata (Optional[Dict[str, str]]):
92
+
Metadata associated with the job, merged with global metadata.
0 commit comments