def launch_engine(): profiler.setup('mistral-engine', cfg.CONF.engine.host) engine_v2 = def_eng.DefaultEngine(rpc.get_engine_client()) engine_endpoint = rpc.EngineServer(engine_v2) # Setup scheduler in engine. db_api.setup_db() scheduler.setup() # Setup expiration policy expiration_policy.setup() engine_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(CONF.engine) ) engine_server.register_endpoint(engine_endpoint) engine_v2.register_membership() try: engine_server.run() except (KeyboardInterrupt, SystemExit): pass finally: print("Stopping engine service...")
def launch_engine(): profiler.setup('mistral-engine', cfg.CONF.engine.host) engine_v2 = def_eng.DefaultEngine(rpc.get_engine_client()) engine_endpoint = rpc.EngineServer(engine_v2) # Setup scheduler in engine. db_api.setup_db() scheduler.setup() # Setup expiration policy expiration_policy.setup() engine_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(CONF.engine)) engine_server.register_endpoint(engine_endpoint) engine_v2.register_membership() try: # Note(ddeja): Engine needs to be run in default (blocking) mode # since using another mode may lead to deadlock. # See https://review.openstack.org/#/c/356343/ # for more info. engine_server.run() except (KeyboardInterrupt, SystemExit): pass finally: print("Stopping engine service...")
def get_executor_client(): global _EXECUTOR_CLIENT if not _EXECUTOR_CLIENT: _EXECUTOR_CLIENT = ExecutorClient( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.executor)) return _EXECUTOR_CLIENT
def get_engine_client(): global _ENGINE_CLIENT if not _ENGINE_CLIENT: _ENGINE_CLIENT = EngineClient( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.engine)) return _ENGINE_CLIENT
def get_executor_client(): global _EXECUTOR_CLIENT if not _EXECUTOR_CLIENT: _EXECUTOR_CLIENT = ExecutorClient( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.executor) ) return _EXECUTOR_CLIENT
def get_engine_client(): global _ENGINE_CLIENT if not _ENGINE_CLIENT: _ENGINE_CLIENT = EngineClient( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.engine) ) return _ENGINE_CLIENT
def test_get_amqp_config(self): conf = cfg.CONF rpc_info = rpc_utils.get_rpc_info_from_oslo(conf.engine) self.assertDictEqual( { 'topic': 'mistral_engine', 'server_id': '0.0.0.0', 'exchange': 'openstack', 'timeout': 60 }, rpc_info )
def start(self): super(ExecutorServer, self).start() if self._setup_profiler: profiler_utils.setup('mistral-executor', cfg.CONF.executor.host) # Initialize and start RPC server. self._rpc_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.executor)) self._rpc_server.register_endpoint(self) self._rpc_server.run(executor='threading') self._notify_started('Executor server started.')
def start(self): super(EventEngineServer, self).start() profiler_utils.setup('mistral-event-engine', cfg.CONF.event_engine.host) # Initialize and start RPC server. self._rpc_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.event_engine)) self._rpc_server.register_endpoint(self) self._rpc_server.run() self._notify_started('Event engine server started.')
def start(self): super(ExecutorServer, self).start() if self._setup_profiler: profiler_utils.setup('mistral-executor', cfg.CONF.executor.host) # Initialize and start RPC server. self._rpc_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.executor) ) self._rpc_server.register_endpoint(self) self._rpc_server.run(executor='threading') self._notify_started('Executor server started.')
def start(self): super(EventEngineServer, self).start() profiler_utils.setup( 'mistral-event-engine', cfg.CONF.event_engine.host ) # Initialize and start RPC server. self._rpc_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.event_engine) ) self._rpc_server.register_endpoint(self) self._rpc_server.run() self._notify_started('Event engine server started.')
def launch_event_engine(): profiler.setup('mistral-event-engine', cfg.CONF.event_engine.host) event_eng = event_engine.EventEngine(rpc.get_engine_client()) endpoint = rpc.EventEngineServer(event_eng) event_engine_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(CONF.event_engine)) event_engine_server.register_endpoint(endpoint) event_eng.register_membership() try: event_engine_server.run() except (KeyboardInterrupt, SystemExit): pass finally: print("Stopping event_engine service...")
def launch_executor(): profiler.setup('mistral-executor', cfg.CONF.executor.host) executor_v2 = def_executor.DefaultExecutor(rpc.get_engine_client()) executor_endpoint = rpc.ExecutorServer(executor_v2) executor_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(CONF.executor)) executor_server.register_endpoint(executor_endpoint) executor_v2.register_membership() try: executor_server.run(executor='threading') except (KeyboardInterrupt, SystemExit): pass finally: print("Stopping executor service...")
def launch_executor(): profiler.setup('mistral-executor', cfg.CONF.executor.host) executor_v2 = def_executor.DefaultExecutor(rpc.get_engine_client()) executor_endpoint = rpc.ExecutorServer(executor_v2) executor_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(CONF.executor) ) executor_server.register_endpoint(executor_endpoint) executor_v2.register_membership() try: executor_server.run() except (KeyboardInterrupt, SystemExit): pass finally: print("Stopping executor service...")
def launch_event_engine(): profiler.setup('mistral-event-engine', cfg.CONF.event_engine.host) event_eng = event_engine.EventEngine(rpc.get_engine_client()) endpoint = rpc.EventEngineServer(event_eng) event_engine_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(CONF.event_engine) ) event_engine_server.register_endpoint(endpoint) event_eng.register_membership() try: event_engine_server.run() except (KeyboardInterrupt, SystemExit): pass finally: print("Stopping event_engine service...")
def test_get_transport_url_rabbit_config(self): conf = cfg.CONF rpc_info = rpc_utils.get_rpc_info_from_oslo(conf.engine) self.assertDictEqual( { 'topic': 'mistral_engine', 'port': 1234, 'server_id': '0.0.0.0', 'user_id': 'user', 'virtual_host': '/', 'host': 'not_localhost', 'exchange': 'openstack', 'password': '******', 'durable_queues': False, 'auto_delete': False, 'timeout': 60 }, rpc_info )
def start(self): super(EngineServer, self).start() db_api.setup_db() self._scheduler = scheduler.start() self._expiration_policy_tg = expiration_policy.setup() if self._setup_profiler: profiler_utils.setup('mistral-engine', cfg.CONF.engine.host) # Initialize and start RPC server. self._rpc_server = rpc.get_rpc_server_driver()( rpc_utils.get_rpc_info_from_oslo(cfg.CONF.engine)) self._rpc_server.register_endpoint(self) # Note(ddeja): Engine needs to be run in default (blocking) mode # since using another mode may leads to deadlock. # See https://review.openstack.org/#/c/356343 for more info. self._rpc_server.run(executor='blocking') self._notify_started('Engine server started.')