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 1
1
from .config import ClusterConfiguration
2
- from .. utils . pretty_print import RayCluster , AppWrapper
2
+ from .model import RayCluster , AppWrapper
3
3
from ..utils import pretty_print
4
4
import openshift as oc
5
5
from typing import List , Optional
@@ -14,6 +14,8 @@ def up(self):
14
14
pass
15
15
16
16
def down (self , name ):
17
+ # FIXME on what the exact details should be
18
+ # 1. delete the appwrapper and that should delete the cluster
17
19
# FIXME on what the exact details should be
18
20
# 1. delete the appwrapper and that should delete the cluster
19
21
pass
@@ -42,7 +44,7 @@ def _get_appwrappers(namespace='default'):
42
44
app_wrappers = oc .selector ('appwrappers' ).qnames ()
43
45
return app_wrappers
44
46
45
-
47
+
46
48
def _app_wrapper_status (name , namespace = 'default' ) -> Optional [AppWrapper ]:
47
49
with oc .project (namespace ), oc .timeout (10 * 60 ):
48
50
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
3
1
from rich import print
4
2
from rich .table import Table
5
3
from rich .console import Console
6
4
from rich .layout import Layout
7
5
from rich .panel import Panel
8
6
from rich import box
9
- from dataclasses import dataclass
10
7
from 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
30
9
31
10
def _print_no_cluster_found ():
32
11
pass
Original file line number Diff line number Diff line change @@ -12,4 +12,3 @@ def test_cluster_status():
12
12
def test_app_wrapper_status ():
13
13
print (_app_wrapper_status ('raycluster-autoscaler' ))
14
14
15
-
You can’t perform that action at this time.
0 commit comments