Skip to content

Commit aaf5529

Browse files
authored
added cluster uri and status (#17)
Co-authored-by: Atin Sood <[email protected]>
1 parent 517dcb9 commit aaf5529

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/codeflare_sdk.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Metadata-Version: 2.1
22
Name: codeflare-sdk
3-
Version: 0.0.1
3+
Version: 0.0.0

src/codeflare_sdk.egg-info/SOURCES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ src/codeflare_sdk.egg-info/top_level.txt
88
src/codeflare_sdk/cluster/__init__.py
99
src/codeflare_sdk/cluster/cluster.py
1010
src/codeflare_sdk/cluster/config.py
11+
src/codeflare_sdk/cluster/model.py
1112
src/codeflare_sdk/utils/__init__.py
13+
src/codeflare_sdk/utils/generate_yaml.py
1214
src/codeflare_sdk/utils/pretty_print.py

src/codeflare_sdk/cluster/cluster.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ def status(self, print_to_console=True):
5252
if print_to_console:
5353
pretty_print.print_no_resources_found()
5454
return None
55+
56+
def cluster_uri(self):
57+
return f'ray://{self.config.name}-head-svc:1001'
58+
5559

5660
# checks whether the ray cluster is ready
5761
def is_ready(self, print_to_console=True):
@@ -116,7 +120,7 @@ def _ray_cluster_status(name, namespace='default') -> Optional[RayCluster]:
116120
# FIXME should we check the appwrapper first
117121
with oc.project(namespace), oc.timeout(10*60):
118122
cluster = oc.selector(f'rayclusters/{name}').object()
119-
123+
120124
if cluster:
121125
return _map_to_ray_cluster(cluster)
122126

src/codeflare_sdk/utils/pretty_print.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def print_appwrappers_status(app_wrappers:List[AppWrapper]):
3232

3333

3434
def print_clusters(clusters:List[RayCluster], verbose=True):
35-
if not clusters == 0:
35+
if not clusters:
3636
print_no_resources_found()
3737
return #shortcircuit
3838

0 commit comments

Comments
 (0)