Esempio n. 1
0
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))
Esempio n. 2
0
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))
Esempio n. 3
0
def test_submit(mocker):
    mocker.patch.object(execute, 'subprocess')
    pipeline_file = os.path.join(test_config_dir, 'plan_director.yml')
    execute.submit(pipeline_file,
                   base_name="test",
                   pipeline_name="test-pipeline",
                   src_dir='.',
                   config_root_dir=os.path.join(test_data_dir, 'config-test'))