Executors¶
nos.executors.ray ¶
Ray executor for NOS.
This module provides a Ray executor for NOS. The Ray executor is a singleton instance that can be used to start a Ray head, connect to an existing Ray cluster, and submit tasks to Ray. We use Ray as a backend for distributed computation and containerize them in docker to isolate the environment.
RayRuntimeSpec
dataclass
¶
Source code in nos/executors/ray.py
RayExecutor
dataclass
¶
Executor for Ray.
Source code in nos/executors/ray.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
spec
class-attribute
instance-attribute
¶
spec: RayRuntimeSpec = RayRuntimeSpec()
Runtime spec for Ray.
get
classmethod
¶
get() -> RayExecutor
is_initialized ¶
init ¶
Initialize Ray exector.
This implementation forces Ray to start a new cluster instance via
ray.init(address="local")
and then connecting to the
server via ray.init(address="auto")
. The first call to
ray.init(address="auto")
raises a ConnectionError
and proceeds to
force-start a new ray cluster instance, followed by a second call to
ray.init(address="auto")
which successfully connects to the server.
In the case of a Ray cluster already running, the first call to
ray.init(address="auto")
will successfully connect to the server.
Parameters:
-
max_attempts
(int
, default:5
) –Number of retries to attempt to connect to an existing
-
timeout
(int
, default:60
) –Time to wait for Ray to start. Defaults to 60 seconds.
-
retry_interval
(int
, default:5
) –Time to wait between retries. Defaults to 5 seconds.
Source code in nos/executors/ray.py
start ¶
Force-start a local instance of Ray head.
Source code in nos/executors/ray.py
stop ¶
Stop Ray head.
Source code in nos/executors/ray.py
RayJobExecutor
dataclass
¶
Ray job executor.
Source code in nos/executors/ray.py
client
class-attribute
instance-attribute
¶
Job submission client.
__post_init__ ¶
submit ¶
list ¶
info ¶
status ¶
logs ¶
wait ¶
Wait for a job to complete.