本文整理匯總了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()