Example #1
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.TextGuruMeditation.setup_autorun(version)
    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()
Example #2
0
 def __init__(self, host, manager_module, manager_class):
     super(RPCService, self).__init__()
     self.host = host
     manager_module = importutils.try_import(manager_module)
     manager_class = getattr(manager_module, manager_class)
     self.manager = manager_class(host, manager_module.MANAGER_TOPIC)
     self.topic = self.manager.topic
     self.rpcserver = None
     self.deregister = True
     setup_profiler.setup('rpc', self.host)
Example #3
0
def main():
    # Parse config file and command line options, then start logging
    ironic_service.prepare_service(sys.argv)

    gmr.TextGuruMeditation.setup_autorun(version)

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

    # Build and start the WSGI app
    launcher = ironic_service.process_launcher()
    server = wsgi_service.WSGIService('ironic_api', CONF.api.enable_ssl_api)
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Example #4
0
def main():
    # Parse config file and command line options, then start logging
    ironic_service.prepare_service(sys.argv)

    # Enable object backporting via the conductor
    base.IronicObject.indirection_api = base.IronicObjectIndirectionAPI()

    setup_profiler.setup('ironic-api', CONF.host)

    # Build and start the WSGI app
    launcher = ironic_service.process_launcher()
    server = ironic_service.WSGIService('ironic_api', CONF.api.enable_ssl_api)
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Example #5
0
def main():
    # Parse config file and command line options, then start logging
    ironic_service.prepare_service(sys.argv)

    setup_profiler.setup('rpc', CONF.host)

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

    LOG = log.getLogger(__name__)
    LOG.debug("Configuration:")
    CONF.log_opt_values(LOG, log.DEBUG)

    launcher = service.launch(CONF, mgr)
    launcher.wait()
Example #6
0
def main():
    # Parse config file and command line options, then start logging
    ironic_service.prepare_service(sys.argv)

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

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

    # Build and start the WSGI app
    launcher = ironic_service.process_launcher()
    server = wsgi_service.WSGIService('ironic_api', CONF.api.enable_ssl_api)
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Example #7
0
def main():
    # Parse config file and command line options, then start logging
    ironic_service.prepare_service(sys.argv)

    gmr.TextGuruMeditation.setup_autorun(version)

    # Enable object backporting via the conductor
    base.IronicObject.indirection_api = (
        indirection.IronicObjectIndirectionAPI())

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

    # Build and start the WSGI app
    launcher = ironic_service.process_launcher()
    server = wsgi_service.WSGIService('ironic_api', CONF.api.enable_ssl_api)
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Example #8
0
    def __init__(self, name, use_ssl=False):
        """Initialize, but do not start the WSGI server.

        :param name: The name of the WSGI server given to the loader.
        :param use_ssl: Wraps the socket in an SSL context if True.
        :returns: None
        """
        self.name = name
        self.app = app.VersionSelectorApplication()
        self.workers = (CONF.api.api_workers or
                        processutils.get_worker_count())

        setup_profiler.setup(name, CONF.host)

        if self.workers and self.workers < 1:
            raise exception.ConfigInvalid(
                _("api_workers value of %d is invalid, "
                  "must be greater than 0.") % self.workers)

        self.server = wsgi.Server(CONF, name, self.app,
                                  host=CONF.api.host_ip,
                                  port=CONF.api.port,
                                  use_ssl=use_ssl)
Example #9
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)

    gmr.TextGuruMeditation.setup_autorun(version)

    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)
    launcher.wait()