Ejemplo n.º 1
0
def launch_engine(transport):
    target = messaging.Target(topic=cfg.CONF.engine.topic,
                              server=cfg.CONF.engine.host)

    engine_v2 = def_eng.DefaultEngine(rpc.get_engine_client())

    endpoints = [rpc.EngineServer(engine_v2)]

    # Setup scheduler in engine.
    db_api.setup_db()
    scheduler.setup()

    # Setup expiration policy
    expiration_policy.setup()

    server = messaging.get_rpc_server(transport,
                                      target,
                                      endpoints,
                                      executor='eventlet',
                                      serializer=ctx.RpcContextSerializer(
                                          ctx.JsonPayloadSerializer()))

    engine_v2.register_membership()

    try:
        server.start()
        while True:
            time.sleep(604800)
    except (KeyboardInterrupt, SystemExit):
        pass
    finally:
        print("Stopping engine service...")
        server.stop()
        server.wait()
Ejemplo n.º 2
0
def launch_engine_server(transport, engine):
    target = messaging.Target(topic=cfg.CONF.engine.topic,
                              server=cfg.CONF.engine.host)

    server = messaging.get_rpc_server(transport,
                                      target, [rpc.EngineServer(engine)],
                                      executor='blocking',
                                      serializer=ctx.RpcContextSerializer(
                                          ctx.JsonPayloadSerializer()))

    server.start()
    server.wait()
Ejemplo n.º 3
0
def launch_engine_server(transport, engine):
    target = messaging.Target(topic=cfg.CONF.engine.topic,
                              server=cfg.CONF.engine.host)

    server = messaging.get_rpc_server(transport,
                                      target, [rpc.EngineServer(engine)],
                                      executor='blocking',
                                      serializer=ctx.RpcContextSerializer(
                                          ctx.JsonPayloadSerializer()))

    try:
        server.start()
        while True:
            eventlet.sleep(604800)
    except (KeyboardInterrupt, SystemExit):
        LOG.info("Stopping engine service...")
    finally:
        server.stop()
        server.wait()
Ejemplo n.º 4
0
def launch_engine(transport):
    target = messaging.Target(topic=cfg.CONF.engine.topic,
                              server=cfg.CONF.engine.host)

    engine_v2 = def_eng.DefaultEngine(rpc.get_engine_client())

    endpoints = [rpc.EngineServer(engine_v2)]

    # Setup scheduler in engine.
    db_api.setup_db()
    scheduler.setup()

    server = messaging.get_rpc_server(transport,
                                      target,
                                      endpoints,
                                      executor='eventlet',
                                      serializer=ctx.RpcContextSerializer(
                                          ctx.JsonPayloadSerializer()))

    server.start()
    server.wait()