예제 #1
0
def launch(app_name,
           port,
           paste_config_file,
           data={},
           host='0.0.0.0',
           backlog=128,
           threads=1000,
           workers=None):
    """Launches a wsgi server based on the passed in paste_config_file.

      Launch provides a easy way to create a paste app from the config
      file and launch it via the service launcher. It takes care of
      all of the plumbing. The only caveat is that the paste_config_file
      must be a file that paste.deploy can find and handle. There is
      a helper method in cfg.py that finds files.

      Example:
        conf_file = CONF.find_file(CONF.api_paste_config)
        launcher = wsgi.launch('myapp', CONF.bind_port, conf_file)
        launcher.wait()

    """
    app = pastedeploy.paste_deploy_app(paste_config_file, app_name, data)
    server = openstack_wsgi.Service(app,
                                    port,
                                    host=host,
                                    backlog=backlog,
                                    threads=threads)
    return service.launch(server, workers)
예제 #2
0
파일: guest.py 프로젝트: CMSS-BCRDB/RDSV1.0
def main():
    cfg.parse_args(sys.argv)
    logging.setup(None)

    debug_utils.setup()

    # Patch 'thread' module if debug is disabled
    if not debug_utils.enabled():
        eventlet.monkey_patch(thread=True)

    from trove.guestagent import dbaas
    manager = dbaas.datastore_registry().get(CONF.datastore_manager)
    if not manager:
        msg = ("Manager class not registered for datastore manager %s" %
               CONF.datastore_manager)
        raise RuntimeError(msg)

    # rpc module must be loaded after decision about thread monkeypatching
    # because if thread module is not monkeypatched we can't use eventlet
    # executor from oslo.messaging library.
    from trove import rpc
    rpc.init(CONF)

    from trove.common.rpc import service as rpc_service
    from trove.common.rpc import version as rpc_version
    server = rpc_service.RpcService(
        manager=manager, host=CONF.guest_id,
        rpc_api_version=rpc_version.RPC_API_VERSION)

    launcher = openstack_service.launch(server)
    launcher.wait()
예제 #3
0
파일: guest.py 프로젝트: stanleykao72/trove
def main():
    cfg.parse_args(sys.argv)
    logging.setup(None)

    debug_utils.setup()

    # Patch 'thread' module if debug is disabled
    if not debug_utils.enabled():
        eventlet.monkey_patch(thread=True)

    from trove.guestagent import dbaas
    manager = dbaas.datastore_registry().get(CONF.datastore_manager)
    if not manager:
        msg = ("Manager class not registered for datastore manager %s" %
               CONF.datastore_manager)
        raise RuntimeError(msg)

    # rpc module must be loaded after decision about thread monkeypatching
    # because if thread module is not monkeypatched we can't use eventlet
    # executor from oslo.messaging library.
    from trove import rpc
    rpc.init(CONF)

    from trove.common.rpc import service as rpc_service
    from trove.common.rpc import version as rpc_version
    server = rpc_service.RpcService(
        manager=manager,
        host=CONF.guest_id,
        rpc_api_version=rpc_version.RPC_API_VERSION)

    launcher = openstack_service.launch(server)
    launcher.wait()
예제 #4
0
파일: conductor.py 프로젝트: bruceSz/trove
def launch_services():
    get_db_api().configure_db(CONF)
    manager = 'trove.conductor.manager.Manager'
    topic = CONF.conductor_queue
    server = rpc_service.RpcService(manager=manager, topic=topic)
    launcher = openstack_service.launch(server,
                                        workers=CONF.trove_conductor_workers)
    launcher.wait()
예제 #5
0
def startup(conf, topic):
    from trove.common.rpc import service as rpc_service
    from trove.openstack.common import service as openstack_service

    server = rpc_service.RpcService(manager=conf.taskmanager_manager,
                                    topic=topic)
    launcher = openstack_service.launch(server)
    launcher.wait()
예제 #6
0
def launch_services():
    get_db_api().configure_db(CONF)
    manager = 'trove.conductor.manager.Manager'
    topic = CONF.conductor_queue
    server = rpc_service.RpcService(manager=manager, topic=topic)
    launcher = openstack_service.launch(server,
                                        workers=CONF.trove_conductor_workers)
    launcher.wait()
예제 #7
0
def startup(conf, topic):
    from trove.common.rpc import service as rpc_service
    from trove.openstack.common import service as openstack_service

    server = rpc_service.RpcService(manager=conf.taskmanager_manager,
                                    topic=topic)
    launcher = openstack_service.launch(server)
    launcher.wait()
예제 #8
0
def startup(conf, topic):
    from trove.common.rpc import service as rpc_service
    from trove.common.rpc import version as rpc_version
    from trove.openstack.common import service as openstack_service

    server = rpc_service.RpcService(
        manager=conf.taskmanager_manager, topic=topic,
        rpc_api_version=rpc_version.RPC_API_VERSION)
    launcher = openstack_service.launch(server)
    launcher.wait()
예제 #9
0
파일: conductor.py 프로젝트: vdialani/trove
def main(conf):
    from trove.common.rpc import service as rpc_service
    from trove.openstack.common import service as openstack_service

    topic = conf.conductor_queue
    server = rpc_service.RpcService(manager=conf.conductor_manager,
                                    topic=topic)
    workers = conf.trove_conductor_workers or processutils.get_worker_count()
    launcher = openstack_service.launch(server, workers=workers)
    launcher.wait()
예제 #10
0
파일: conductor.py 프로젝트: glucas1/trove
def main(conf):
    from trove.common.rpc import service as rpc_service
    from trove.openstack.common import service as openstack_service

    manager = 'trove.conductor.manager.Manager'
    topic = conf.conductor_queue
    server = rpc_service.RpcService(manager=manager, topic=topic)
    launcher = openstack_service.launch(server,
                                        workers=conf.trove_conductor_workers)
    launcher.wait()
예제 #11
0
파일: guest.py 프로젝트: bruceSz/trove
def main():
    cfg.parse_args(sys.argv)
    from trove.guestagent import dbaas
    logging.setup(None)

    manager = dbaas.datastore_registry().get(CONF.datastore_manager)
    if not manager:
        msg = ("Manager class not registered for datastore manager %s" %
               CONF.datastore_manager)
        raise RuntimeError(msg)
    server = rpc_service.RpcService(manager=manager, host=CONF.guest_id)
    launcher = openstack_service.launch(server)
    launcher.wait()
예제 #12
0
파일: wsgi.py 프로젝트: jeredding/trove
def launch(app_name, port, paste_config_file, data={}, host="0.0.0.0", backlog=128, threads=1000, workers=None):
    """Launches a wsgi server based on the passed in paste_config_file.

      Launch provides a easy way to create a paste app from the config
      file and launch it via the service launcher. It takes care of
      all of the plumbing. The only caveat is that the paste_config_file
      must be a file that paste.deploy can find and handle. There is
      a helper method in cfg.py that finds files.

      Example:
        conf_file = CONF.find_file(CONF.api_paste_config)
        launcher = wsgi.launch('myapp', CONF.bind_port, conf_file)
        launcher.wait()

    """
    app = pastedeploy.paste_deploy_app(paste_config_file, app_name, data)
    server = openstack_wsgi.Service(app, port, host=host, backlog=backlog, threads=threads)
    return service.launch(server, workers)
예제 #13
0
def main():
    cfg.parse_args(sys.argv)
    from trove.guestagent import dbaas
    logging.setup(None)

    debug_utils.setup()

    # Patch 'thread' module if debug is disabled
    if not debug_utils.enabled():
        eventlet.monkey_patch(thread=True)

    manager = dbaas.datastore_registry().get(CONF.datastore_manager)
    if not manager:
        msg = ("Manager class not registered for datastore manager %s" %
               CONF.datastore_manager)
        raise RuntimeError(msg)
    server = rpc_service.RpcService(manager=manager, host=CONF.guest_id)
    launcher = openstack_service.launch(server)
    launcher.wait()
예제 #14
0
def main():
    cfg.parse_args(sys.argv)
    from trove.guestagent import dbaas
    logging.setup(None)

    debug_utils.setup()

    # Patch 'thread' module if debug is disabled
    if not debug_utils.enabled():
        eventlet.monkey_patch(thread=True)

    manager = dbaas.datastore_registry().get(CONF.datastore_manager)
    if not manager:
        msg = ("Manager class not registered for datastore manager %s" %
               CONF.datastore_manager)
        raise RuntimeError(msg)
    server = rpc_service.RpcService(manager=manager, host=CONF.guest_id)
    launcher = openstack_service.launch(server)
    launcher.wait()
예제 #15
0
def startup(topic):
    cfg.parse_args(sys.argv)
    logging.setup(None)

    debug_utils.setup()

    # Patch 'thread' module if debug is disabled
    if not debug_utils.enabled():
        eventlet.monkey_patch(thread=True)

    from trove.common.rpc import service as rpc_service
    from trove.openstack.common import service as openstack_service
    from trove.db import get_db_api

    get_db_api().configure_db(CONF)
    server = rpc_service.RpcService(manager=CONF.taskmanager_manager,
                                    topic=topic)
    launcher = openstack_service.launch(server)
    launcher.wait()