1818from dstack .api .utils import load_profile
1919
2020
21- class ListGpuConfigurator (BaseRunConfigurator ):
21+ class GpuConfigurator (BaseRunConfigurator ):
2222 TYPE = ApplyConfigurationType .TASK
2323
2424 @classmethod
@@ -35,7 +35,7 @@ def register_args(
3535 )
3636
3737
38- class ListGpuCommand (APIBaseCommand ):
38+ class GpuCommand (APIBaseCommand ):
3939 NAME = "gpu"
4040 DESCRIPTION = "List available GPUs"
4141
@@ -54,13 +54,13 @@ def _register(self):
5454 dest = "format" ,
5555 help = "Output in JSON format (equivalent to --format json)" ,
5656 )
57- ListGpuConfigurator .register_args (self ._parser )
57+ GpuConfigurator .register_args (self ._parser )
5858
5959 def _command (self , args : argparse .Namespace ):
6060 super ()._command (args )
6161 conf = TaskConfiguration (commands = [":" ])
6262
63- configurator = ListGpuConfigurator (api_client = self .api )
63+ configurator = GpuConfigurator (api_client = self .api )
6464 configurator .apply_args (conf , args , [])
6565 profile = load_profile (Path .cwd (), profile_name = args .profile )
6666
@@ -278,21 +278,3 @@ def th(s: str) -> str:
278278
279279 console .print (props )
280280 console .print ()
281-
282-
283- class ListCommand (APIBaseCommand ):
284- NAME = "list"
285- DESCRIPTION = "List various resources"
286-
287- def _register (self ):
288- super ()._register ()
289- subparsers = self ._parser .add_subparsers (dest = "subcommand" , help = "Available subcommands" )
290-
291- gpu_parser = subparsers .add_parser ("gpu" , help = "List available GPUs" )
292- gpu_cmd = ListGpuCommand (gpu_parser )
293- gpu_cmd ._register ()
294- gpu_parser .set_defaults (func = gpu_cmd ._command )
295-
296- def _command (self , args : argparse .Namespace ):
297- if not hasattr (args , "subcommand" ) or args .subcommand is None :
298- self ._parser .print_help ()
0 commit comments