def _sig_dc_conf(self, topo_id, base): setup_name = 'scion_sig_setup_%s' % topo_id.file_fmt() disp_id = 'scion_disp_sig_%s' % topo_id.file_fmt() self.dc_conf['services'][setup_name] = { 'image': 'scion_tester:latest', 'depends_on': [disp_id], 'entrypoint': './sig_setup.sh', 'privileged': True, 'network_mode': 'service:%s' % disp_id, 'command': [remote_nets(self.args.networks, topo_id)], } self.dc_conf['services']['scion_sig_%s' % topo_id.file_fmt()] = { 'image': 'scion_sig:latest', 'container_name': 'scion_%ssig_%s' % (self.prefix, topo_id.file_fmt()), 'depends_on': [ disp_id, sciond_svc_name(topo_id), setup_name, ], 'cap_add': ['NET_ADMIN'], 'user': self.user, 'volumes': [ self._disp_vol(topo_id), '/dev/net/tun:/dev/net/tun', '%s/sig%s:/share/conf' % (base, topo_id.file_fmt()), ], 'network_mode': 'service:%s' % disp_id, }
def _sig_dc_conf(self, topo_id, base): self.dc_conf['services']['scion_sig_%s' % topo_id.file_fmt()] = { 'image': 'scion_sig_acceptance:latest', 'container_name': 'scion_%ssig_%s' % (self.prefix, topo_id.file_fmt()), 'depends_on': [ 'scion_disp_sig_%s' % topo_id.file_fmt(), sciond_svc_name(topo_id) ], 'cap_add': ['NET_ADMIN'], 'privileged': True, 'environment': { 'SU_EXEC_USERSPEC': self.user_spec, }, 'volumes': [ *DOCKER_USR_VOL, self._disp_vol(topo_id), '/dev/net/tun:/dev/net/tun', '%s/sig%s:/share/conf' % (base, topo_id.file_fmt()), ], 'network_mode': 'service:scion_disp_sig_%s' % topo_id.file_fmt(), 'command': [remote_nets(self.args.networks, topo_id)] }
def _test_conf(self, topo_id): cntr_base = '/share' name = 'tester_%s' % topo_id.file_fmt() entry = { 'image': docker_image(self.args, 'tester'), 'container_name': 'tester_%s' % topo_id.file_fmt(), 'depends_on': ['scion_disp_%s' % name], 'privileged': True, 'entrypoint': 'sh tester.sh', 'environment': {}, # 'user': self.user, 'volumes': [ 'vol_scion_disp_%s:/run/shm/dispatcher:rw' % name, self.output_base + '/logs:' + cntr_base + '/logs:rw', self.output_base + '/gen:' + cntr_base + '/gen:rw', self.output_base + '/gen-certs:' + cntr_base + '/gen-certs:rw' ], 'network_mode': 'service:scion_disp_%s' % name, } net = self.args.networks[name][0] ipv = 'ipv4' if ipv not in net: ipv = 'ipv6' disp_net = self.args.networks[name][0] entry['environment']['SCION_LOCAL_ADDR'] = str(disp_net[ipv]) sciond_net = self.args.networks['sd%s' % topo_id.file_fmt()][0] entry['environment']['SCION_DAEMON'] = '%s:30255' % sciond_net[ipv] if self.args.sig: # If the tester container needs to communicate to the SIG, it needs the SIG_IP and # REMOTE_NETS which are the remote subnets that need to be routed through the SIG. # net information for the connected SIG sig_net = self.args.networks['sig%s' % topo_id.file_fmt()][0] entry['environment']['SIG_IP'] = str(sig_net[ipv]) entry['environment']['REMOTE_NETS'] = remote_nets( self.args.networks, topo_id) self.dc_conf['services'][name] = entry
def _test_conf(self, topo_id): cntr_base = '/share' name = 'tester_%s' % topo_id.file_fmt() entry = { 'extra_hosts': ['jaeger:%s' % docker_host(self.args.docker)], 'image': docker_image(self.args, 'tester'), 'container_name': 'tester_%s' % topo_id.file_fmt(), 'privileged': True, 'entrypoint': 'sh tester.sh', 'environment': {}, # 'user': self.user, 'volumes': [ 'vol_scion_disp_cs%s-1:/run/shm/dispatcher:rw' % topo_id.file_fmt(), self.output_base + '/logs:' + cntr_base + '/logs:rw', self.output_base + '/gen:' + cntr_base + '/gen:rw', self.output_base + '/gen-certs:' + cntr_base + '/gen-certs:rw' ], 'networks': {} } net = self.args.networks[name][0] bridge = self.args.bridges[net['net']] ipv = 'ipv4' if ipv not in net: ipv = 'ipv6' entry['networks'][bridge] = {'%s_address' % ipv: str(net[ipv])} if self.args.sig: # If the tester container needs to communicate to the SIG, it needs the SIG_IP and # REMOTE_NETS which are the remote subnets that need to be routed through the SIG. # net information for the connected SIG sig_net = self.args.networks['sig%s' % topo_id.file_fmt()][0] entry['environment']['SIG_IP'] = str(sig_net[ipv]) entry['environment']['REMOTE_NETS'] = remote_nets( self.args.networks, topo_id) self.dc_conf['services'][name] = entry
def _sig_dc_conf(self, topo_id, base): setup_name = 'scion_sig_setup_%s' % topo_id.file_fmt() disp_id = 'scion_disp_sig_%s' % topo_id.file_fmt() self.dc_conf['services'][setup_name] = { 'image': 'tester:latest', 'depends_on': [disp_id], 'entrypoint': './sig_setup.sh', 'privileged': True, 'network_mode': 'service:%s' % disp_id, 'command': [remote_nets(self.args.networks, topo_id)], } self.dc_conf['services']['scion_sig_%s' % topo_id.file_fmt()] = { 'image': 'posix-gateway:latest', 'container_name': 'scion_%ssig_%s' % (self.prefix, topo_id.file_fmt()), 'depends_on': [ disp_id, sciond_svc_name(topo_id), setup_name, ], 'environment': { 'SCION_EXPERIMENTAL_GATEWAY_PATH_UPDATE_INTERVAL': '1s', }, 'cap_add': ['NET_ADMIN'], 'user': self.user, 'volumes': [ self._disp_vol(topo_id), '/dev/net/tun:/dev/net/tun', '%s:/share/conf' % base, ], 'network_mode': 'service:%s' % disp_id, 'command': ['--config', '/share/conf/sig.toml'], }