Example #1
0
def swarm_up_slaves(args):
    logging.info("Bringing up {0} swarm slaves".format(args.num_slaves))

    _validate_dirs(args)

    cfg = get_config(args.config)

    master_ip_address = get_master_ip_address(cfg)

    security_group = get_security_group_from_role(cfg, DEFAULT_SLAVE_ROLE_NAME)

    if not master_ip_address:
        raise Exception("Unable to start slaves without a master. Please "
                        "bring up a master first.")

    for i in xrange(args.num_slaves):
        pool.apply_async(create_slave, (cfg, security_group))

    pool.close()
    pool.join()

    _wait_for_slave_reservations(cfg, args.num_slaves)

    update_master_security_group(cfg)
    _update_role_defs(get_slave_reservations(cfg), 'slave')
    env.user = cfg.get('fabric', 'user', None)
    env.key_filename = cfg.get('fabric', 'key_filename', None)
    env.parallel = True

    execute(_bootstrap_slave, args.directory, master_ip_address)
    _disconnect_fabric()
Example #2
0
def swarm_up_slaves(args):
    logging.info("Bringing up {0} swarm slaves".format(args.num_slaves))

    _validate_dirs(args)

    cfg = get_config(args.config)

    master_ip_address = get_master_ip_address(cfg)

    if not master_ip_address:
        raise Exception("Unable to start slaves without a master. Please "
                        "bring up a master first.")

    for i in xrange(args.num_slaves):
        pool.apply_async(create_slave, (cfg, ))

    pool.close()
    pool.join()

    update_master_security_group(cfg)

    # TODO: Hack for now, should check for ssh-ability
    time.sleep(5)

    _update_role_defs(get_slave_reservations(cfg), 'slave')
    env.user = cfg.get('fabric', 'user', None)
    env.key_filename = cfg.get('fabric', 'key_filename', None)
    env.parallel = True

    execute(_bootstrap_slave, args.directory, master_ip_address)
    _disconnect_fabric()
Example #3
0
def swarm_up_slaves(args):
    logging.info("Bringing up {0} swarm slaves".format(args.num_slaves))

    _validate_dirs(args)

    cfg = get_config(args.config)

    master_ip_address = get_master_ip_address(cfg)

    if not master_ip_address:
        raise Exception("Unable to start slaves without a master. Please "
                        "bring up a master first.")

    for i in xrange(args.num_slaves):
        pool.apply_async(create_slave, (cfg,))

    pool.close()
    pool.join()

    update_master_security_group(cfg)

    # TODO: Hack for now, should check for ssh-ability
    time.sleep(5)

    _update_role_defs(get_slave_reservations(cfg), 'slave')
    env.user = cfg.get('fabric', 'user', None)
    env.key_filename = cfg.get('fabric', 'key_filename', None)
    env.parallel = True

    execute(_bootstrap_slave, args.directory, master_ip_address)
    _disconnect_fabric()
Example #4
0
def swarm_up_slaves(args):
    logging.info("Bringing up {0} swarm slaves".format(args.num_slaves))

    _validate_dirs(args)

    cfg = get_config(args.config)

    master_ip_address = get_master_ip_address(cfg)

    security_group = get_security_group_from_role(cfg, DEFAULT_SLAVE_ROLE_NAME)

    if not master_ip_address:
        raise Exception("Unable to start slaves without a master. Please "
                        "bring up a master first.")

    for i in xrange(args.num_slaves):
        pool.apply_async(create_slave, (cfg, security_group))

    pool.close()
    pool.join()

    _wait_for_slave_reservations(cfg, args.num_slaves)

    update_master_security_group(cfg)
    _update_role_defs(get_slave_reservations(cfg), 'slave')
    env.user = cfg.get('fabric', 'user', None)
    env.key_filename = cfg.get('fabric', 'key_filename', None)
    env.parallel = True

    execute(_bootstrap_slave, args.directory, master_ip_address)
    _disconnect_fabric()