File tree Expand file tree Collapse file tree 4 files changed +24
-25
lines changed Expand file tree Collapse file tree 4 files changed +24
-25
lines changed Original file line number Diff line number Diff line change 11from .config import ClusterConfiguration
2- from .. utils . pretty_print import RayCluster , AppWrapper
2+ from .model import RayCluster , AppWrapper
33from ..utils import pretty_print
44import openshift as oc
55from typing import List , Optional
@@ -14,6 +14,8 @@ def up(self):
1414 pass
1515
1616 def down (self , name ):
17+ # FIXME on what the exact details should be
18+ # 1. delete the appwrapper and that should delete the cluster
1719 # FIXME on what the exact details should be
1820 # 1. delete the appwrapper and that should delete the cluster
1921 pass
@@ -42,7 +44,7 @@ def _get_appwrappers(namespace='default'):
4244 app_wrappers = oc .selector ('appwrappers' ).qnames ()
4345 return app_wrappers
4446
45-
47+
4648def _app_wrapper_status (name , namespace = 'default' ) -> Optional [AppWrapper ]:
4749 with oc .project (namespace ), oc .timeout (10 * 60 ):
4850 cluster = oc .selector (f'appwrapper/{ name } ' ).object ()
Original file line number Diff line number Diff line change 1+ from dataclasses import dataclass
2+
3+ @dataclass
4+ class RayCluster :
5+ name : str
6+ status : str
7+ min_workers : int
8+ max_workers : int
9+ worker_mem_min : str
10+ worker_mem_max : str
11+ worker_cpu : int
12+ worker_gpu : int
13+
14+ @dataclass
15+ class AppWrapper :
16+ name : str
17+ status :str
18+ can_run : bool
19+ job_state : str
Original file line number Diff line number Diff line change 1- from ast import Str
2- from turtle import st
31from rich import print
42from rich .table import Table
53from rich .console import Console
64from rich .layout import Layout
75from rich .panel import Panel
86from rich import box
9- from dataclasses import dataclass
107from typing import List
11-
12- @dataclass
13- class RayCluster :
14- name : str
15- status : str
16- min_workers : int
17- max_workers : int
18- worker_mem_min : str
19- worker_mem_max : str
20- worker_cpu : int
21- worker_gpu : int
22-
23- @dataclass
24- class AppWrapper :
25- name : str
26- status :str
27- can_run : bool
28- job_state : str
29-
8+ from ..cluster .model import RayCluster , AppWrapper
309
3110def _print_no_cluster_found ():
3211 pass
Original file line number Diff line number Diff line change @@ -12,4 +12,3 @@ def test_cluster_status():
1212def test_app_wrapper_status ():
1313 print (_app_wrapper_status ('raycluster-autoscaler' ))
1414
15-
You can’t perform that action at this time.
0 commit comments