Ejemplo n.º 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()
Ejemplo n.º 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)

    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()
Ejemplo n.º 3
0
def swarm_up_master(args):
    logging.info("Bringing up the swarm master")

    _validate_dirs(args)

    cfg = get_config(args.config)

    security_group = get_security_group_from_role(cfg,
                                                  DEFAULT_MASTER_ROLE_NAME)

    create_master(cfg, security_group)

    _update_role_defs(get_master_reservations(cfg), 'master')
    env.user = cfg.get('fabric', 'user', None)
    env.key_filename = cfg.get('fabric', 'key_filename', None)

    is_fabricable(env.roledefs['master'][0])

    execute(_bootstrap_master, args.directory)
    _disconnect_fabric()
Ejemplo n.º 4
0
def swarm_up_master(args):
    logging.info("Bringing up the swarm master")

    _validate_dirs(args)

    cfg = get_config(args.config)

    security_group = get_security_group_from_role(
        cfg, DEFAULT_MASTER_ROLE_NAME)

    create_master(cfg, security_group)

    _update_role_defs(get_master_reservations(cfg), 'master')
    env.user = cfg.get('fabric', 'user', None)
    env.key_filename = cfg.get('fabric', 'key_filename', None)

    is_fabricable(env.roledefs['master'][0])

    execute(_bootstrap_master, args.directory)
    _disconnect_fabric()