本文整理汇总了Python中oslo_service.service.launch方法的典型用法代码示例。如果您正苦于以下问题:Python service.launch方法的具体用法?Python service.launch怎么用?Python service.launch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oslo_service.service
的用法示例。
在下文中一共展示了service.launch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
zun_service.prepare_service(sys.argv)
LOG.info('Starting server in PID %s', os.getpid())
CONF.log_opt_values(LOG, logging.DEBUG)
CONF.import_opt('topic', 'zun.conf.compute', group='compute')
from zun.compute import manager as compute_manager
endpoints = [
compute_manager.Manager(),
]
server = rpc_service.Service.create(CONF.compute.topic, CONF.host,
endpoints, binary='zun-compute')
launcher = service.launch(CONF, server, restart_method='mutate')
launcher.wait()
示例2: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
"""F5 LBaaS agent for OpenStack."""
cfg.CONF.register_opts(OPTS)
cfg.CONF.register_opts(manager.OPTS)
cfg.CONF.register_opts(interface.OPTS)
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
common_config.init(sys.argv[1:])
# alias for common_config.setup_logging()...
config.setup_logging()
mgr = manager.LbaasAgentManager(cfg.CONF)
svc = F5AgentService(
host=mgr.agent_host,
topic=f5constants.TOPIC_LOADBALANCER_AGENT_V2,
manager=mgr
)
service.launch(cfg.CONF, svc).wait()
示例3: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
try:
CONF = config.CONF
# Import and configure logging.
log.setup(CONF, 'barbican')
LOG = log.getLogger(__name__)
LOG.debug("Booting up Barbican worker node...")
# Queuing initialization
queue.init(CONF)
service.launch(
CONF,
server.TaskServer(),
workers=CONF.queue.asynchronous_workers
).wait()
except RuntimeError as e:
fail(1, e)
示例4: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
try:
CONF = config.CONF
# Import and configure logging.
log.setup(CONF, 'barbican-retry-scheduler')
LOG = log.getLogger(__name__)
LOG.debug("Booting up Barbican worker retry/scheduler node...")
# Queuing initialization (as a client only).
queue.init(CONF, is_server_side=False)
service.launch(
CONF,
retry_scheduler.PeriodicServer()
).wait()
except RuntimeError as e:
fail(1, e)
示例5: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
# the configuration will be read into the cfg.CONF global data structure
config.init(sys.argv[1:])
objects.register_all()
if not cfg.CONF.config_file:
sys.exit(_("ERROR: Unable to find configuration file via the default"
" search paths (~/.tacker/, ~/, /etc/tacker/, /etc/) and"
" the '--config-file' option!"))
try:
tacker_api = service.serve_wsgi(service.TackerApiService)
launcher = common_service.launch(cfg.CONF, tacker_api,
workers=cfg.CONF.api_workers or None,
restart_method='mutate')
launcher.wait()
except KeyboardInterrupt:
pass
except RuntimeError as e:
sys.exit(_("ERROR: %s") % e)
示例6: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
try:
CONF = config.CONF
CONF(sys.argv[1:], project='barbican',
version=version.version_info.version_string)
# Import and configure logging.
log.setup(CONF, 'barbican')
LOG = log.getLogger(__name__)
LOG.debug("Booting up Barbican worker node...")
# Queuing initialization
queue.init(CONF)
service.launch(
CONF,
server.TaskServer(),
workers=CONF.queue.asynchronous_workers,
restart_method='mutate'
).wait()
except RuntimeError as e:
fail(1, e)
示例7: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
try:
CONF = config.CONF
CONF(sys.argv[1:], project='barbican',
version=version.version_info.version_string)
# Import and configure logging.
log.setup(CONF, 'barbican-retry-scheduler')
LOG = log.getLogger(__name__)
LOG.debug("Booting up Barbican worker retry/scheduler node...")
# Queuing initialization (as a client only).
queue.init(CONF, is_server_side=False)
service.launch(
CONF,
retry_scheduler.PeriodicServer(),
restart_method='mutate'
).wait()
except RuntimeError as e:
fail(1, e)
示例8: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
config.parse_args(sys.argv, 'senlin-conductor')
logging.setup(CONF, 'senlin-conductor')
logging.set_defaults()
gmr.TextGuruMeditation.setup_autorun(version)
objects.register_all()
messaging.setup()
from senlin.conductor import service as conductor
profiler.setup('senlin-conductor', CONF.host)
srv = conductor.ConductorService(CONF.host, consts.CONDUCTOR_TOPIC)
launcher = service.launch(CONF, srv,
workers=CONF.conductor.workers,
restart_method='mutate')
# the following periodic tasks are intended serve as HA checking
# srv.create_periodic_tasks()
launcher.wait()
示例9: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
config.parse_args(sys.argv, 'senlin-engine')
logging.setup(CONF, 'senlin-engine')
logging.set_defaults()
gmr.TextGuruMeditation.setup_autorun(version)
objects.register_all()
messaging.setup()
from senlin.engine import service as engine
profiler.setup('senlin-engine', CONF.host)
srv = engine.EngineService(CONF.host,
consts.ENGINE_TOPIC)
launcher = service.launch(CONF, srv,
workers=CONF.engine.workers,
restart_method='mutate')
launcher.wait()
示例10: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
config.parse_args(sys.argv, 'senlin-health-manager')
logging.setup(CONF, 'senlin-health-manager')
logging.set_defaults()
gmr.TextGuruMeditation.setup_autorun(version)
objects.register_all()
messaging.setup()
from senlin.health_manager import service as health_manager
profiler.setup('senlin-health-manager', CONF.host)
srv = health_manager.HealthManagerService(CONF.host,
consts.HEALTH_MANAGER_TOPIC)
launcher = service.launch(CONF, srv,
workers=CONF.health_manager.workers,
restart_method='mutate')
launcher.wait()
示例11: serve
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def serve(server, workers=None):
global _launcher
if _launcher:
raise RuntimeError(_('serve() can only be called once'))
_launcher = service.launch(CONF, server, workers=workers)
示例12: start
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def start():
urllib3.disable_warnings()
config.init(sys.argv[1:])
config.setup_logging()
clients.setup_clients()
os_vif.initialize()
kuryrk8s_launcher = service.launch(config.CONF, KuryrK8sService())
kuryrk8s_launcher.wait()
示例13: serve
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def serve(server, workers=None):
global _launcher
if _launcher:
raise RuntimeError(_('serve() can only be called once'))
_launcher = service.launch(CONF, server, workers=workers,
restart_method='mutate')
示例14: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
register_options()
common_config.init(sys.argv[1:])
config.setup_logging()
server = neutron_service.Service.create(
binary='neutron-bgp-dragent',
topic=bgp_consts.BGP_DRAGENT,
report_interval=cfg.CONF.AGENT.report_interval,
manager='neutron_dynamic_routing.services.bgp.agent.bgp_dragent.'
'BgpDrAgentWithStateReport')
service.launch(cfg.CONF, server, restart_method='mutate').wait()
示例15: main
# 需要导入模块: from oslo_service import service [as 别名]
# 或者: from oslo_service.service import launch [as 别名]
def main():
config.register_ovsdb_opts_helper(cfg.CONF)
agent_config.register_agent_state_opts_helper(cfg.CONF)
common_config.init(sys.argv[1:])
config.setup_logging()
mgr = manager.OVSDBManager(cfg.CONF)
svc = L2gatewayAgentService(
host=cfg.CONF.host,
topic=topics.L2GATEWAY_AGENT,
manager=mgr
)
service.launch(cfg.CONF, svc).wait()