Пример #1
0
def main():
    LOG.info('Watcher sync started.')

    service.prepare_service(sys.argv, CONF)
    syncer = sync.Syncer()
    syncer.sync()

    LOG.info('Watcher sync finished.')
Пример #2
0
def main():
    watcher_service.prepare_service(sys.argv)

    LOG.info(_LI('Starting Watcher Applier service in PID %s'), os.getpid())

    applier_service = watcher_service.Service(manager.ApplierManager)
    launcher = service.launch(CONF, applier_service)
    launcher.wait()
Пример #3
0
def main():
    watcher_service.prepare_service(sys.argv)

    LOG.info(_LI('Starting Watcher Applier service in PID %s'), os.getpid())

    applier_service = watcher_service.Service(manager.ApplierManager)

    # Only 1 process
    launcher = watcher_service.launch(CONF, applier_service)
    launcher.wait()
Пример #4
0
def main():
    service.prepare_service(sys.argv)

    LOG.info(_LI('Starting server in PID %s') % os.getpid())
    LOG.debug("Configuration:")
    cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)

    server = manager.DecisionEngineManager()
    server.connect()
    server.join()
Пример #5
0
def main():
    service.prepare_service(sys.argv)

    LOG.info(_LI('Starting server in PID %s') % os.getpid())
    LOG.debug("Configuration:")
    cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)

    server = manager.DecisionEngineManager()
    server.connect()
    server.join()
Пример #6
0
def main():
    watcher_service.prepare_service(sys.argv)

    LOG.info(_LI('Starting Watcher Decision Engine service in PID %s'),
             os.getpid())

    syncer = sync.Syncer()
    syncer.sync()

    de_service = watcher_service.Service(manager.DecisionEngineManager)
    launcher = service.launch(CONF, de_service)
    launcher.wait()
Пример #7
0
def main():
    watcher_service.prepare_service(sys.argv, CONF)

    LOG.info('Starting Watcher Applier service in PID %s', os.getpid())

    applier_service = watcher_service.Service(manager.ApplierManager)

    syncer = sync.Syncer()
    syncer.sync()

    # Only 1 process
    launcher = watcher_service.launch(CONF, applier_service)
    launcher.wait()
Пример #8
0
def main():
    register_sub_command_opts()
    # this is hack to work with previous usage of watcher-dbsync
    # pls change it to watcher-dbsync upgrade
    valid_commands = set([
        'upgrade', 'downgrade', 'revision',
        'version', 'stamp', 'create_schema',
    ])
    if not set(sys.argv).intersection(valid_commands):
        sys.argv.append('upgrade')

    service.prepare_service(sys.argv)
    CONF.command.func()
Пример #9
0
def initialize_wsgi_app(show_deprecated=False):
    i18n.install('watcher')

    service.prepare_service(sys.argv)

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

    if show_deprecated:
        LOG.warning("Using watcher/api/app.wsgi is deprecated and it will "
                    "be removed in U release. Please use automatically "
                    "generated watcher-api-wsgi instead.")

    return app.VersionSelectorApplication()
Пример #10
0
def main():
    register_sub_command_opts()
    # this is hack to work with previous usage of watcher-dbsync
    # pls change it to watcher-dbsync upgrade
    valid_commands = set([
        'upgrade',
        'downgrade',
        'revision',
        'version',
        'stamp',
        'create_schema',
    ])
    if not set(sys.argv).intersection(valid_commands):
        sys.argv.append('upgrade')

    service.prepare_service(sys.argv)
    CONF.command.func()
Пример #11
0
def main():
    watcher_service.prepare_service(sys.argv)

    LOG.info(_LI('Starting Watcher Decision Engine service in PID %s'),
             os.getpid())

    syncer = sync.Syncer()
    syncer.sync()

    de_service = watcher_service.Service(manager.DecisionEngineManager)
    bg_schedulder_service = scheduling.DecisionEngineSchedulingService()

    # Only 1 process
    launcher = watcher_service.launch(CONF, de_service)
    launcher.launch_service(bg_schedulder_service)

    launcher.wait()
Пример #12
0
def main():
    watcher_service.prepare_service(sys.argv, CONF)
    gmr.register_gmr_plugins()

    LOG.info('Starting Watcher Decision Engine service in PID %s', os.getpid())

    syncer = sync.Syncer()
    syncer.sync()

    de_service = watcher_service.Service(manager.DecisionEngineManager)
    bg_scheduler_service = scheduling.DecisionEngineSchedulingService()

    # Only 1 process
    launcher = watcher_service.launch(CONF, de_service)
    launcher.launch_service(bg_scheduler_service)

    launcher.wait()
Пример #13
0
def main():
    service.prepare_service(sys.argv, CONF)

    host, port = cfg.CONF.api.host, cfg.CONF.api.port
    protocol = "http" if not CONF.api.enable_ssl_api else "https"
    # Build and start the WSGI app
    server = service.WSGIService('watcher-api', CONF.api.enable_ssl_api)

    if host == '127.0.0.1':
        LOG.info('serving on 127.0.0.1:%(port)s, '
                 'view at %(protocol)s://127.0.0.1:%(port)s' %
                 dict(protocol=protocol, port=port))
    else:
        LOG.info('serving on %(protocol)s://%(host)s:%(port)s' %
                 dict(protocol=protocol, host=host, port=port))

    launcher = service.launch(CONF, server, workers=server.workers)
    launcher.wait()
Пример #14
0
def main():
    service.prepare_service(sys.argv)

    host, port = cfg.CONF.api.host, cfg.CONF.api.port
    protocol = "http" if not CONF.api.enable_ssl_api else "https"
    # Build and start the WSGI app
    server = service.WSGIService(
        'watcher-api', CONF.api.enable_ssl_api)

    if host == '127.0.0.1':
        LOG.info(_LI('serving on 127.0.0.1:%(port)s, '
                     'view at %(protocol)s://127.0.0.1:%(port)s') %
                 dict(protocol=protocol, port=port))
    else:
        LOG.info(_LI('serving on %(protocol)s://%(host)s:%(port)s') %
                 dict(protocol=protocol, host=host, port=port))

    launcher = service.launch(CONF, server, workers=server.workers)
    launcher.wait()
Пример #15
0
def main():
    service.prepare_service(sys.argv)

    app = api_app.setup_app()

    # Create the WSGI server and start it
    host, port = cfg.CONF.api.host, cfg.CONF.api.port
    srv = simple_server.make_server(host, port, app)

    LOG.info(_('Starting server in PID %s') % os.getpid())
    LOG.debug("Watcher configuration:")
    cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)

    if host == '0.0.0.0':
        LOG.info(_('serving on 0.0.0.0:%(port)s, '
                   'view at http://127.0.0.1:%(port)s') %
                 dict(port=port))
    else:
        LOG.info(_('serving on http://%(host)s:%(port)s') %
                 dict(host=host, port=port))

    srv.serve_forever()