22import sky
33from typing import Any , Dict , List , Optional , Tuple , Union
44from pymc_server .utils .yaml import merge_yaml
5- from pymc_server .launch_cli import launch as cli_launch
5+ from pymc_server .launch_cli import launch as cli_launch ,cli_launch_
6+ from pymc_server .launch_cli import launch_2
7+ from pymc_server .down_cli import down as down_cli
68from pymc_server .cli_factory import setup_launch_factory , setup_status_factory
79from sky .usage import usage_lib
10+ from sky .cli import _get_shell_complete_args , _get_click_major_version , _complete_cluster_name , _NaturalOrderGroup , _DocumentedCodeCommand
11+ from pymc_server .utils .cli_ex import jobs_launch as ex_launch
812
913
1014from sky .cli import (
1115 status as sky_status ,
1216 launch as sky_launch ,
1317 check as sky_check
1418)
15-
1619
1720# TODO: remove, check pyproject.py for a reference to this function
1821@click .group ()
@@ -24,7 +27,14 @@ def cli():
2427def status (* args , ** kwargs ):
2528 """ calls the sky status command by passing the click context"""
2629 ctx = click .get_current_context ()
27- ctx .invoke (sky_status , * args , ** kwargs )
30+ #ctx.invoke(_status_test, *args, **kwargs)
31+ print ("*args" ,* args )
32+
33+
34+ data = ctx .invoke (sky_status , * args , ** kwargs )
35+ print ("DATA" ,data )
36+
37+ #ctx.invoke(sky_status, *args, **kwargs)
2838
2939
3040@setup_launch_factory
@@ -40,7 +50,8 @@ def launch(*args, **kwargs):
4050 """
4151 # cli_launch(*args, **kwargs)
4252 ctx = click .get_current_context ()
43- ctx .invoke (cli_launch , * args , ** kwargs )
53+ ctx .invoke (launch_2 , * args , ** kwargs )
54+ #ctx.invoke(sky_launch, *args, **kwargs)
4455
4556@setup_status_factory
4657@usage_lib .entrypoint
@@ -51,6 +62,42 @@ def check(*args, **kwargs):
5162 ctx .invoke (sky_check , * args , ** kwargs )
5263
5364
65+ @cli .command (cls = _DocumentedCodeCommand )
66+ @click .argument ('clusters' ,
67+ nargs = - 1 ,
68+ required = False ,
69+ ** _get_shell_complete_args (_complete_cluster_name ))
70+ @click .option ('--all' ,
71+ '-a' ,
72+ default = None ,
73+ is_flag = True ,
74+ help = 'Tear down all existing clusters.' )
75+ @click .option ('--yes' ,
76+ '-y' ,
77+ is_flag = True ,
78+ default = False ,
79+ required = False ,
80+ help = 'Skip confirmation prompt.' )
81+ @click .option (
82+ '--purge' ,
83+ '-p' ,
84+ is_flag = True ,
85+ default = False ,
86+ required = False ,
87+ help = ('(Advanced) Forcefully remove the cluster(s) from '
88+ 'SkyPilot\' s cluster table, even if the actual cluster termination '
89+ 'failed on the cloud. WARNING: This flag should only be set sparingly'
90+ ' in certain manual troubleshooting scenarios; with it set, it is the'
91+ ' user\' s responsibility to ensure there are no leaked instances and '
92+ 'related resources.' ))
93+ @usage_lib .entrypoint
94+ def down (* args , ** kwargs ):
95+ ctx = click .get_current_context ()
96+ #sky_check(*args, **kwargs)
97+ ctx .invoke (down_cli , * args , ** kwargs )
98+ """Deletes a local cluster."""
99+
100+
54101cli .add_command (status )
55102cli .add_command (launch )
56103cli .add_command (check )
0 commit comments