File tree 2 files changed +16
-5
lines changed
src/codeflare_sdk/cluster
2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ def is_dashboard_ready(self) -> bool:
258
258
else :
259
259
return False
260
260
261
- def wait_ready (self , timeout : Optional [int ] = None ):
261
+ def wait_ready (self , timeout : Optional [int ] = None , dashboard_check : bool = True ):
262
262
"""
263
263
Waits for requested cluster to be ready, up to an optional timeout (s).
264
264
Checks every five seconds.
@@ -276,19 +276,24 @@ def wait_ready(self, timeout: Optional[int] = None):
276
276
)
277
277
if not ready :
278
278
if timeout and time >= timeout :
279
- raise TimeoutError (f"wait() timed out after waiting { timeout } s for cluster to be ready" )
279
+ raise TimeoutError (
280
+ f"wait() timed out after waiting { timeout } s for cluster to be ready"
281
+ )
280
282
sleep (5 )
281
283
time += 5
282
284
print ("Requested cluster is up and running!" )
283
285
284
- while not dashboard_ready :
286
+ while dashboard_check and not dashboard_ready :
285
287
dashboard_ready = self .is_dashboard_ready ()
286
288
if not dashboard_ready :
287
289
if timeout and time >= timeout :
288
- raise TimeoutError (f"wait() timed out after waiting { timeout } s for dashboard to be ready" )
290
+ raise TimeoutError (
291
+ f"wait() timed out after waiting { timeout } s for dashboard to be ready"
292
+ )
289
293
sleep (5 )
290
294
time += 5
291
- print ("Dashboard is ready!" )
295
+ if dashboard_ready :
296
+ print ("Dashboard is ready!" )
292
297
293
298
def details (self , print_to_console : bool = True ) -> RayCluster :
294
299
cluster = _copy_to_ray (self )
Original file line number Diff line number Diff line change @@ -1790,6 +1790,12 @@ def test_wait_ready(mocker, capsys):
1790
1790
captured .out
1791
1791
== "Waiting for requested resources to be set up...\n Requested cluster is up and running!\n Dashboard is ready!\n "
1792
1792
)
1793
+ cf .wait_ready (dashboard_check = False )
1794
+ captured = capsys .readouterr ()
1795
+ assert (
1796
+ captured .out
1797
+ == "Waiting for requested resources to be set up...\n Requested cluster is up and running!\n "
1798
+ )
1793
1799
1794
1800
1795
1801
def test_jobdefinition_coverage ():
You can’t perform that action at this time.
0 commit comments