Пример #1
0
def main():
    try:
        config.parse_args()
        config.set_middleware_defaults()
        request_statistics.init_stats()
        policy.init()

        logging.setup(CONF, 'murano')
        workers = CONF.murano.api_workers
        if not workers:
            workers = processutils.get_worker_count()
        launcher = service.launch(CONF,
                                  server.ApiService(),
                                  workers=workers,
                                  restart_method='mutate')

        app = app_loader.load_paste_app('murano')
        port, host = (CONF.bind_port, CONF.bind_host)
        launcher.launch_service(wsgi.Service(app, port, host))
        launcher.launch_service(server.NotificationService())
        launcher.launch_service(stats.StatsCollectingService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
Пример #2
0
def main():
    try:
        hybrid.patch()
        config.parse_args()
        config.set_middleware_defaults()
        request_statistics.init_stats()
        policy.init()

        logging.setup(CONF, 'murano')
        launcher = service.ServiceLauncher(CONF)

        app = app_loader.load_paste_app('murano')
        port, host = (CONF.bind_port, CONF.bind_host)

        launcher.launch_service(wsgi.Service(app, port, host))

        launcher.launch_service(server.ApiService())
        launcher.launch_service(server.NotificationService())
        launcher.launch_service(stats.StatsCollectingService())
        launcher.launch_service(scheduler.SchedulerService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
Пример #3
0
 def __init__(self, application, port,
              host='0.0.0.0', backlog=4096, threads=1000):
     self.application = application
     self._port = port
     self._host = host
     self._backlog = backlog if backlog else CONF.backlog
     self._logger = logging.getLogger('eventlet.wsgi')
     self.greenthread = None
     config.set_middleware_defaults()
     super(Service, self).__init__(threads)
Пример #4
0
 def __init__(self, application, port,
              host='0.0.0.0', backlog=4096, threads=1000):
     self.application = application
     self._port = port
     self._host = host
     self._backlog = backlog if backlog else CONF.backlog
     self._logger = logging.getLogger('eventlet.wsgi')
     self.greenthread = None
     config.set_middleware_defaults()
     super(Service, self).__init__(threads)
Пример #5
0
def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('murano.api')

    logging.register_options(cfg.CONF)
    cfg.CONF(project='murano')
    logging.setup(cfg.CONF, 'murano')
    config.set_middleware_defaults()
    request_statistics.init_stats()
    policy.init()

    port = cfg.CONF.bind_port
    host = cfg.CONF.bind_host
    LOG.info(_('Starting Murano REST API on %(host)s:%(port)s'), {
        'host': host,
        'port': port
    })
    return app_loader.load_paste_app('murano')
Пример #6
0
def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('murano.api')

    logging.register_options(cfg.CONF)
    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't
    # already contain registered options if the app is reloaded.
    cfg.CONF.reset()
    cfg.CONF(project='murano')
    logging.setup(cfg.CONF, 'murano')
    config.set_middleware_defaults()
    request_statistics.init_stats()
    policy.init()
    server.get_notification_listener().start()
    server.get_rpc_server().start()

    port = cfg.CONF.bind_port
    host = cfg.CONF.bind_host
    LOG.info(_('Starting Murano REST API on %(host)s:%(port)s'),
             {'host': host, 'port': port})
    return app_loader.load_paste_app('murano')
Пример #7
0
def main():
    try:
        config.parse_args()
        config.set_middleware_defaults()
        request_statistics.init_stats()
        policy.init()

        logging.setup(CONF, 'murano')
        launcher = service.ServiceLauncher(CONF)

        app = app_loader.load_paste_app('murano')
        port, host = (CONF.bind_port, CONF.bind_host)

        launcher.launch_service(wsgi.Service(app, port, host))

        launcher.launch_service(server.ApiService())
        launcher.launch_service(server.NotificationService())
        launcher.launch_service(stats.StatsCollectingService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)