def main(): try: config.parse_args() wsgi.set_eventlet_hub() log.setup('glance') glance_store.register_opts(config.CONF) glance_store.create_stores(config.CONF) glance_store.verify_default_store() if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "glance", "api", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server() server.start(config.load_paste_app('glance-api'), default_port=9292) systemd.notify_once() server.wait() except exception.WorkerCreationFailure as e: fail(2, e) except RuntimeError as e: fail(1, e)
def main(): try: config.parse_args() config.set_config_defaults() wsgi.set_eventlet_hub() logging.setup(CONF, 'searchlight') utils.register_plugin_opts() # Fail fast if service policy files aren't found service_policies.check_policy_files() if CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "searchlight", "search", CONF.api.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server(workers=CONF.api.workers) server.start(config.load_paste_app('searchlight'), default_port=9393) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def main(): try: config.parse_args() config.set_config_defaults() wsgi.set_eventlet_hub() logging.setup(CONF, 'glance') notifier.set_defaults() if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", oslo_messaging, {}, notifier.get_transport(), "glance", "registry", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) osprofiler.web.enable(cfg.CONF.profiler.hmac_keys) else: osprofiler.web.disable() server = wsgi.Server() server.start(config.load_paste_app('glance-registry'), default_port=9191) server.wait() except RuntimeError as e: sys.exit("ERROR: %s" % encodeutils.exception_to_unicode(e))
def main(): try: config.parse_args() wsgi.set_eventlet_hub() log.setup('glance') glance_store.register_opts(config.CONF) glance_store.create_stores(config.CONF) glance_store.verify_default_store() if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "glance", "api", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server() server.start(config.load_paste_app('glance-api'), default_port=9292) server.wait() except exception.WorkerCreationFailure as e: fail(2, e) except RuntimeError as e: fail(1, e)
def main(): try: config.parse_args() config.set_config_defaults() wsgi.set_eventlet_hub() logging.setup(CONF, 'xmonitor') notifier.set_defaults() if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", oslo_messaging, {}, notifier.get_transport(), "xmonitor", "registry", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) osprofiler.web.enable(cfg.CONF.profiler.hmac_keys) else: osprofiler.web.disable() server = wsgi.Server() server.start(config.load_paste_app('xmonitor-registry'), default_port=9191) server.wait() except RuntimeError as e: sys.exit("ERROR: %s" % encodeutils.exception_to_unicode(e))
def configure_wsgi(): config.parse_args() config.set_config_defaults() logging.setup(CONF, 'searchlight') utils.register_plugin_opts() # Fail fast if service policy files aren't found service_policies.check_policy_files() if CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "searchlight", "search", CONF.api.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable()
def main(): config.parse_args() config.set_config_defaults() wsgi.set_eventlet_hub() logging.setup(CONF, 'xmonitor') notifier.set_defaults() if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", oslo_messaging, {}, notifier.get_transport(), "xmonitor", "api", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) osprofiler.web.enable(cfg.CONF.profiler.hmac_keys) else: osprofiler.web.disable() server = wsgi.Server(initialize_glance_store=True) server.start(config.load_paste_app('xmonitor-api'), default_port=9696) server.wait()
def main(): try: config.parse_args() wsgi.set_eventlet_hub() log.setup("glance") if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create( "Messaging", notifier.messaging, {}, notifier.get_transport(), "glance", "registry", cfg.CONF.bind_host ) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server() server.start(config.load_paste_app("glance-registry"), default_port=9191) server.wait() except RuntimeError as e: sys.exit("ERROR: %s" % utils.exception_to_str(e))
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'glare') if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", oslo_messaging, {}, notifier.get_transport(), "glance", "artifacts", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server(initialize_glance_store=True) server.start(config.load_paste_app('glare-api'), default_port=9494) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'glance') if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "glance", "api", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server(initialize_glance_store=True) server.start(config.load_paste_app('glance-api'), default_port=9292) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'sios') if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "sios", "api", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server() server.start(config.load_paste_app('sios-api'), default_port=9292) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def configure_wsgi(): # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't # already contain registered options if the app is reloaded. CONF.reset() config.parse_args() config.set_config_defaults() logging.setup(CONF, 'searchlight') gmr.TextGuruMeditation.setup_autorun(version) utils.register_plugin_opts() # Fail fast if service policy files aren't found service_policies.check_policy_files() if CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "searchlight", "search", CONF.api.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable()
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'rebac') if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "rebac", "api", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server() print("Starting web server....") server.start(config.load_paste_app('rebac-api'), default_port=9292) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'daisy') if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "daisy", "api", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server() server.start(config.load_paste_app('daisy-api'), default_port=9292) systemd.notify_once() server.wait() except Exception as e: fail(e)
def main(): try: config.parse_args() wsgi.set_eventlet_hub() log.setup('glance') if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "glance", "registry", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server() server.start(config.load_paste_app('glance-registry'), default_port=9191) server.wait() except RuntimeError as e: sys.exit("ERROR: %s" % e)
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'searchlight') utils.register_plugin_opts() if CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "searchlight", "search", CONF.api.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server(workers=CONF.api.workers) server.start(config.load_paste_app('searchlight'), default_port=9393) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)