def setUp(self): self.controller = cs.ControllerService() self.controller.startService() self.multiengine = IMultiEngine(self.controller) self.tc = task.ITaskController(self.controller) self.tc.failurePenalty = 0 self.engines = []
def setUp(self): self.rc = cs.ControllerService() self.rc.startService() self.root = multienginepb.IPBMultiEngine(self.rc) self.root.remote_addNotifier = lambda _: None self.sf = pb.PBServerFactory(self.root) self.s = reactor.listenTCP(10111, self.sf) self.cf = pb.PBClientFactory() self.c = reactor.connectTCP('127.0.0.1', 10111, self.cf) self.engines = [] self.addEngine(1) return self.cf.getRootObject().addCallback(self.gotRoot)
def setUp(self): self.c = cs.ControllerService() self.c.startService() self.me = IMultiEngine(self.c) self.tc = task.TaskController(self.c) self.tc.failurePenalty = 0 self.engines = [] for i in range(1): e = es.EngineService() # e.startService() self.c.registerEngine(es.QueuedEngine(e), i) self.engines.append(e)
def main(logfile): co = kernelConfigManager.getConfigObj() if logfile: logfile = logfile + str(os.getpid()) + '.log' try: openLogFile = open(logfile, 'w') except: openLogFile = sys.stdout else: openLogFile = sys.stdout log.startLogging(openLogFile) # Execute any user defined import statements cis = co['controller']['controllerImportStatement'] if cis: try: exec cis except: log.msg("Error running controllerImportStatement: %s" % cis) # Create and configure the core ControllerService cs = controllerservice.ControllerService() # Start listening for engines efac = kernelConfigManager._import( co['controller']['engineServerProtocolInterface'])(cs) reactor.listenTCP( port=co['controller']['listenForEnginesOn'].as_int('port'), factory=efac, interface=co['controller']['listenForEnginesOn']['ip']) for ciname, ci in co['controller']['controllerInterfaces'].iteritems(): log.msg("Starting controller interface: " + ciname) adaptedController = kernelConfigManager._import( ci['controllerInterface'])(cs) for niname, ni in ci['networkInterfaces'].iteritems(): log.msg("Starting controller network interface (%s): %s:%s:%i" % (ciname, niname, ni['ip'], ni.as_int('port'))) fac = kernelConfigManager._import( ni['interface'])(adaptedController) reactor.listenTCP(port=ni.as_int('port'), factory=fac, interface=ni['ip']) # Start the controller service and set things running cs.startService() reactor.run()
def main(logfile): if logfile: logfile = logfile + str(os.getpid()) + '.log' try: openLogFile = open(logfile, 'w') except: openLogFile = sys.stdout else: openLogFile = sys.stdout log.startLogging(openLogFile) # Execute any user defined import statements if controllerConfig.controllerImportStatement: try: exec controllerConfig.controllerImportStatement except: log.msg("Error running controllerImportStatement: %s" % controllerConfig.controllerImportStatement) # Start listening for engines # Create and configure the core ControllerService cs = controllerservice.ControllerService() # Make the controller listen for engines. efac = controllerConfig.engineInterface['interface'](cs) efac.registerChecker(controllerConfig.engineInterface['checker']) reactor.listenTCP(port=controllerConfig.engineInterface['port'], factory=efac, interface=controllerConfig.engineInterface['ip']) # Start the client interfaces. for ciname, ci in controllerConfig.controllerInterfaces.iteritems(): log.msg("Starting controller interface: " + ciname) adaptedController = ci['controllerInterface'](cs) for niname, ni in ci['networkInterfaces'].iteritems(): log.msg("Starting controller network interface (%s): %s:%s:%i" % (ciname, niname, ni['ip'], ni['port'])) fac = ni['interface'](adaptedController) reactor.listenTCP(port=ni['port'], factory=fac, interface=ni['ip']) # Start the controller service and set things running cs.startService() reactor.run()
def setUp(self): self.servers = [] self.clients = [] self.services = [] self.engines = [] self.controller = cs.ControllerService() self.controller.startService() self.imultiengine = me.IMultiEngine(self.controller) self.imultiengine_factory = mexmlrpc.IXMLRPCMultiEngineFactory(self.imultiengine) self.servers.append(reactor.listenTCP(10105, self.imultiengine_factory)) self.multiengine = mexmlrpc.XMLRPCFullSynchronousMultiEngineClient(('localhost',10105)) self.itc = task.ITaskController(self.controller) self.itc.failurePenalty = 0 self.itc_factory = taskxmlrpc.IXMLRPCTaskControllerFactory(self.itc) self.servers.append(reactor.listenTCP(10113, self.itc_factory)) self.tc = taskxmlrpc.XMLRPCTaskClient(('localhost',10113))
def setUp(self): self.controller = self.rc = cs.ControllerService() self.controller.startService() self.engines = [] self.controller.registerSerializationTypes(serialized.Serialized) self.addEngine(1)