@@ -261,9 +261,8 @@ enum TableCommands {
261
261
List ,
262
262
}
263
263
264
- #[ derive( clap:: Args , Debug ) ]
265
- #[ clap( group( clap:: ArgGroup :: new( "workers_group" ) . required( true ) . multiple( true ) . args( & [ "include_workers" , "exclude_workers" , "target_parallelism" ] ) ) ) ]
266
- pub struct ScaleResizeCommands {
264
+ #[ derive( clap:: Args , Debug , Clone ) ]
265
+ pub struct ScaleHorizonCommands {
267
266
/// The worker that needs to be excluded during scheduling, worker_id and worker_host are both
268
267
/// supported
269
268
#[ clap(
@@ -288,15 +287,12 @@ pub struct ScaleResizeCommands {
288
287
#[ clap( long) ]
289
288
target_parallelism : Option < u32 > ,
290
289
291
- /// The target parallelism per worker, conflicts with `target_parallelism`, requires
292
- /// `include_workers` to be set.
293
- #[ clap(
294
- long,
295
- requires = "include_workers" ,
296
- conflicts_with = "target_parallelism"
297
- ) ]
298
- target_parallelism_per_worker : Option < u32 > ,
290
+ #[ command( flatten) ]
291
+ common : ScaleCommon ,
292
+ }
299
293
294
+ #[ derive( clap:: Args , Debug , Clone ) ]
295
+ pub struct ScaleCommon {
300
296
/// Will generate a plan supported by the `reschedule` command and save it to the provided path
301
297
/// by the `--output`.
302
298
#[ clap( long, default_value_t = false ) ]
@@ -316,12 +312,37 @@ pub struct ScaleResizeCommands {
316
312
fragments : Option < Vec < u32 > > ,
317
313
}
318
314
315
+ #[ derive( clap:: Args , Debug , Clone ) ]
316
+ pub struct ScaleVerticalCommands {
317
+ #[ command( flatten) ]
318
+ common : ScaleCommon ,
319
+
320
+ /// The worker that needs to be scheduled, worker_id and worker_host are both
321
+ /// supported
322
+ #[ clap(
323
+ long,
324
+ value_delimiter = ',' ,
325
+ value_name = "all or worker_id or worker_host, ..."
326
+ ) ]
327
+ workers : Option < Vec < String > > ,
328
+
329
+ /// The target parallelism per worker, requires `workers` to be set.
330
+ #[ clap( long, requires = "workers" ) ]
331
+ target_parallelism_per_worker : Option < u32 > ,
332
+ }
333
+
319
334
#[ derive( Subcommand , Debug ) ]
320
335
enum ScaleCommands {
321
- /// The resize command scales the cluster by specifying the workers to be included and
322
- /// excluded.
323
- Resize ( ScaleResizeCommands ) ,
324
- /// mark a compute node as unschedulable
336
+ /// Scale the compute nodes horizontally, alias of `horizon`
337
+ Resize ( ScaleHorizonCommands ) ,
338
+
339
+ /// Scale the compute nodes horizontally
340
+ Horizon ( ScaleHorizonCommands ) ,
341
+
342
+ /// Scale the compute nodes vertically
343
+ Vertical ( ScaleVerticalCommands ) ,
344
+
345
+ /// Mark a compute node as unschedulable
325
346
#[ clap( verbatim_doc_comment) ]
326
347
Cordon {
327
348
/// Workers that need to be cordoned, both id and host are supported.
@@ -616,8 +637,12 @@ pub async fn start_impl(opts: CliOpts, context: &CtlContext) -> Result<()> {
616
637
Commands :: Profile ( ProfileCommands :: Heap { dir } ) => {
617
638
cmd_impl:: profile:: heap_profile ( context, dir) . await ?
618
639
}
619
- Commands :: Scale ( ScaleCommands :: Resize ( resize) ) => {
620
- cmd_impl:: scale:: resize ( context, resize) . await ?
640
+ Commands :: Scale ( ScaleCommands :: Horizon ( resize) )
641
+ | Commands :: Scale ( ScaleCommands :: Resize ( resize) ) => {
642
+ cmd_impl:: scale:: resize ( context, resize. into ( ) ) . await ?
643
+ }
644
+ Commands :: Scale ( ScaleCommands :: Vertical ( resize) ) => {
645
+ cmd_impl:: scale:: resize ( context, resize. into ( ) ) . await ?
621
646
}
622
647
Commands :: Scale ( ScaleCommands :: Cordon { workers } ) => {
623
648
cmd_impl:: scale:: update_schedulability ( context, workers, Schedulability :: Unschedulable )
0 commit comments