Beispiel #1
0
def main():
    api_config.init(sys.argv[1:])
    api_config.setup_logging()
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers)
        workers = 1

    LOG.info(_LI("Server on http://%(host)s:%(port)s with %(workers)s"),
             {'host': host, 'port': port, 'workers': workers})
    messaging.setup()
    systemd.notify_once()
    service = wsgi.Server(CONF, "Kingbird", application, host, port)

    app.serve(service, CONF, workers)

    LOG.info(_LI("Configuration:"))
    CONF.log_opt_values(LOG, std_logging.INFO)

    app.wait()
Beispiel #2
0
 def setUp(self):
     messaging.setup("fake://", optional=True)
     self.addCleanup(messaging.cleanup)
     self.context = utils.dummy_context()
     # self.stubs = stubout.StubOutForTesting()
     self.rpcapi = rpc_client.EngineClient()
     super(EngineRpcAPITestCase, self).setUp()
 def setUp(self):
     messaging.setup("fake://", optional=True)
     self.addCleanup(messaging.cleanup)
     self.context = utils.dummy_context()
     # self.stubs = stubout.StubOutForTesting()
     self.rpcapi = rpc_client.EngineClient()
     super(EngineRpcAPITestCase, self).setUp()
Beispiel #4
0
def main():
    api_config.init(sys.argv[1:])
    api_config.setup_logging()
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning("Wrong worker number, worker = %(workers)s", workers)
        workers = 1

    LOG.info("Server on http://%(host)s:%(port)s with %(workers)s", {
        'host': host,
        'port': port,
        'workers': workers
    })
    messaging.setup()
    systemd.notify_once()
    service = wsgi.Server(CONF, "Kingbird", application, host, port)

    app.serve(service, CONF, workers)

    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, std_logging.INFO)

    app.wait()
Beispiel #5
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='kingbird', prog='kingbird-engine')
    logging.setup(cfg.CONF, 'kingbird-engine')
    logging.set_defaults()
    messaging.setup()

    from kingbird.engine import service as engine

    srv = engine.EngineService(cfg.CONF.host,
                               consts.TOPIC_KB_ENGINE)
    launcher = service.launch(cfg.CONF,
                              srv, workers=cfg.CONF.workers)
    # the following periodic tasks are intended serve as HA checking
    # srv.create_periodic_tasks()
    launcher.wait()