File tree Expand file tree Collapse file tree 2 files changed +20
-12
lines changed
src/codeflare_sdk/cluster Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,15 @@ def __init__(self, config: ClusterConfiguration):
10
10
self .config = config
11
11
12
12
# creates a new cluser with the provided or default spec
13
- def up (self ):
14
- pass
15
-
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
19
- # FIXME on what the exact details should be
20
- # 1. delete the appwrapper and that should delete the cluster
21
- pass
22
-
13
+ def up (self , namespace = 'default' ):
14
+ with oc .project (namespace ):
15
+ oc .invoke ("apply" , ["-f" ,
16
+ "https://raw.githubusercontent.com/IBM/multi-cluster-app-dispatcher/quota-management/doc/usage/examples/kuberay/config/aw-raycluster.yaml" ])
17
+
18
+ def down (self , name , namespace = 'default' ):
19
+ with oc .project (namespace ):
20
+ oc .invoke ("delete" ,["AppWrapper" , self .config .name ])
21
+
23
22
def status (self , print_to_console = True ):
24
23
cluster = _ray_cluster_status (self .config .name )
25
24
if cluster :
Original file line number Diff line number Diff line change 1
1
from codeflare_sdk .cluster .cluster import list_all_clusters , _app_wrapper_status
2
2
from codeflare_sdk .cluster .cluster import Cluster , ClusterConfiguration
3
+ import time
4
+
5
+ def test_cluster_up ():
6
+ cluster = Cluster (ClusterConfiguration (name = 'raycluster-autoscaler' ))
7
+ cluster .up ()
8
+ time .sleep (15 )
3
9
4
- #for now these tests assume that the cluster was already created
5
10
def test_list_clusters ():
6
11
clusters = list_all_clusters ()
7
12
@@ -11,4 +16,8 @@ def test_cluster_status():
11
16
12
17
def test_app_wrapper_status ():
13
18
print (_app_wrapper_status ('raycluster-autoscaler' ))
14
-
19
+
20
+ def test_cluster_down ():
21
+ cluster = Cluster (ClusterConfiguration (name = 'raycluster-autoscaler' ))
22
+ cluster .down (name = 'raycluster-autoscaler' )
23
+
You can’t perform that action at this time.
0 commit comments