當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。