def main(args=None): if not args: args, pass_throughs = parse_args() else: args, pass_throughs = parse_args(args) if args.debug: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) if args.subparser_name == 'submit': args_dict = args.__dict__ if not args_dict.get('config_root_dir'): args_dict['config_root_dir'] = args_dict['base_name'] execute.submit(pass_throughs=pass_throughs, **args_dict) elif args.subparser_name == 'bootstrap': execute.bootstrap(pass_throughs=pass_throughs, **args.__dict__) elif args.subparser_name == 'one-off': execute.submit_one_off(pass_throughs=pass_throughs, **args.__dict__) elif args.subparser_name == 'batch': execute.submit_batch(pass_throughs=pass_throughs, **args.__dict__) elif args.subparser_name == 'rm': execute.rm_pipeline(pass_throughs=pass_throughs, **args.__dict__) elif args.subparser_name == 'trigger': execute.trigger_pipeline(pass_throughs=pass_throughs, **args.__dict__) elif args.subparser_name == 'abort': execute.abort_pipeline(pass_throughs=pass_throughs, **args.__dict__) else: # this is here so that if future subcommands are added, you don't forget to add a bit # here to enable them. raise NotImplementedError("Command {} is not implemented".format( args.subparser_name))
def main(args=None): if not args: args = parse_args() else: args = parse_args(args) if args.debug: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) if args.subparser_name == 'submit': args_dict = args.__dict__ if not args_dict.get('config_root_dir'): args_dict['config_root_dir'] = args_dict['base_name'] execute.submit(**args_dict) elif args.subparser_name == 'bootstrap': execute.bootstrap(**args.__dict__) elif args.subparser_name == 'examine': execute.compute_builds(**args.__dict__) elif args.subparser_name == 'one-off': execute.submit_one_off(**args.__dict__) else: # this is here so that if future subcommands are added, you don't forget to add a bit # here to enable them. raise NotImplementedError("Command {} is not implemented".format(args.subparser_name))
def test_bootstrap(mocker, testing_workdir): execute.bootstrap('frank') assert os.path.isfile('plan_director.yml') assert os.path.isdir('frank') assert os.path.isfile('frank/config.yml') assert os.path.isdir('frank/uploads.d') assert os.path.isdir('frank/build_platforms.d') assert os.path.isdir('frank/test_platforms.d')