Example #1
0
def up(image, bindir, logdir, dns, uid, config_path):
    config = common.parse_json_file(config_path)['oneprovider_node']
    config['config']['target_dir'] = '/root/bin'
    configs = [_tweak_config(config, node, uid) for node in config['nodes']]

    dns_servers, output = common.set_up_dns(dns, uid)
    ccms = []
    workers = []

    db_node_mappings, riak_out = _riak_up(configs, dns_servers, uid)
    common.merge(output, riak_out)

    for cfg, _ in configs:
        ccm, worker, node_out = _node_up(image, bindir, logdir, uid, cfg,
                                         dns_servers, db_node_mappings)
        ccms.extend(ccm)
        workers.extend(worker)
        common.merge(output, node_out)

    _wait_until_ready(workers)

    if logdir:
        for node in ccms + workers:
            docker.exec_(node, [
                'chown', '-R', '{0}:{1}'.format(os.geteuid(), os.getegid()),
                '/root/bin/node/log/'
            ])

    return output
Example #2
0
def up(image, bindir, dns, uid, config_path):
    config = common.parse_json_file(config_path)['oneclient']
    configs = [_tweak_config(config, node, uid) for node in config['nodes']]

    dns_servers, output = common.set_up_dns(dns, uid)

    for cfg in configs:
        node_out = _node_up(image, bindir, uid, cfg, config_path, dns_servers)
        common.merge(output, node_out)

    return output
Example #3
0
def up(image, bindir, dns, uid, config_path):
    config = common.parse_json_file(config_path)['appmock']
    config['config']['target_dir'] = '/root/bin'
    configs = [_tweak_config(config, node, uid) for node in config['nodes']]

    dns_servers, output = common.set_up_dns(dns, uid)

    for cfg in configs:
        node_out = _node_up(image, bindir, uid, cfg, config_path, dns_servers)
        common.merge(output, node_out)

    return output
Example #4
0
def up(image, bindir, logdir, dns, uid, config_path):
    config = common.parse_json_file(config_path)['globalregistry']
    config['config']['target_dir'] = '/root/bin'
    configs = [_tweak_config(config, node, uid) for node in config['nodes']]

    dns_servers, output = common.set_up_dns(dns, uid)

    gr_containers = []
    for cfg in configs:
        gr_container, node_out = _node_up(image, bindir, logdir, uid, cfg,
                                          dns_servers)
        common.merge(output, node_out)
        gr_containers.append(gr_container)

    if logdir:
        for node in gr_containers:
            docker.exec_(node, [
                'chown', '-R', '{0}:{1}'.format(os.geteuid(), os.getegid()),
                '/root/bin/node/log/'
            ])

    return output