def init_application(): # Initialize the oslo configuration library and logging service.prepare_service(sys.argv) profiler.setup('zun-api', CONF.host) LOG.debug("Configuration:") CONF.log_opt_values(LOG, log.DEBUG) return app.load_app()
def test_setup_profiler(self, mock_init): self.config(enabled=True, group='profiler') profiler.setup('foo', 'localhost') mock_init.assert_called_once_with(conf=conf.CONF, context=mock.ANY, project="zun", service='foo', host='localhost')
def init_application(): # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't # already contain registered options if the app is reloaded. CONF.reset() # Initialize the oslo configuration library and logging service.prepare_service(sys.argv) profiler.setup('zun-api', CONF.host) LOG.debug("Configuration:") CONF.log_opt_values(LOG, log.DEBUG) return app.load_app()
def __init__(self, topic, server, endpoints, binary): super(Service, self).__init__() serializer = _init_serializer() transport = messaging.get_rpc_transport(CONF) access_policy = dispatcher.DefaultRPCAccessPolicy # TODO(asalkeld) add support for version='x.y' target = messaging.Target(topic=topic, server=server) self.endpoints = endpoints self._server = messaging.get_rpc_server(transport, target, endpoints, executor='eventlet', serializer=serializer, access_policy=access_policy) self.binary = binary profiler.setup(binary, CONF.host)
def main(): # Parse config file and command line options, then start logging zun_service.prepare_service(sys.argv) # Enable object backporting via the conductor # TODO(yuanying): Uncomment after rpc services are implemented # base.zunObject.indirection_api = base.zunObjectIndirectionAPI() # Setup OSprofiler for WSGI service profiler.setup('zun-api', CONF.api.host_ip) # Build and start the WSGI app launcher = zun_service.process_launcher() server = zun_service.WSGIService('zun_api', CONF.api.enable_ssl_api) launcher.launch_service(server, workers=server.workers) launcher.wait()
def main(): # Parse config file and command line options, then start logging zun_service.prepare_service(sys.argv) # Enable object backporting via the conductor # TODO(yuanying): Uncomment after rpc services are implemented # base.zunObject.indirection_api = base.zunObjectIndirectionAPI() # Setup OSprofiler for WSGI service profiler.setup('zun-api', CONF.api.host_ip) # Build and start the WSGI app launcher = zun_service.process_launcher() server = zun_service.WSGIService( 'zun_api', CONF.api.enable_ssl_api ) launcher.launch_service(server, workers=server.workers) launcher.wait()