Beispiel #1
0
def main():
    try:
        logging.register_options(cfg.CONF)
        cfg.CONF(project='senlin',
                 prog='senlin-api',
                 version=version.version_info.version_string())
        config.set_config_defaults()
        logging.setup(cfg.CONF, 'senlin-api')
        objects.register_all()
        messaging.setup()

        app = wsgi.load_paste_app()

        host = cfg.CONF.senlin_api.bind_host
        port = cfg.CONF.senlin_api.bind_port
        LOG.info('Starting Senlin API on %(host)s:%(port)s', {
            'host': host,
            'port': port
        })
        profiler.setup('senlin-api', host)
        server = wsgi.Server('senlin-api', cfg.CONF.senlin_api)
        server.start(app, default_port=port)
        systemd.notify_once()
        server.wait()
    except RuntimeError as ex:
        sys.exit("ERROR: %s" % six.text_type(ex))
Beispiel #2
0
def init_app():
    config.parse_args(sys.argv, 'senlin-api')
    logging.setup(cfg.CONF, 'senlin-api')
    objects.register_all()
    messaging.setup()

    profiler.setup('senlin-api', cfg.CONF.host)
    return wsgi.load_paste_app()
Beispiel #3
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='senlin', prog='senlin-engine')
    logging.setup(cfg.CONF, 'senlin-engine')
    logging.set_defaults()
    objects.register_all()
    messaging.setup()

    from senlin.engine import service as engine

    srv = engine.EngineService(cfg.CONF.host, consts.ENGINE_TOPIC)
    launcher = service.launch(cfg.CONF, srv,
                              workers=cfg.CONF.num_engine_workers)
    # the following periodic tasks are intended serve as HA checking
    # srv.create_periodic_tasks()
    launcher.wait()
Beispiel #4
0
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()
Beispiel #5
0
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()
Beispiel #6
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='senlin', prog='senlin-engine')
    logging.setup(cfg.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', cfg.CONF.host)
    srv = engine.EngineService(cfg.CONF.host, consts.ENGINE_TOPIC)
    launcher = service.launch(cfg.CONF,
                              srv,
                              workers=cfg.CONF.engine.workers,
                              restart_method='mutate')
    launcher.wait()
Beispiel #7
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='senlin', prog='senlin-health-manager')
    logging.setup(cfg.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', cfg.CONF.host)
    srv = health_manager.HealthManagerService(cfg.CONF.host,
                                              consts.HEALTH_MANAGER_TOPIC)
    launcher = service.launch(cfg.CONF,
                              srv,
                              workers=cfg.CONF.health_manager.workers,
                              restart_method='mutate')
    launcher.wait()
Beispiel #8
0
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()
Beispiel #9
0
def main():
    config.parse_args(sys.argv, 'senlin-api')
    logging.setup(CONF, 'senlin-api')
    gmr.TextGuruMeditation.setup_autorun(version)
    objects.register_all()
    messaging.setup()

    app = wsgi.load_paste_app()

    host = CONF.senlin_api.bind_host
    port = CONF.senlin_api.bind_port
    LOG.info('Starting Senlin API on %(host)s:%(port)s', {
        'host': host,
        'port': port
    })
    profiler.setup('senlin-api', host)
    server = wsgi.Server('senlin-api', CONF.senlin_api)
    server.start(app, default_port=port)
    systemd.notify_once()
    server.wait()
Beispiel #10
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='senlin', prog='senlin-engine')
    logging.setup(cfg.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', cfg.CONF.host)
    srv = engine.EngineService(cfg.CONF.host, consts.ENGINE_TOPIC)
    launcher = service.launch(cfg.CONF,
                              srv,
                              workers=cfg.CONF.num_engine_workers,
                              restart_method='mutate')
    # the following periodic tasks are intended serve as HA checking
    # srv.create_periodic_tasks()
    launcher.wait()
Beispiel #11
0
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import eventlet
import oslo_i18n

from senlin import objects


def fake_translate_msgid(msgid, domain, desired_locale=None):
    return msgid

oslo_i18n.enable_lazy()

# To ensure messages don't really get translated while running tests.
# As there are lots of places where matching is expected when comparing
# exception message(translated) with raw message.
oslo_i18n._translate_msgid = fake_translate_msgid

eventlet.monkey_patch(os=False)

# The following has to be done after eventlet monkey patching or else the
# threading.locl() store used in oslo_messaging will be initialized to
# thread-local storage rather than green-thread local. This will cause context
# sets and deletes in that storage to clobber each other.
# Make sure we have all objects loaded. This is done at module import time,
# because we may be using mock decorators in our tests that run at import
# time.
objects.register_all()
Beispiel #12
0
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import eventlet

from senlin import objects

eventlet.monkey_patch(os=False)

# The following has to be done after eventlet monkey patching or else the
# threading.local() store used in oslo_messaging will be initialized to
# thread-local storage rather than green-thread local. This will cause context
# sets and deletes in that storage to clobber each other.
# Make sure we have all objects loaded. This is done at module import time,
# because we may be using mock decorators in our tests that run at import
# time.
objects.register_all()