Пример #1
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='heat', prog='heat-engine',
             version=version.version_info.version_string())
    logging.setup(cfg.CONF, 'heat-engine')
    logging.set_defaults()
    messaging.setup()

    config.startup_sanity_check()

    mgr = None
    try:
        mgr = template._get_template_extension_manager()
    except template.TemplatePluginNotRegistered as ex:
        LOG.critical(_LC("%s"), ex)
    if not mgr or not mgr.names():
        sys.exit("ERROR: No template format plugins registered")

    from heat.engine import service as engine  # noqa

    profiler.setup('heat-engine', cfg.CONF.host)
    gmr.TextGuruMeditation.setup_autorun(version)
    srv = engine.EngineService(cfg.CONF.host, rpc_api.ENGINE_TOPIC)
    workers = cfg.CONF.num_engine_workers
    if not workers:
        workers = max(4, processutils.get_worker_count())

    launcher = service.launch(cfg.CONF, srv, workers=workers)
    if cfg.CONF.enable_cloud_watch_lite:
        # We create the periodic tasks here, which mean they are created
        # only in the parent process when num_engine_workers>1 is specified
        srv.create_periodic_tasks()
    launcher.wait()
Пример #2
0
def main():
    try:
        logging.register_options(cfg.CONF)
        cfg.CONF(project='heat',
                 prog='heat-api-cloudwatch',
                 version=version.version_info.version_string())
        logging.setup(cfg.CONF, 'heat-api-cloudwatch')
        logging.set_defaults()
        messaging.setup()

        app = config.load_paste_app()

        port = cfg.CONF.heat_api_cloudwatch.bind_port
        host = cfg.CONF.heat_api_cloudwatch.bind_host
        LOG.info(_LI('Starting Heat CloudWatch API on %(host)s:%(port)s'),
                 {'host': host, 'port': port})
        profiler.setup('heat-api-cloudwatch', host)
        gmr.TextGuruMeditation.setup_autorun(version)
        server = wsgi.Server('heat-api-cloudwatch',
                             cfg.CONF.heat_api_cloudwatch)
        server.start(app, default_port=port)
        systemd.notify_once()
        server.wait()
    except RuntimeError as e:
        msg = six.text_type(e)
        sys.exit("ERROR: %s" % msg)
Пример #3
0
def launch_engine(setup_logging=True):
    if setup_logging:
        logging.register_options(cfg.CONF)
    cfg.CONF(project='heat', prog='heat-engine',
             version=version.version_info.version_string())
    if setup_logging:
        logging.setup(cfg.CONF, 'heat-engine')
        logging.set_defaults()
    messaging.setup()

    config.startup_sanity_check()

    mgr = None
    try:
        mgr = template._get_template_extension_manager()
    except template.TemplatePluginNotRegistered as ex:
        LOG.critical("%s", ex)
    if not mgr or not mgr.names():
        sys.exit("ERROR: No template format plugins registered")

    from heat.engine import service as engine  # noqa

    profiler.setup('heat-engine', cfg.CONF.host)
    gmr.TextGuruMeditation.setup_autorun(version)
    srv = engine.EngineService(cfg.CONF.host, rpc_api.ENGINE_TOPIC)
    workers = cfg.CONF.num_engine_workers
    if not workers:
        workers = max(4, processutils.get_worker_count())

    launcher = service.launch(cfg.CONF, srv, workers=workers,
                              restart_method='mutate')
    return launcher
Пример #4
0
def launch_engine(setup_logging=True):
    if setup_logging:
        logging.register_options(cfg.CONF)
    cfg.CONF(project='heat',
             prog='heat-engine',
             version=version.version_info.version_string())
    if setup_logging:
        logging.setup(cfg.CONF, 'heat-engine')
        logging.set_defaults()
    messaging.setup()

    config.startup_sanity_check()

    mgr = None
    try:
        mgr = template._get_template_extension_manager()
    except template.TemplatePluginNotRegistered as ex:
        LOG.critical("%s", ex)
    if not mgr or not mgr.names():
        sys.exit("ERROR: No template format plugins registered")

    from heat.engine import service as engine  # noqa

    profiler.setup('heat-engine', cfg.CONF.host)
    gmr.TextGuruMeditation.setup_autorun(version)
    srv = engine.EngineService(cfg.CONF.host, rpc_api.ENGINE_TOPIC)
    workers = cfg.CONF.num_engine_workers
    if not workers:
        workers = max(4, processutils.get_worker_count())

    launcher = service.launch(cfg.CONF,
                              srv,
                              workers=workers,
                              restart_method='mutate')
    return launcher
Пример #5
0
def launch_cfn_api(setup_logging=True):
    if setup_logging:
        logging.register_options(cfg.CONF)
    cfg.CONF(project='heat',
             prog='heat-api-cfn',
             version=version.version_info.version_string())
    if setup_logging:
        logging.setup(cfg.CONF, 'heat-api-cfn')
        logging.set_defaults()
    config.set_config_defaults()
    messaging.setup()

    app = config.load_paste_app()

    port = cfg.CONF.heat_api_cfn.bind_port
    host = cfg.CONF.heat_api_cfn.bind_host
    LOG.info('Starting Heat API on %(host)s:%(port)s', {
        'host': host,
        'port': port
    })
    profiler.setup('heat-api-cfn', host)
    gmr.TextGuruMeditation.setup_autorun(version)
    server = wsgi.Server('heat-api-cfn', cfg.CONF.heat_api_cfn)
    server.start(app, default_port=port)
    return server
Пример #6
0
Файл: api.py Проект: timotm/heat
def launch_api(setup_logging=True):
    if setup_logging:
        logging.register_options(CONF)
    CONF(project='heat',
         prog='heat-api',
         version=version.version_info.version_string())
    if setup_logging:
        logging.setup(CONF, CONF.prog)
    LOG = logging.getLogger(CONF.prog)
    config.set_config_defaults()
    messaging.setup()

    app = config.load_paste_app()

    port = CONF.heat_api.bind_port
    host = CONF.heat_api.bind_host
    LOG.info('Starting Heat REST API on %(host)s:%(port)s', {
        'host': host,
        'port': port
    })
    profiler.setup(CONF.prog, host)
    gmr.TextGuruMeditation.setup_autorun(version)
    server = wsgi.Server(CONF.prog, CONF.heat_api)
    server.start(app, default_port=port)
    return server
Пример #7
0
def init_application():
    i18n.enable_lazy()

    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't
    # already contain registered options if the app is reloaded.
    CONF.reset()
    logging.register_options(CONF)
    CONF(project='heat',
         prog='heat-api-cfn',
         version=version.version_info.version_string())
    logging.setup(CONF, CONF.prog)
    logging.set_defaults()
    LOG = logging.getLogger(CONF.prog)
    config.set_config_defaults()
    messaging.setup()

    port = CONF.heat_api_cfn.bind_port
    host = CONF.heat_api_cfn.bind_host
    LOG.info('Starting Heat API on %(host)s:%(port)s', {
        'host': host,
        'port': port
    })
    profiler.setup(CONF.prog, host)

    return config.load_paste_app()
Пример #8
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='heat',
             prog='heat-engine',
             version=version.version_info.version_string())
    logging.setup(cfg.CONF, 'heat-engine')
    logging.set_defaults()
    messaging.setup()

    config.startup_sanity_check()

    mgr = None
    try:
        mgr = template._get_template_extension_manager()
    except template.TemplatePluginNotRegistered as ex:
        LOG.critical(_LC("%s"), ex)
    if not mgr or not mgr.names():
        sys.exit("ERROR: No template format plugins registered")

    from heat.engine import service as engine  # noqa

    profiler.setup('heat-engine', cfg.CONF.host)
    gmr.TextGuruMeditation.setup_autorun(version)
    srv = engine.EngineService(cfg.CONF.host, rpc_api.ENGINE_TOPIC)
    workers = cfg.CONF.num_engine_workers
    if not workers:
        workers = max(4, processutils.get_worker_count())

    launcher = service.launch(cfg.CONF, srv, workers=workers)
    if cfg.CONF.enable_cloud_watch_lite:
        # We create the periodic tasks here, which mean they are created
        # only in the parent process when num_engine_workers>1 is specified
        srv.create_periodic_tasks()
    launcher.wait()
Пример #9
0
def main():
    try:
        logging.register_options(cfg.CONF)
        cfg.CONF(project='heat',
                 prog='heat-api',
                 version=version.version_info.version_string())
        logging.setup(cfg.CONF, 'heat-api')
        messaging.setup()

        app = config.load_paste_app()

        port = cfg.CONF.heat_api.bind_port
        host = cfg.CONF.heat_api.bind_host
        LOG.info(_LI('Starting Heat REST API on %(host)s:%(port)s'), {
            'host': host,
            'port': port
        })
        profiler.setup('heat-api', host)
        gmr.TextGuruMeditation.setup_autorun(version)
        server = wsgi.Server('heat-api', cfg.CONF.heat_api)
        server.start(app, default_port=port)
        systemd.notify_once()
        server.wait()
    except RuntimeError as e:
        msg = six.text_type(e)
        sys.exit("ERROR: %s" % msg)
Пример #10
0
def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('heat.api')

    logging.register_options(cfg.CONF)
    version = hversion.version_info.version_string()
    cfg.CONF(project='heat', prog='heat-api', version=version)
    logging.setup(cfg.CONF, 'heat-api')
    messaging.setup()

    port = cfg.CONF.heat_api.bind_port
    host = cfg.CONF.heat_api.bind_host
    profiler.setup('heat-api', host)
    LOG.info(_LI('Starting Heat REST API on %(host)s:%(port)s'),
             {'host': host, 'port': port})
    return config.load_paste_app()
Пример #11
0
def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('heat.api')

    logging.register_options(cfg.CONF)
    version = hversion.version_info.version_string()
    cfg.CONF(project='heat', prog='heat-api', version=version)
    logging.setup(cfg.CONF, 'heat-api')
    config.set_config_defaults()
    messaging.setup()

    port = cfg.CONF.heat_api.bind_port
    host = cfg.CONF.heat_api.bind_host
    profiler.setup('heat-api', host)
    LOG.info(_LI('Starting Heat REST API on %(host)s:%(port)s'),
             {'host': host, 'port': port})
    return config.load_paste_app()
Пример #12
0
def init_application():
    i18n.enable_lazy()

    logging.register_options(CONF)
    CONF(project='heat',
         prog='heat-api-cfn',
         version=version.version_info.version_string())
    logging.setup(CONF, CONF.prog)
    logging.set_defaults()
    LOG = logging.getLogger(CONF.prog)
    config.set_config_defaults()
    messaging.setup()

    port = CONF.heat_api_cfn.bind_port
    host = CONF.heat_api_cfn.bind_host
    LOG.info('Starting Heat API on %(host)s:%(port)s',
             {'host': host, 'port': port})
    profiler.setup(CONF.prog, host)

    return config.load_paste_app()
Пример #13
0
def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('heat.api.cloudwatch')

    logging.register_options(cfg.CONF)
    cfg.CONF(project='heat',
             prog='heat-api-cloudwatch',
             version=version.version_info.version_string())
    logging.setup(cfg.CONF, 'heat-api-cloudwatch')
    logging.set_defaults()
    messaging.setup()

    port = cfg.CONF.heat_api_cloudwatch.bind_port
    host = cfg.CONF.heat_api_cloudwatch.bind_host
    LOG.info(_LI('Starting Heat CloudWatch API on %(host)s:%(port)s'),
             {'host': host, 'port': port})
    profiler.setup('heat-api-cloudwatch', host)

    return config.load_paste_app()
Пример #14
0
def launch_api(setup_logging=True):
    if setup_logging:
        logging.register_options(cfg.CONF)
    cfg.CONF(project='heat', prog='heat-api',
             version=version.version_info.version_string())
    if setup_logging:
        logging.setup(cfg.CONF, 'heat-api')
    config.set_config_defaults()
    messaging.setup()

    app = config.load_paste_app()

    port = cfg.CONF.heat_api.bind_port
    host = cfg.CONF.heat_api.bind_host
    LOG.info(_LI('Starting Heat REST API on %(host)s:%(port)s'),
             {'host': host, 'port': port})
    profiler.setup('heat-api', host)
    gmr.TextGuruMeditation.setup_autorun(version)
    server = wsgi.Server('heat-api', cfg.CONF.heat_api)
    server.start(app, default_port=port)
    return server
Пример #15
0
Файл: api.py Проект: steveb/heat
def main():
    try:
        logging.register_options(cfg.CONF)
        cfg.CONF(project="heat", prog="heat-api", version=version.version_info.version_string())
        logging.setup(cfg.CONF, "heat-api")
        config.set_config_defaults()
        messaging.setup()

        app = config.load_paste_app()

        port = cfg.CONF.heat_api.bind_port
        host = cfg.CONF.heat_api.bind_host
        LOG.info(_LI("Starting Heat REST API on %(host)s:%(port)s"), {"host": host, "port": port})
        profiler.setup("heat-api", host)
        gmr.TextGuruMeditation.setup_autorun(version)
        server = wsgi.Server("heat-api", cfg.CONF.heat_api)
        server.start(app, default_port=port)
        systemd.notify_once()
        server.wait()
    except RuntimeError as e:
        msg = six.text_type(e)
        sys.exit("ERROR: %s" % msg)
Пример #16
0
def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('heat.api.cloudwatch')

    logging.register_options(cfg.CONF)
    cfg.CONF(project='heat',
             prog='heat-api-cloudwatch',
             version=version.version_info.version_string())
    logging.setup(cfg.CONF, 'heat-api-cloudwatch')
    logging.set_defaults()
    config.set_config_defaults()
    messaging.setup()

    port = cfg.CONF.heat_api_cloudwatch.bind_port
    host = cfg.CONF.heat_api_cloudwatch.bind_host
    LOG.info('Starting Heat CloudWatch API on %(host)s:%(port)s', {
        'host': host,
        'port': port
    })
    profiler.setup('heat-api-cloudwatch', host)

    return config.load_paste_app()
Пример #17
0
from oslo_config import cfg
import oslo_i18n as i18n
from oslo_log import log as logging

from heat.common import config
from heat.common.i18n import _LI
from heat.common import messaging
from heat.common import profiler
from heat import version

i18n.enable_lazy()

LOG = logging.getLogger('heat.api')

logging.register_options(cfg.CONF)
version = version.version_info.version_string()
cfg.CONF(project='heat', prog='heat-api', version=version)
logging.setup(cfg.CONF, 'heat-api')
messaging.setup()

port = cfg.CONF.heat_api.bind_port
host = cfg.CONF.heat_api.bind_host
LOG.info(_LI('Starting Heat ReST API on %(host)s:%(port)s'), {
    'host': host,
    'port': port
})
profiler.setup('heat-api', host)

application = config.load_paste_app()
Пример #18
0
import oslo_i18n as i18n
from oslo_log import log as logging

from heat.common import config
from heat.common.i18n import _LI
from heat.common import messaging
from heat.common import profiler
from heat import version

i18n.enable_lazy()

LOG = logging.getLogger('heat.api.cfn')

logging.register_options(cfg.CONF)
cfg.CONF(project='heat',
         prog='heat-api-cfn',
         version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cfn')
logging.set_defaults()
messaging.setup()

port = cfg.CONF.heat_api_cfn.bind_port
host = cfg.CONF.heat_api_cfn.bind_host
LOG.info(_LI('Starting Heat API on %(host)s:%(port)s'), {
    'host': host,
    'port': port
})
profiler.setup('heat-api-cfn', host)

application = config.load_paste_app()
Пример #19
0
"""


from oslo_config import cfg
import oslo_i18n as i18n
from oslo_log import log as logging

from heat.common import config
from heat.common.i18n import _LI
from heat.common import messaging
from heat.common import profiler
from heat import version

i18n.enable_lazy()

LOG = logging.getLogger('heat.api')

logging.register_options(cfg.CONF)
version = version.version_info.version_string()
cfg.CONF(project='heat', prog='heat-api', version=version)
logging.setup(cfg.CONF, 'heat-api')
messaging.setup()

port = cfg.CONF.heat_api.bind_port
host = cfg.CONF.heat_api.bind_host
LOG.info(_LI('Starting Heat REST API on %(host)s:%(port)s'),
         {'host': host, 'port': port})
profiler.setup('heat-api', host)

application = config.load_paste_app()
Пример #20
0
from oslo_config import cfg
import oslo_i18n as i18n
from oslo_log import log as logging

from heat.common import config
from heat.common.i18n import _LI
from heat.common import messaging
from heat.common import profiler
from heat import version

i18n.enable_lazy()

LOG = logging.getLogger('heat.api.cloudwatch')

logging.register_options(cfg.CONF)
cfg.CONF(project='heat',
         prog='heat-api-cloudwatch',
         version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cloudwatch')
logging.set_defaults()
messaging.setup()

port = cfg.CONF.heat_api_cloudwatch.bind_port
host = cfg.CONF.heat_api_cloudwatch.bind_host
LOG.info(_LI('Starting Heat CloudWatch API on %(host)s:%(port)s'),
         {'host': host, 'port': port})
profiler.setup('heat-api-cloudwatch', host)

application = config.load_paste_app()
Пример #21
0
import oslo_i18n as i18n
from oslo_log import log as logging

from heat.common import config
from heat.common.i18n import _LI
from heat.common import messaging
from heat.common import profiler
from heat import version

i18n.enable_lazy()

LOG = logging.getLogger('heat.api.cloudwatch')

logging.register_options(cfg.CONF)
cfg.CONF(project='heat',
         prog='heat-api-cloudwatch',
         version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cloudwatch')
logging.set_defaults()
messaging.setup()

port = cfg.CONF.heat_api_cloudwatch.bind_port
host = cfg.CONF.heat_api_cloudwatch.bind_host
LOG.info(_LI('Starting Heat CloudWatch API on %(host)s:%(port)s'), {
    'host': host,
    'port': port
})
profiler.setup('heat-api-cloudwatch', host)

application = config.load_paste_app()
Пример #22
0
from oslo_config import cfg
import oslo_i18n as i18n
from oslo_log import log as logging

from heat.common import config
from heat.common.i18n import _LI
from heat.common import messaging
from heat.common import profiler
from heat import version

i18n.enable_lazy()

LOG = logging.getLogger('heat.api.cfn')

logging.register_options(cfg.CONF)
cfg.CONF(project='heat',
         prog='heat-api-cfn',
         version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cfn')
logging.set_defaults()
messaging.setup()

port = cfg.CONF.heat_api_cfn.bind_port
host = cfg.CONF.heat_api_cfn.bind_host
LOG.info(_LI('Starting Heat API on %(host)s:%(port)s'),
         {'host': host, 'port': port})
profiler.setup('heat-api-cfn', host)

application = config.load_paste_app()