Esempio n. 1
0
 def _sciond_conf(self, topo_id, base):
     name = sciond_svc_name(topo_id)
     net = self.elem_networks["sd" + topo_id.file_fmt()][0]
     ipv = 'ipv4'
     if ipv not in net:
         ipv = 'ipv6'
     ip = str(net[ipv])
     disp_id = 'cs%s-1' % topo_id.file_fmt()
     entry = {
         'extra_hosts': ['jaeger:%s' % docker_host(self.args.docker)],
         'image':
         docker_image(self.args, 'daemon'),
         'container_name':
         '%ssd%s' % (self.prefix, topo_id.file_fmt()),
         'depends_on': ['scion_disp_%s' % disp_id],
         'user':
         self.user,
         'volumes': [
             self._disp_vol(disp_id),
             self._cache_vol(),
             self._certs_vol(),
             '%s:/share/conf:ro' % base
         ],
         'networks': {
             self.bridges[net['net']]: {
                 '%s_address' % ipv: ip
             }
         },
         'command': ['--config', '/share/conf/sd.toml'],
     }
     self.dc_conf['services'][name] = entry
Esempio n. 2
0
 def _tracing_entry(self):
     docker_ip = docker_host(self.args.in_docker, self.args.docker)
     entry = {
         'enabled': True,
         'debug': True,
         'agent': '%s:6831' % docker_ip
     }
     return entry
Esempio n. 3
0
    def _gen_zk_entry(self, addr, port, in_docker, docker):
        if not port:
            port = DEFAULT_ZK_PORT
        if in_docker:
            # If we're in-docker, we need to set the port to not conflict with the host port
            port = port + 1

        addr = docker_host(in_docker, docker, str(ip_address(addr)))
        return {'Addr': addr, 'L4Port': port}
Esempio n. 4
0
    def _dispatcher_conf(self, topo_id, topo, base):
        image = 'dispatcher'
        base_entry = {
            'extra_hosts': ['jaeger:%s' % docker_host(self.args.docker)],
            'image': docker_image(self.args, image),
            'networks': {},
            'user': self.user,
            'volumes': [],
            'depends_on': {
                'utils_chowner': {
                    'condition': 'service_started'
                },
            },
        }
        keys = (list(topo.get("control_service", {})) +
                ["tester_%s" % topo_id.file_fmt()])
        for disp_id in keys:
            entry = copy.deepcopy(base_entry)
            net_key = disp_id
            net = self.elem_networks[net_key][0]
            ipv = 'ipv4'
            if ipv not in net:
                ipv = 'ipv6'
            ip = str(net[ipv])
            entry['networks'][self.bridges[net['net']]] = {
                '%s_address' % ipv: ip
            }
            entry['container_name'] = '%sdisp_%s' % (self.prefix, disp_id)
            entry['volumes'].append(self._disp_vol(disp_id))
            conf = '%s:/share/conf:rw' % base
            entry['volumes'].append(conf)
            entry['command'] = [
                '--config', '/share/conf/disp_%s.toml' % disp_id
            ]

            self.dc_conf['services']['scion_disp_%s' % disp_id] = entry
            self.dc_conf['volumes'][self._disp_vol(disp_id).split(':')
                                    [0]] = None