Пример #1
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")

    if not CONF.cells.enable:
        LOG.error('Nova network is deprecated and not supported '
                  'except as required for CellsV1 deployments.')
        return 1

    utils.monkey_patch()
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    cmd_common.block_db_access('nova-network')
    objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()

    LOG.warning('Nova network is deprecated and will be removed '
                'in the future')
    server = service.Service.create(binary='nova-network',
                                    topic=network_rpcapi.RPC_TOPIC,
                                    manager=CONF.network_manager)
    service.serve(server)
    service.wait()
Пример #2
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")

    # NOTE(stephenfin): Yes, this is silly, but the whole thing is being
    # removed and we want to make the diff in individual changes as small as
    # possible
    if True:
        LOG.error('Nova network is deprecated and not supported '
                  'except as required for CellsV1 deployments.')
        return 1

    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    cmd_common.block_db_access('nova-network')
    objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()

    LOG.warning('Nova network is deprecated and will be removed '
                'in the future')
    server = service.Service.create(binary='nova-network',
                                    topic=network_rpcapi.RPC_TOPIC,
                                    manager=CONF.network_manager)
    service.serve(server)
    service.wait()
Пример #3
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    if 'osapi_compute' in CONF.enabled_apis:
        # NOTE(mriedem): This is needed for caching the nova-compute service
        # version.
        objects.Service.enable_min_version_cache()
    log = logging.getLogger(__name__)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    launcher = service.process_launcher()
    started = 0
    for api in CONF.enabled_apis:
        should_use_ssl = api in CONF.enabled_ssl_apis
        try:
            server = service.WSGIService(api, use_ssl=should_use_ssl)
            launcher.launch_service(server, workers=server.workers or 1)
            started += 1
        except exception.PasteAppNotFound as ex:
            log.warning(
                "%s. ``enabled_apis`` includes bad values. "
                "Fix to remove this warning.", ex)

    if started == 0:
        log.error('No APIs were started. '
                  'Check the enabled_apis config option.')
        sys.exit(1)

    launcher.wait()
Пример #4
0
def setup_app(pecan_config=None, extra_hooks=None):
    if not pecan_config:
        pecan_config = get_pecan_config()
    pecan.configuration.set_config(dict(pecan_config), overwrite=True)

    gmr_opts.set_defaults(cfg.CONF)
    gmr.TextGuruMeditation.setup_autorun(version, conf=cfg.CONF)

    app_hooks = [hooks.ConfigHook(),
                 hooks.DBHook(),
                 hooks.EngineAPIHook(),
                 hooks.ContextHook(pecan_config.app.acl_public_routes),
                 hooks.NoExceptionTracebackHook(),
                 hooks.PublicUrlHook()]
    if extra_hooks:
        app_hooks.extend(extra_hooks)

    app = pecan.make_app(
        pecan_config.app.root,
        static_root=pecan_config.app.static_root,
        debug=False,
        force_canonical=getattr(pecan_config.app, 'force_canonical', True),
        hooks=app_hooks,
        wrap_app=middleware.ParsableErrorMiddleware,
    )

    app = auth_token.AuthTokenMiddleware(
        app, dict(cfg.CONF),
        public_api_routes=pecan_config.app.acl_public_routes)

    return app
Пример #5
0
def main():
    # NOTE(lucasagomes): Safeguard to prevent 'ironic.conductor.manager'
    # from being imported prior to the configuration options being loaded.
    # If this happened, the periodic decorators would always use the
    # default values of the options instead of the configured ones. For
    # more information see: https://bugs.launchpad.net/ironic/+bug/1562258
    # and https://bugs.launchpad.net/ironic/+bug/1279774.
    assert 'ironic.conductor.manager' not in sys.modules

    # Parse config file and command line options, then start logging
    ironic_service.prepare_service(sys.argv)

    if gmr is not None:
        gmr_opts.set_defaults(CONF)
        gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    else:
        LOG.debug('Guru meditation reporting is disabled '
                  'because oslo.reports is not installed')

    mgr = rpc_service.RPCService(CONF.host, 'ironic.conductor.manager',
                                 'ConductorManager')

    issue_startup_warnings(CONF)

    profiler.setup('ironic_conductor', CONF.host)

    launcher = service.launch(CONF, mgr, restart_method='mutate')
    launcher.wait()
Пример #6
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project="cinder", version=version.version_string())
    config.set_middleware_defaults()
    logging.setup(CONF, "cinder")
    LOG = logging.getLogger("cinder.all")
    versionutils.report_deprecated_feature(LOG, _("cinder-all is deprecated in Newton and will be removed in Ocata."))

    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    rpc.init(CONF)

    launcher = service.process_launcher()
    # cinder-api
    try:
        server = service.WSGIService("osapi_volume")
        launcher.launch_service(server, workers=server.workers or 1)
    except (Exception, SystemExit):
        LOG.exception(_LE("Failed to load osapi_volume"))

    for binary in ["cinder-scheduler", "cinder-backup"]:
        try:
            launcher.launch_service(service.Service.create(binary=binary))
        except (Exception, SystemExit):
            LOG.exception(_LE("Failed to load %s"), binary)

    # cinder-volume
    try:
        if CONF.enabled_backends:
            for backend in CONF.enabled_backends:
                CONF.register_opt(volume_cmd.host_opt, group=backend)
                backend_host = getattr(CONF, backend).backend_host
                host = "%s@%s" % (backend_host or CONF.host, backend)
                server = service.Service.create(
                    host=host, service_name=backend, binary="cinder-volume", coordination=True
                )
                # Dispose of the whole DB connection pool here before
                # starting another process.  Otherwise we run into cases
                # where child processes share DB connections which results
                # in errors.
                session.dispose_engine()
                launcher.launch_service(server)
        else:
            LOG.warning(
                _LW(
                    "Configuration for cinder-volume does not specify "
                    '"enabled_backends", using DEFAULT as backend. '
                    "Support for DEFAULT section to configure drivers "
                    "will be removed in the next release."
                )
            )
            server = service.Service.create(binary="cinder-volume", coordination=True)
            launcher.launch_service(server)
    except (Exception, SystemExit):
        LOG.exception(_LE("Failed to load cinder-volume"))

    launcher.wait()
Пример #7
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder',
         version=version.version_string())
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    global LOG
    LOG = logging.getLogger(__name__)

    if not CONF.enabled_backends:
        LOG.error('Configuration for cinder-volume does not specify '
                  '"enabled_backends". Using DEFAULT section to configure '
                  'drivers is not supported since Ocata.')
        sys.exit(1)

    if os.name == 'nt':
        # We cannot use oslo.service to spawn multiple services on Windows.
        # It relies on forking, which is not available on Windows.
        # Furthermore, service objects are unmarshallable objects that are
        # passed to subprocesses.
        _launch_services_win32()
    else:
        _launch_services_posix()
Пример #8
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder',
         version=version.version_string())
    logging.set_defaults(
        default_log_levels=logging.get_default_log_levels() +
        _EXTRA_DEFAULT_LOG_LEVELS)
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    global LOG
    LOG = logging.getLogger(__name__)

    if CONF.backup_workers > 1:
        LOG.info('Backup running with %s processes.', CONF.backup_workers)
        launcher = service.get_launcher()

        for i in range(CONF.backup_workers):
            _launch_backup_process(launcher, i)

        launcher.wait()
    else:
        LOG.info('Backup running in single process mode.')
        server = service.Service.create(binary='cinder-backup',
                                        coordination=True,
                                        process_number=1)
        service.serve(server)
        service.wait()
Пример #9
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder', version=version.version_string())
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    global LOG
    LOG = logging.getLogger(__name__)

    if not CONF.enabled_backends:
        LOG.error('Configuration for cinder-volume does not specify '
                  '"enabled_backends". Using DEFAULT section to configure '
                  'drivers is not supported since Ocata.')
        sys.exit(1)

    if os.name == 'nt':
        # We cannot use oslo.service to spawn multiple services on Windows.
        # It relies on forking, which is not available on Windows.
        # Furthermore, service objects are unmarshallable objects that are
        # passed to subprocesses.
        _launch_services_win32()
    else:
        _launch_services_posix()
Пример #10
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder',
         version=version.version_string())
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    launcher = service.get_launcher()
    LOG = logging.getLogger(__name__)
    service_started = False

    if CONF.enabled_backends:
        for backend in filter(None, CONF.enabled_backends):
            CONF.register_opt(host_opt, group=backend)
            backend_host = getattr(CONF, backend).backend_host
            host = "%s@%s" % (backend_host or CONF.host, backend)
            # We also want to set cluster to None on empty strings, and we
            # ignore leading and trailing spaces.
            cluster = CONF.cluster and CONF.cluster.strip()
            cluster = (cluster or None) and '%s@%s' % (cluster, backend)
            try:
                server = service.Service.create(host=host,
                                                service_name=backend,
                                                binary='cinder-volume',
                                                coordination=True,
                                                cluster=cluster)
            except Exception:
                msg = _('Volume service %s failed to start.') % host
                LOG.exception(msg)
            else:
                # Dispose of the whole DB connection pool here before
                # starting another process.  Otherwise we run into cases where
                # child processes share DB connections which results in errors.
                session.dispose_engine()
                launcher.launch_service(server)
                service_started = True
    else:
        LOG.warning(_LW('Configuration for cinder-volume does not specify '
                        '"enabled_backends", using DEFAULT as backend. '
                        'Support for DEFAULT section to configure drivers '
                        'will be removed in the next release.'))
        server = service.Service.create(binary='cinder-volume',
                                        coordination=True,
                                        cluster=CONF.cluster)
        launcher.launch_service(server)
        service_started = True

    if not service_started:
        msg = _('No volume service(s) started successfully, terminating.')
        LOG.error(msg)
        sys.exit(1)

    launcher.wait()
Пример #11
0
def main():
    config.parse_args(sys.argv)
    logging.setup(config.CONF, "nova")
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    wsgi_server = xvp_proxy.get_wsgi_server()
    service.serve(wsgi_server)
    service.wait()
Пример #12
0
def main():
    log.register_options(CONF)
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='manila', version=version.version_string())
    log.setup(CONF, "manila")
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    server = service.Service.create(binary='manila-data')
    service.serve(server)
    service.wait()
Пример #13
0
def main():
    config.parse_args(sys.argv)
    logging.setup(config.CONF, "nova")
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    wsgi_server = xvp_proxy.get_wsgi_server()
    service.serve(wsgi_server)
    service.wait()
Пример #14
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder',
         version=version.version_string())
    config.set_middleware_defaults()
    logging.setup(CONF, "cinder")
    LOG = logging.getLogger('cinder.all')
    versionutils.report_deprecated_feature(LOG, _(
        'cinder-all is deprecated in Newton and will be removed in Ocata.'))

    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    rpc.init(CONF)

    launcher = service.process_launcher()
    # cinder-api
    try:
        server = service.WSGIService('osapi_volume')
        launcher.launch_service(server, workers=server.workers or 1)
    except (Exception, SystemExit):
        LOG.exception(_LE('Failed to load osapi_volume'))

    for binary in ['cinder-scheduler', 'cinder-backup']:
        try:
            launcher.launch_service(service.Service.create(binary=binary))
        except (Exception, SystemExit):
            LOG.exception(_LE('Failed to load %s'), binary)

    # cinder-volume
    try:
        if CONF.enabled_backends:
            for backend in CONF.enabled_backends:
                CONF.register_opt(volume_cmd.host_opt, group=backend)
                backend_host = getattr(CONF, backend).backend_host
                host = "%s@%s" % (backend_host or CONF.host, backend)
                server = service.Service.create(host=host,
                                                service_name=backend,
                                                binary='cinder-volume')
                # Dispose of the whole DB connection pool here before
                # starting another process.  Otherwise we run into cases
                # where child processes share DB connections which results
                # in errors.
                session.dispose_engine()
                launcher.launch_service(server)
        else:
            server = service.Service.create(binary='cinder-volume')
            launcher.launch_service(server)
    except (Exception, SystemExit):
        LOG.exception(_LE('Failed to load conder-volume'))

    launcher.wait()
Пример #15
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder',
         version=version.version_string())
    config.set_middleware_defaults()
    logging.setup(CONF, "cinder")
    LOG = logging.getLogger('cinder.all')
    versionutils.report_deprecated_feature(LOG, _(
        'cinder-all is deprecated in Newton and will be removed in Ocata.'))

    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    rpc.init(CONF)

    launcher = service.process_launcher()
    # cinder-api
    try:
        server = service.WSGIService('osapi_volume')
        launcher.launch_service(server, workers=server.workers or 1)
    except (Exception, SystemExit):
        LOG.exception(_LE('Failed to load osapi_volume'))

    for binary in ['cinder-scheduler', 'cinder-backup']:
        try:
            launcher.launch_service(service.Service.create(binary=binary))
        except (Exception, SystemExit):
            LOG.exception(_LE('Failed to load %s'), binary)

    # cinder-volume
    try:
        if CONF.enabled_backends:
            for backend in CONF.enabled_backends:
                CONF.register_opt(volume_cmd.host_opt, group=backend)
                backend_host = getattr(CONF, backend).backend_host
                host = "%s@%s" % (backend_host or CONF.host, backend)
                server = service.Service.create(host=host,
                                                service_name=backend,
                                                binary='cinder-volume')
                # Dispose of the whole DB connection pool here before
                # starting another process.  Otherwise we run into cases
                # where child processes share DB connections which results
                # in errors.
                session.dispose_engine()
                launcher.launch_service(server)
        else:
            server = service.Service.create(binary='cinder-volume')
            launcher.launch_service(server)
    except (Exception, SystemExit):
        LOG.exception(_LE('Failed to load cinder-volume'))

    launcher.wait()
Пример #16
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder', version=version.version_string())
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    server = service.Service.create(binary='cinder-scheduler')
    service.serve(server)
    service.wait()
Пример #17
0
def parse_args(argv, default_config_files=None):
    log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS)
    log.register_options(CONF)
    gmr_opts.set_defaults(CONF)
    rpc.set_defaults(control_exchange='miper')
    CONF(argv[1:],
         project='miper',
         version='0.0.2',
         default_config_files=default_config_files)
    gmr.TextGuruMeditation.setup_autorun('0.0.2', conf=CONF)
    rpc.init(CONF)
Пример #18
0
def main():
    log.register_options(CONF)
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='manila',
         version=version.version_string())
    log.setup(CONF, "manila")
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    server = service.Service.create(binary='manila-data')
    service.serve(server)
    service.wait()
Пример #19
0
def prepare_service(argv=(), conf=cfg.CONF):
    log.register_options(conf)
    gmr_opts.set_defaults(conf)

    config.parse_args(argv)
    cfg.set_defaults(_options.log_opts, default_log_levels=_DEFAULT_LOG_LEVELS)
    log.setup(conf, 'python-watcher')
    conf.log_opt_values(LOG, logging.DEBUG)

    gmr.TextGuruMeditation.register_section(_('Plugins'), opts.show_plugins)
    gmr.TextGuruMeditation.setup_autorun(version, conf=conf)
Пример #20
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    server = service.Service.create(binary='nova-console',
                                    topic=console_rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
Пример #21
0
def main():
    gmr_opts.set_defaults(CONF)
    # Parse config file and command line options, then start logging
    mogan_service.prepare_service(sys.argv)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    mgr = mogan_service.RPCService('mogan.engine.manager', 'EngineManager',
                                   constants.ENGINE_TOPIC)

    launcher = service.launch(CONF, mgr)
    launcher.wait()
Пример #22
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder',
         version=version.version_string())
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    server = service.Service.create(binary='cinder-backup')
    service.serve(server)
    service.wait()
Пример #23
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    server = service.Service.create(binary='nova-console',
                                    topic=console_rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
Пример #24
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder', version=version.version_string())
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    server = service.Service.create(binary='cinder-backup')
    service.serve(server)
    service.wait()
Пример #25
0
def run():
    # Use the global CONF instance
    conf = cfg.CONF
    gmr_opts.set_defaults(conf)
    # NOTE(eggmaster): register command line options for zaqar-server
    conf.register_cli_opts(_CLI_OPTIONS)
    log.register_options(conf)

    # NOTE(jeffrey4l): Overwrite the default vaule for
    # logging_context_format_string. Add project_id into it.
    conf.set_default(
        'logging_context_format_string',
        '%(asctime)s.%(msecs)03d %(process)d %(levelname)s'
        ' %(name)s [%(request_id)s %(user_identity)s]'
        ' [project_id:%(project_id)s] %(message)s')
    conf(project='zaqar', prog='zaqar-server')
    log.setup(conf, 'zaqar')

    gmr.TextGuruMeditation.setup_autorun(version, conf=conf)

    server = bootstrap.Bootstrap(conf)

    # The following code is to daemonize zaqar-server to avoid
    # an issue with wsgiref writing to stdout/stderr when we don't
    # want it to.  This is specifically needed to allow zaqar to
    # run under devstack, but it may also be useful for other scenarios.
    # Open /dev/zero and /dev/null for redirection.
    # Daemonizing zaqar-server is needed *just* when running under devstack
    # and when zaqar is invoked with `daemon` command line option.
    if conf.daemon:
        zerofd = os.open('/dev/zero', os.O_RDONLY)
        nullfd = os.open('/dev/null', os.O_WRONLY)

        # Close the stdthings and reassociate them with a non terminal
        os.dup2(zerofd, 0)
        os.dup2(nullfd, 1)
        os.dup2(nullfd, 2)

        # Detach process context, this requires 2 forks.
        try:
            pid = os.fork()
            if pid > 0:
                os._exit(0)
        except OSError:
            os._exit(1)

        try:
            pid = os.fork()
            if pid > 0:
                os._exit(0)
        except OSError:
            os._exit(2)
    server.run()
Пример #26
0
def main():
    gmr_opts.set_defaults(CONF)
    # Parse config file and command line options, then start logging
    mogan_service.prepare_service(sys.argv)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    # Build and start the WSGI app
    launcher = mogan_service.process_launcher()
    server = mogan_service.WSGIService('mogan_api', CONF.api.enable_ssl_api)
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Пример #27
0
def prepare_service(argv=(), conf=cfg.CONF):
    log.register_options(conf)
    gmr_opts.set_defaults(conf)

    config.parse_args(argv)
    cfg.set_defaults(_options.log_opts,
                     default_log_levels=_DEFAULT_LOG_LEVELS)
    log.setup(conf, 'python-watcher')
    conf.log_opt_values(LOG, logging.DEBUG)

    gmr.TextGuruMeditation.register_section(_('Plugins'), opts.show_plugins)
    gmr.TextGuruMeditation.setup_autorun(version)
Пример #28
0
def main():
    log.register_options(CONF)
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='manila', version=version.version_string())
    config.verify_share_protocols()
    log.setup(CONF, "manila")
    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    launcher = service.process_launcher()
    server = service.WSGIService('osapi_share')
    launcher.launch_service(server, workers=server.workers or 1)
    launcher.wait()
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()

    should_use_ssl = 'metadata' in CONF.enabled_ssl_apis
    server = service.WSGIService('metadata', use_ssl=should_use_ssl)
    service.serve(server, workers=server.workers)
    service.wait()
Пример #30
0
def main():
    log.register_options(CONF)
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='manila',
         version=version.version_string())
    config.verify_share_protocols()
    log.setup(CONF, "manila")
    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    launcher = service.process_launcher()
    server = service.WSGIService('osapi_share')
    launcher.launch_service(server, workers=server.workers or 1)
    launcher.wait()
Пример #31
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    utils.monkey_patch()
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    objects.Service.enable_min_version_cache()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    server = service.Service.create(binary='nova-scheduler',
                                    topic=scheduler_rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
Пример #32
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    objects.Service.enable_min_version_cache()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    server = service.Service.create(binary='nova-conductor',
                                    topic=rpcapi.RPC_TOPIC)
    workers = CONF.conductor.workers or processutils.get_worker_count()
    service.serve(server, workers=workers)
    service.wait()
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    objects.Service.enable_min_version_cache()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    server = service.Service.create(binary='nova-conductor',
                                    topic=rpcapi.RPC_TOPIC)
    workers = CONF.conductor.workers or processutils.get_worker_count()
    service.serve(server, workers=workers)
    service.wait()
Пример #34
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, 'nova')
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    LOG.warning('Cells v1 is deprecated in favor of Cells v2 and will be '
                'removed in the future.')
    server = service.Service.create(binary='nova-cells',
                                    topic=cells.TOPIC,
                                    manager='nova.cells.manager.CellsManager')
    service.serve(server)
    service.wait()
Пример #35
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    # NOTE(mriedem): This is needed for caching the nova-compute service
    # version.
    objects.Service.enable_min_version_cache()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    should_use_ssl = 'osapi_compute' in CONF.enabled_ssl_apis
    server = service.WSGIService('osapi_compute', use_ssl=should_use_ssl)
    service.serve(server, workers=server.workers)
    service.wait()
Пример #36
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, 'nova')
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    LOG.warning('Cells v1 is deprecated in favor of Cells v2 and will be '
                'removed in the future.')
    server = service.Service.create(binary='nova-cells',
                                    topic=cells.TOPIC,
                                    manager='nova.cells.manager.CellsManager')
    service.serve(server)
    service.wait()
Пример #37
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    # NOTE(mriedem): This is needed for caching the nova-compute service
    # version.
    objects.Service.enable_min_version_cache()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    should_use_ssl = 'osapi_compute' in CONF.enabled_ssl_apis
    server = service.WSGIService('osapi_compute', use_ssl=should_use_ssl)
    service.serve(server, workers=server.workers)
    service.wait()
Пример #38
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    LOG.warning('The nova-consoleauth service is deprecated as console token '
                'authorization storage has moved from the nova-consoleauth '
                'service backend to the database backend.')

    server = service.Service.create(binary='nova-consoleauth',
                                    topic=rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
Пример #39
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder',
         version=version.version_string())
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    rpc.init(CONF)
    launcher = service.process_launcher()
    server = service.WSGIService('osapi_volume')
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Пример #40
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder', version=version.version_string())
    config.set_middleware_defaults()
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    rpc.init(CONF)
    launcher = service.process_launcher()
    server = service.WSGIService('osapi_volume')
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Пример #41
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    LOG.warning('The nova-consoleauth service is deprecated as console token '
                'authorization storage has moved from the nova-consoleauth '
                'service backend to the database backend.')

    server = service.Service.create(binary='nova-consoleauth',
                                    topic=rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    LOG.warning('The nova-console service is deprecated as it is Xen '
                'specific, does not function properly in a multi-cell '
                'environment, and has effectively been replaced by noVNC '
                'and the nova-novncproxy service.')

    server = service.Service.create(binary='nova-console',
                                    topic=console_rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
Пример #43
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    objects.Service.enable_min_version_cache()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    server = service.Service.create(binary='nova-scheduler',
                                    topic=rpcapi.RPC_TOPIC)

    # Determine the number of workers; if not specified in config, default
    # to number of CPUs
    workers = CONF.scheduler.workers or processutils.get_worker_count()
    service.serve(server, workers=workers)
    service.wait()
Пример #44
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    LOG.warning('The nova-console service is deprecated as it is Xen '
                'specific, does not function properly in a multi-cell '
                'environment, and has effectively been replaced by noVNC '
                'and the nova-novncproxy service.')

    server = service.Service.create(binary='nova-console',
                                    topic=console_rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
Пример #45
0
def parse_args(argv, default_config_files=None, configure_db=True):
    log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS)
    log.register_options(CONF)
    gmr_opts.set_defaults(CONF)
    options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION,
                         sqlite_db='nova.sqlite')
    rpc.set_defaults(control_exchange='nova')
    debugger.register_cli_opts()
    CONF(argv[1:],
         project='nova',
         version=version.version_string(),
         default_config_files=default_config_files)
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    rpc.init(CONF)

    if configure_db:
        sqlalchemy_api.configure(CONF)
Пример #46
0
def main():
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='cinder',
         version=version.version_string())
    logging.setup(CONF, "cinder")
    python_logging.captureWarnings(True)
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    launcher = service.get_launcher()
    LOG = logging.getLogger(__name__)
    service_started = False

    if CONF.enabled_backends:
        for backend in CONF.enabled_backends:
            CONF.register_opt(host_opt, group=backend)
            backend_host = getattr(CONF, backend).backend_host
            host = "%s@%s" % (backend_host or CONF.host, backend)
            try:
                server = service.Service.create(host=host,
                                                service_name=backend,
                                                binary='cinder-volume',
                                                coordination=True)
            except Exception:
                msg = _('Volume service %s failed to start.') % host
                LOG.exception(msg)
            else:
                # Dispose of the whole DB connection pool here before
                # starting another process.  Otherwise we run into cases where
                # child processes share DB connections which results in errors.
                session.dispose_engine()
                launcher.launch_service(server)
                service_started = True
    else:
        server = service.Service.create(binary='cinder-volume',
                                        coordination=True)
        launcher.launch_service(server)
        service_started = True

    if not service_started:
        msg = _('No volume service(s) started successfully, terminating.')
        LOG.error(msg)
        sys.exit(1)

    launcher.wait()
Пример #47
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, 'nova')
    priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    # Ensure os-vif objects are registered and plugins loaded
    os_vif.initialize()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    cmd_common.block_db_access('nova-compute')
    objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()
    objects.Service.enable_min_version_cache()
    server = service.Service.create(binary='nova-compute',
                                    topic=compute_rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
Пример #48
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, 'nova')
    priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    # Ensure os-vif objects are registered and plugins loaded
    os_vif.initialize()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    cmd_common.block_db_access('nova-compute')
    objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()
    objects.Service.enable_min_version_cache()
    server = service.Service.create(binary='nova-compute',
                                    topic=compute_rpcapi.RPC_TOPIC)
    service.serve(server)
    service.wait()
Пример #49
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    objects.register_all()
    gmr_opts.set_defaults(CONF)
    objects.Service.enable_min_version_cache()

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    server = service.Service.create(binary='nova-scheduler',
                                    topic=scheduler_rpcapi.RPC_TOPIC)
    # Determine the number of workers; if not specified in config, default
    # to ncpu for the FilterScheduler and 1 for everything else.
    workers = CONF.scheduler.workers
    if not workers:
        workers = (processutils.get_worker_count()
                   if CONF.scheduler.driver == 'filter_scheduler' else 1)
    service.serve(server, workers=workers)
    service.wait()
Пример #50
0
def main():
    log.register_options(CONF)
    gmr_opts.set_defaults(CONF)
    CONF(sys.argv[1:], project='manila',
         version=version.version_string())
    log.setup(CONF, "manila")
    utils.monkey_patch()
    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
    launcher = service.process_launcher()
    if CONF.enabled_share_backends:
        for backend in CONF.enabled_share_backends:
            host = "%s@%s" % (CONF.host, backend)
            server = service.Service.create(host=host,
                                            service_name=backend,
                                            binary='manila-share',
                                            coordination=True)
            launcher.launch_service(server)
    else:
        server = service.Service.create(binary='manila-share')
        launcher.launch_service(server)
    launcher.wait()
Пример #51
0
def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")

    if not CONF.cells.enable:
        LOG.error('Nova network is deprecated and not supported '
                  'except as required for CellsV1 deployments.')
        return 1

    objects.register_all()
    gmr_opts.set_defaults(CONF)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    cmd_common.block_db_access('nova-network')
    objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()

    LOG.warning('Nova network is deprecated and will be removed '
                'in the future')
    server = service.Service.create(binary='nova-network',
                                    topic=network_rpcapi.RPC_TOPIC,
                                    manager=CONF.network_manager)
    service.serve(server)
    service.wait()
Пример #52
0
import sys

from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts

import nova.conf
from nova.conf import novnc
from nova.console import websocketproxy
from nova import objects
from nova import version


CONF = nova.conf.CONF
novnc.register_cli_opts(CONF)
gmr_opts.set_defaults(CONF)
objects.register_all()


def exit_with_error(msg, errno=-1):
    sys.stderr.write(msg + '\n')
    sys.exit(errno)


def proxy(host, port, security_proxy=None):
    """:param host: local address to listen on
    :param port: local port to listen on
    :param security_proxy: instance of
        nova.console.securityproxy.base.SecurityProxy

    Setup a proxy listening on @host:@port. If the
# needed to get greenthreads
import fixtures
import greenlet
import mock
from oslotest import base
import six

import oslo_config
from oslo_config import fixture
from oslo_reports import guru_meditation_report as gmr
from oslo_reports.models import with_default_views as mwdv
from oslo_reports import opts


CONF = oslo_config.cfg.CONF
opts.set_defaults(CONF)


class FakeVersionObj(object):
    def vendor_string(self):
        return 'Cheese Shoppe'

    def product_string(self):
        return 'Sharp Cheddar'

    def version_string_with_package(self):
        return '1.0.0'


def skip_body_lines(start_line, report_lines):
    curr_line = start_line
Пример #54
0
    $ gunicorn zaqar.transport.wsgi.app:app

NOTE: As for external containers, it is necessary
to put config files in the standard paths. There's
no common way to specify / pass configuration files
to the WSGI app when it is called from other apps.
"""

from oslo_config import cfg
from oslo_log import log
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts

from zaqar import bootstrap
from zaqar import version

# Use the global CONF instance
conf = cfg.CONF
gmr_opts.set_defaults(conf)
log.register_options(conf)
conf(project='zaqar', prog='zaqar-queues', args=[])
log.setup(conf, 'zaqar')

gmr.TextGuruMeditation.setup_autorun(version, conf=conf)

boot = bootstrap.Bootstrap(conf)
conf.drivers.transport = 'wsgi'
application = boot.transport.app
# Keep the old name for compatibility
app = application