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)
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()
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()
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()
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()
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()
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()
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()
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)
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()
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()