26
26
import ipywidgets as widgets
27
27
from IPython .display import display , HTML , Javascript
28
28
import pandas as pd
29
- from ..ray .cluster .config import ClusterConfiguration
30
- from ..ray .cluster .status import RayClusterStatus
31
- from ..common import _kube_api_error_handling
32
- from ..common . kubernetes_cluster .auth import (
29
+ from ... ray .cluster .config import ClusterConfiguration
30
+ from ... ray .cluster .status import RayClusterStatus
31
+ from ..kubernetes_cluster import _kube_api_error_handling
32
+ from ..kubernetes_cluster .auth import (
33
33
config_check ,
34
34
get_api_client ,
35
35
)
36
36
37
37
38
- def cluster_up_down_buttons (cluster : "codeflare_sdk.cluster.Cluster" ) -> widgets . Button :
38
+ def cluster_up_down_buttons (cluster : "codeflare_sdk.ray. cluster.cluster. Cluster" ):
39
39
"""
40
40
The cluster_up_down_buttons function returns two button widgets for a create and delete button.
41
41
The function uses the appwrapper bool to distinguish between resource type for the tool tip.
@@ -56,7 +56,7 @@ def cluster_up_down_buttons(cluster: "codeflare_sdk.cluster.Cluster") -> widgets
56
56
icon = "trash" ,
57
57
)
58
58
59
- wait_ready_check = wait_ready_check_box ()
59
+ wait_ready_check = _wait_ready_check_box ()
60
60
output = widgets .Output ()
61
61
62
62
# Display the buttons in an HBox wrapped in a VBox which includes the wait_ready Checkbox
@@ -81,7 +81,7 @@ def on_down_button_clicked(b): # Handle the down button click event
81
81
delete_button .on_click (on_down_button_clicked )
82
82
83
83
84
- def wait_ready_check_box ():
84
+ def _wait_ready_check_box ():
85
85
"""
86
86
The wait_ready_check_box function will return a checkbox widget used for waiting for the resource to be in the state READY.
87
87
"""
@@ -115,7 +115,7 @@ def view_clusters(namespace: str = None):
115
115
)
116
116
return # Exit function if not in Jupyter Notebook
117
117
118
- from ..ray .cluster .cluster import get_current_namespace
118
+ from ... ray .cluster .cluster import get_current_namespace
119
119
120
120
if not namespace :
121
121
namespace = get_current_namespace ()
@@ -278,7 +278,7 @@ def _on_ray_dashboard_button_click(
278
278
"""
279
279
_on_ray_dashboard_button_click handles the event when the Open Ray Dashboard button is clicked, opening the Ray Dashboard in a new tab
280
280
"""
281
- from codeflare_sdk . ray . cluster import Cluster
281
+ from codeflare_sdk import Cluster
282
282
283
283
cluster_name = classification_widget .value
284
284
namespace = ray_clusters_df [ray_clusters_df ["Name" ] == classification_widget .value ][
@@ -309,7 +309,7 @@ def _on_list_jobs_button_click(
309
309
"""
310
310
_on_list_jobs_button_click handles the event when the View Jobs button is clicked, opening the Ray Jobs Dashboard in a new tab
311
311
"""
312
- from codeflare_sdk . ray . cluster import Cluster
312
+ from codeflare_sdk import Cluster
313
313
314
314
cluster_name = classification_widget .value
315
315
namespace = ray_clusters_df [ray_clusters_df ["Name" ] == classification_widget .value ][
@@ -342,7 +342,7 @@ def _delete_cluster(
342
342
_delete_cluster function deletes the cluster with the given name and namespace.
343
343
It optionally waits for the cluster to be deleted.
344
344
"""
345
- from ..ray .cluster .cluster import _check_aw_exists
345
+ from ... ray .cluster .cluster import _check_aw_exists
346
346
347
347
try :
348
348
config_check ()
@@ -400,7 +400,7 @@ def _fetch_cluster_data(namespace):
400
400
"""
401
401
_fetch_cluster_data function fetches all clusters and their spec in a given namespace and returns a DataFrame.
402
402
"""
403
- from ..ray .cluster .cluster import list_all_clusters
403
+ from ... ray .cluster .cluster import list_all_clusters
404
404
405
405
rayclusters = list_all_clusters (namespace , False )
406
406
if not rayclusters :
0 commit comments