コード例 #1
0
def main():
    parser = init_parser()
    args = parser.parse_args()
    logger = logging.getLogger('ramp_aws')
    logger.setLevel(args.log_level)
    config = read_backend_config(args.config)
    validate_config(config)
    if args.id:
        submission_id = args.id
    elif args.name and args.event and args.team:
        try:
            submission = get_submission_by_name(config, args.event, args.team,
                                                args.name)
        except Exception as ex:
            print('Submission not found. Reasons:')
            print(ex)
            sys.exit(1)
        submission_id = submission.id
    else:
        print('Please specify either submission id, or alternatively '
              'submission event/team/name. Use ramp_aws_train --help for '
              'help.')
        sys.exit(1)
    if args.instance_id:
        train_on_existing_ec2_instance(config, args.instance_id, submission_id)
    else:
        launch_ec2_instance_and_train(config, submission_id)
コード例 #2
0
def main():
    parser = init_parser()
    args = parser.parse_args()
    logger = logging.getLogger('ramp_aws')
    logger.setLevel(args.log_level)
    config = read_backend_config(args.config)
    validate_config(config)
    try:
        event_name = config['ramp']['event_name']
    except KeyError:
        print('Cannot find event_name in section ramp of the {}'.format(args.config))
        sys.exit(1)
    train_loop(config, event_name)