Exemple #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))
Exemple #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()
Exemple #3
0
    def setUp(self):
        messaging.setup("fake://", optional=True)
        self.addCleanup(messaging.cleanup)
        self.context = utils.dummy_context()

        # self.stubs = stubout.StubOutForTesting()
        self.rpcapi = rpc_client.EngineClient()
        super(EngineRpcAPITestCase, self).setUp()
Exemple #4
0
    def setUp(self):
        messaging.setup("fake://", optional=True)
        self.addCleanup(messaging.cleanup)
        self.context = utils.dummy_context()

        # self.stubs = stubout.StubOutForTesting()
        self.rpcapi = rpc_client.EngineClient()
        super(EngineRpcAPITestCase, self).setUp()
Exemple #5
0
def init_app():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='senlin',
             prog='senlin-api',
             version=version.version_info.version_string())
    logging.setup(cfg.CONF, 'senlin-api')
    config.set_config_defaults()
    messaging.setup()

    profiler.setup('senlin-api', cfg.CONF.host)
    return wsgi.load_paste_app()
Exemple #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()
    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()
Exemple #7
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()
Exemple #8
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()
Exemple #9
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()
Exemple #10
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()
Exemple #11
0
    def setUp(self):
        super(SenlinTestCase, self).setUp()
        self.setup_logging()
        scheduler.ENABLE_SLEEP = False
        self.useFixture(fixtures.MonkeyPatch(
            'senlin.common.exception._FATAL_EXCEPTION_FORMAT_ERRORS',
            True))

        def enable_sleep():
            scheduler.ENABLE_SLEEP = True

        self.addCleanup(enable_sleep)
        self.addCleanup(cfg.CONF.reset)

        messaging.setup("fake://", optional=True)
        self.addCleanup(messaging.cleanup)

        utils.setup_dummy_db()
        self.addCleanup(utils.reset_dummy_db)
Exemple #12
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()
Exemple #13
0
    def setUp(self):
        super(SenlinTestCase, self).setUp()
        self.setup_logging()
        scheduler.ENABLE_SLEEP = False
        self.useFixture(fixtures.MonkeyPatch(
            'senlin.common.exception._FATAL_EXCEPTION_FORMAT_ERRORS',
            True))

        def enable_sleep():
            scheduler.ENABLE_SLEEP = True

        self.addCleanup(enable_sleep)
        self.addCleanup(cfg.CONF.reset)

        messaging.setup("fake://", optional=True)
        self.addCleanup(messaging.cleanup)

        utils.setup_dummy_db()
        self.addCleanup(utils.reset_dummy_db)
Exemple #14
0
def main():
    try:
        logging.register_options(cfg.CONF)
        cfg.CONF(project='senlin', prog='senlin-api',
                 version=version.version_info.version_string())
        logging.setup(cfg.CONF, 'senlin-api')
        messaging.setup()

        app = wsgi.load_paste_app()

        host = cfg.CONF.senlin_api.bind_host
        port = cfg.CONF.senlin_api.bind_port
        LOG.info(_LI('Starting Senlin API on %(host)s:%(port)s'),
                 {'host': host, 'port': port})
        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))
Exemple #15
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()
Exemple #16
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()
Exemple #17
0
    def setUp(self):
        super(SenlinTestCase, self).setUp()
        self.setup_logging()
        scheduler.ENABLE_SLEEP = False
        self.useFixture(fixtures.MonkeyPatch(
            'senlin.common.exception._FATAL_EXCEPTION_FORMAT_ERRORS',
            True))

        def enable_sleep():
            scheduler.ENABLE_SLEEP = True

        self.addCleanup(enable_sleep)

        # mod_dir = os.path.dirname(sys.modules[__name__].__file__)
        # project_dir = os.path.abspath(os.path.join(mod_dir, '../../'))

        cfg.CONF.set_override('error_wait_time', None)
        self.addCleanup(cfg.CONF.reset)

        messaging.setup("fake://", optional=True)
        self.addCleanup(messaging.cleanup)

        utils.setup_dummy_db()
        self.addCleanup(utils.reset_dummy_db)