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):
1010 self .config = config
1111
1212 # 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+
2322 def status (self , print_to_console = True ):
2423 cluster = _ray_cluster_status (self .config .name )
2524 if cluster :
Original file line number Diff line number Diff line change 11from codeflare_sdk .cluster .cluster import list_all_clusters , _app_wrapper_status
22from 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 )
39
4- #for now these tests assume that the cluster was already created
510def test_list_clusters ():
611 clusters = list_all_clusters ()
712
@@ -11,4 +16,8 @@ def test_cluster_status():
1116
1217def test_app_wrapper_status ():
1318 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