当前位置: 首页>>代码示例>>Python>>正文


Python service.launch方法代码示例

本文整理汇总了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() 
开发者ID:openstack,项目名称:zun,代码行数:20,代码来源:compute.py

示例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() 
开发者ID:F5Networks,项目名称:f5-openstack-agent,代码行数:23,代码来源:agent.py

示例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) 
开发者ID:cloud-security-research,项目名称:sgx-kms,代码行数:21,代码来源:worker.py

示例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) 
开发者ID:cloud-security-research,项目名称:sgx-kms,代码行数:20,代码来源:retry_scheduler.py

示例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) 
开发者ID:openstack,项目名称:tacker,代码行数:21,代码来源:tacker_server.py

示例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) 
开发者ID:openstack,项目名称:barbican,代码行数:24,代码来源:worker.py

示例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) 
开发者ID:openstack,项目名称:barbican,代码行数:23,代码来源:retry_scheduler.py

示例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() 
开发者ID:openstack,项目名称:senlin,代码行数:20,代码来源:conductor.py

示例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() 
开发者ID:openstack,项目名称:senlin,代码行数:19,代码来源:engine.py

示例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() 
开发者ID:openstack,项目名称:senlin,代码行数:19,代码来源:health_manager.py

示例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) 
开发者ID:openstack,项目名称:ec2-api,代码行数:8,代码来源:service.py

示例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() 
开发者ID:openstack,项目名称:kuryr-kubernetes,代码行数:10,代码来源:service.py

示例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') 
开发者ID:openstack,项目名称:designate,代码行数:9,代码来源:service.py

示例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() 
开发者ID:openstack,项目名称:neutron-dynamic-routing,代码行数:13,代码来源:entry.py

示例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() 
开发者ID:openstack,项目名称:networking-l2gw,代码行数:15,代码来源:l2gw_agent.py


注:本文中的oslo_service.service.launch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。