def main(): service.prepare_service("gexporter", sys.argv) CONF = cfg.CONF opt_group = cfg.OptGroup(name='gexporter', title='Options for the\ exporter service') CONF.register_group(opt_group) CONF.register_opts(API_SERVICE_OPTS, opt_group) CONF.set_override('topic', CONF.gexporter.topic, opt_group) CONF.set_override('rabbitmq_host', CONF.gexporter.rabbitmq_host, opt_group) CONF.set_override('rabbitmq_port', CONF.gexporter.rabbitmq_port, opt_group) CONF.set_override('rabbitmq_username', CONF.gexporter.rabbitmq_username, opt_group) endpoints = [ controller.Controller(), ] log.info('Starting exporter service in PID %s' % os.getpid()) rpc_server = broker.Broker(CONF.gexporter.topic, CONF.gexporter.rabbitmq_host, endpoints) print 'Galaxia Exporter service started in PID %s' % os.getpid() rpc_server.serve()
def main(): service.prepare_service("grenderer", sys.argv) CONF = cfg.CONF opt_group = cfg.OptGroup(name='grenderer', title='Options for the\ renderer service') CONF.register_group(opt_group) CONF.register_opts(API_SERVICE_OPTS, opt_group) CONF.set_override('topic', CONF.grenderer.topic, opt_group) CONF.set_override('rabbitmq_host', CONF.grenderer.rabbitmq_host, opt_group) CONF.set_override('rabbitmq_port', CONF.grenderer.rabbitmq_port, opt_group) CONF.set_override('rabbitmq_username', CONF.grenderer.rabbitmq_username, opt_group) CONF.set_override('handler', CONF.grenderer.handler, opt_group) handlers = { 'prometheus': controller.Controller, } endpoints = [ handlers[CONF.grenderer.handler](), ] log.info('Starting renderer service in PID %s' % os.getpid()) rpc_server = broker.Broker(CONF.grenderer.topic, CONF.grenderer.rabbitmq_host, endpoints) print 'Galaxia Renderer service started in PID %s' % os.getpid() rpc_server.serve()
def setup_app(config=None): service.prepare_service("gapi", sys.argv) if not config: config = get_pecan_config() app_conf = dict(config.app) app = pecan.make_app( app_conf.pop('root'), force_canonical=False, logging=getattr(config, 'logging', {}), **app_conf ) return app
def main(): service.prepare_service("gapi", sys.argv) log.info('Completed configuration file parsing...') log.info('Completed logger initialization...') app = api.setup_app() log.info('Pecan app setup complete...') host, port = cfg.CONF.gapi.host, cfg.CONF.gapi.port log.info('Galaxia api server started in PID %s' % os.getpid()) log.info('Galaxia API is now serving on http://%(host)s:%(port)s' % dict(host=host, port=port)) print('Galaxia API is now serving on http://%(host)s:%(port)s' % dict(host=host, port=port)) wsgi.server(eventlet.listen((host, port)), app, log=log)
def main(): service.prepare_service("gapi", sys.argv) log.info('Completed configuration file parsing...') log.info('Completed logger initialization...') app = api.setup_app() log.info('Pecan app setup complete...') host, port = cfg.CONF.gapi.host, cfg.CONF.gapi.port log.info('Galaxia api server started in PID %s' % os.getpid()) log.info('Galaxia API is now serving on http://%(host)s:%(port)s' % dict( host=host, port=port)) print ('Galaxia API is now serving on http://%(host)s:%(port)s' % dict( host=host, port=port)) wsgi.server(eventlet.listen((host, port)), app, log=log)