Skip to content

Commit fa8701b

Browse files
add cluster.details() as an option for when the cluster isn't ready yet
1 parent 0ac5104 commit fa8701b

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/codeflare_sdk/ray/cluster/cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def wait_ready(self, timeout: Optional[int] = None, dashboard_check: bool = True
426426
status, ready = self.status(print_to_console=False)
427427
if status == CodeFlareClusterStatus.UNKNOWN:
428428
print(
429-
"WARNING: Current cluster status is unknown, have you run cluster.apply() yet?"
429+
"WARNING: Current cluster status is unknown, have you run cluster.apply() yet? Run cluster.details() to check if it's ready."
430430
)
431431
if ready:
432432
break
@@ -518,7 +518,7 @@ def cluster_dashboard_uri(self) -> str:
518518
elif "route.openshift.io/termination" in annotations:
519519
protocol = "https"
520520
return f"{protocol}://{ingress.spec.rules[0].host}"
521-
return "Dashboard not available yet, have you run cluster.apply()?"
521+
return "Dashboard not available yet, have you run cluster.apply()? Run cluster.details() to check if it's ready."
522522

523523
def list_jobs(self) -> List:
524524
"""

src/codeflare_sdk/ray/cluster/pretty_print.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
def print_no_resources_found():
3232
console = Console()
33-
console.print(Panel("[red]No resources found, have you run cluster.apply() yet?"))
33+
console.print(Panel("[red]No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready."))
3434

3535

3636
def print_app_wrappers_status(app_wrappers: List[AppWrapper], starting: bool = False):

src/codeflare_sdk/ray/cluster/test_cluster.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def test_cluster_uris(mocker):
324324
)
325325
assert (
326326
cluster.cluster_dashboard_uri()
327-
== "Dashboard not available yet, have you run cluster.apply()?"
327+
== "Dashboard not available yet, have you run cluster.apply()? Run cluster.details() to check if it's ready."
328328
)
329329

330330
mocker.patch(
@@ -538,7 +538,7 @@ def test_wait_ready(mocker, capsys):
538538

539539
captured = capsys.readouterr()
540540
assert (
541-
"WARNING: Current cluster status is unknown, have you run cluster.apply() yet?"
541+
"WARNING: Current cluster status is unknown, have you run cluster.apply() yet? Run cluster.details() to check if it's ready."
542542
in captured.out
543543
)
544544
mocker.patch(
@@ -571,7 +571,7 @@ def test_list_queue_appwrappers(mocker, capsys):
571571
captured = capsys.readouterr()
572572
assert captured.out == (
573573
"╭──────────────────────────────────────────────────────────────────────────────╮\n"
574-
"│ No resources found, have you run cluster.apply() yet? \n"
574+
"│ No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready.\n"
575575
"╰──────────────────────────────────────────────────────────────────────────────╯\n"
576576
)
577577
mocker.patch(
@@ -616,7 +616,7 @@ def test_list_queue_rayclusters(mocker, capsys):
616616
captured = capsys.readouterr()
617617
assert captured.out == (
618618
"╭──────────────────────────────────────────────────────────────────────────────╮\n"
619-
"│ No resources found, have you run cluster.apply() yet? \n"
619+
"│ No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready.\n"
620620
"╰──────────────────────────────────────────────────────────────────────────────╯\n"
621621
)
622622
mocker.patch(
@@ -658,7 +658,7 @@ def test_list_clusters(mocker, capsys):
658658
captured = capsys.readouterr()
659659
assert captured.out == (
660660
"╭──────────────────────────────────────────────────────────────────────────────╮\n"
661-
"│ No resources found, have you run cluster.apply() yet? \n"
661+
"│ No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready.\n"
662662
"╰──────────────────────────────────────────────────────────────────────────────╯\n"
663663
)
664664
mocker.patch(

src/codeflare_sdk/ray/cluster/test_pretty_print.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_print_no_resources(capsys):
4040
captured = capsys.readouterr()
4141
assert captured.out == (
4242
"╭──────────────────────────────────────────────────────────────────────────────╮\n"
43-
"│ No resources found, have you run cluster.apply() yet? \n"
43+
"│ No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready.\n"
4444
"╰──────────────────────────────────────────────────────────────────────────────╯\n"
4545
)
4646

0 commit comments

Comments
 (0)