@@ -235,6 +235,13 @@ def common_experiments_create_single_node_options(f):
235
235
return functools .reduce (lambda x , opt : opt (x ), reversed (options ), f )
236
236
237
237
238
+ show_logs_option = click .option (
239
+ "--logs/--no-logs" ,
240
+ "show_logs" ,
241
+ default = False ,
242
+ )
243
+
244
+
238
245
@create_experiment .command (name = "multinode" , help = "Create multi node experiment" )
239
246
@common_experiments_create_options
240
247
@common_experiment_create_multi_node_options
@@ -259,38 +266,42 @@ def create_single_node(api_key, **kwargs):
259
266
@create_and_start_experiment .command (name = "multinode" , help = "Create and start new multi node experiment" )
260
267
@common_experiments_create_options
261
268
@common_experiment_create_multi_node_options
269
+ @show_logs_option
262
270
@click .pass_context
263
- def create_and_start_multi_node (ctx , api_key , ** kwargs ):
271
+ def create_and_start_multi_node (ctx , api_key , show_logs , ** kwargs ):
264
272
del_if_value_is_none (kwargs )
265
273
experiments_api = client .API (config .CONFIG_EXPERIMENTS_HOST , api_key = api_key )
266
274
command = experiments_commands .CreateAndStartExperimentCommand (api = experiments_api )
267
275
experiment = command .execute (kwargs )
268
- if experiment is not None :
276
+ if experiment is not None and show_logs is True :
269
277
ctx .invoke (list_logs , experiment_id = experiment ["handle" ], line = 0 , limit = 100 , follow = True , api_key = api_key )
270
278
271
279
272
280
@create_and_start_experiment .command (name = "singlenode" , help = "Create and start new single node experiment" )
273
281
@common_experiments_create_options
274
282
@common_experiments_create_single_node_options
283
+ @show_logs_option
275
284
@click .pass_context
276
- def create_and_start_single_node (ctx , api_key , ** kwargs ):
285
+ def create_and_start_single_node (ctx , api_key , show_logs , ** kwargs ):
277
286
kwargs ["experimentTypeId" ] = constants .ExperimentType .SINGLE_NODE
278
287
del_if_value_is_none (kwargs )
279
288
experiments_api = client .API (config .CONFIG_EXPERIMENTS_HOST , api_key = api_key )
280
289
command = experiments_commands .CreateAndStartExperimentCommand (api = experiments_api )
281
290
experiment = command .execute (kwargs )
282
- if experiment is not None :
291
+ if experiment is not None and show_logs is True :
283
292
ctx .invoke (list_logs , experiment_id = experiment ["handle" ], line = 0 , limit = 100 , follow = True , api_key = api_key )
284
293
285
294
286
295
@experiments .command ("start" , help = "Start experiment" )
287
296
@click .argument ("experiment-id" )
288
297
@api_key_option
298
+ @show_logs_option
289
299
@click .pass_context
290
- def start_experiment (ctx , experiment_id , api_key ):
300
+ def start_experiment (ctx , experiment_id , show_logs , api_key ):
291
301
experiments_api = client .API (config .CONFIG_EXPERIMENTS_HOST , api_key = api_key )
292
302
experiments_commands .start_experiment (experiment_id , api = experiments_api )
293
- ctx .invoke (list_logs , experiment_id = experiment_id , line = 0 , limit = 100 , follow = True , api_key = api_key )
303
+ if show_logs is True :
304
+ ctx .invoke (list_logs , experiment_id = experiment_id , line = 0 , limit = 100 , follow = True , api_key = api_key )
294
305
295
306
296
307
@experiments .command ("stop" , help = "Stop experiment" )
0 commit comments