Exemple #1
0
def init_wsgi():
    # By default, oslo.config parses the CLI args if no args is provided.
    # As a result, invoking this wsgi script from gunicorn leads to the error
    # with argparse complaining that the CLI options have already been parsed.
    q_config.parse_args(args=[])

    return setup_app()
Exemple #2
0
def parse_args():
    # Look for .mistral.conf in the project directory by default.
    project_dir = '%s/../..' % os.path.dirname(__file__)
    config_file = '%s/.qinling.conf' % os.path.realpath(project_dir)
    config_files = [config_file] if os.path.isfile(config_file) else None

    config.parse_args(args=[], default_config_files=config_files)
Exemple #3
0
def main():
    try:
        config.parse_args(args=common.get_properly_ordered_parameters())
        common.print_server_info("api")
        logging.setup(CONF, 'qinling')
        # Initialize RPC configuration.
        rpc.get_transport()

        api_server = api_service.WSGIService()
        launcher = service.launch(CONF, api_server, workers=api_server.workers)
        launcher.wait()
    except RuntimeError as excp:
        sys.stderr.write("ERROR: %s\n" % excp)
        sys.exit(1)
Exemple #4
0
def main():
    try:
        config.parse_args(args=common.get_properly_ordered_parameters())
        common.print_server_info("engine")
        logging.setup(CONF, 'qinling')
        # Initialize RPC configuration.
        rpc.get_transport()

        sm = cotyledon.ServiceManager()
        sm.add(
            eng_service.EngineService,
            workers=1,
        )
        sm.run()
    except RuntimeError as excp:
        sys.stderr.write("ERROR: %s\n" % excp)
        sys.exit(1)
Exemple #5
0
def main():
    try:
        config.parse_args(get_properly_ordered_parameters())
        print_server_info()

        logging.setup(CONF, 'Qinling')

        # Initialize RPC configuration.
        rpc.get_transport()

        if cfg.CONF.server == ['all']:
            launch_any(LAUNCH_OPTIONS.keys())
        else:
            if set(cfg.CONF.server) - set(LAUNCH_OPTIONS.keys()):
                raise Exception('Valid options are all or any combination of '
                                ', '.join(LAUNCH_OPTIONS.keys()))

            launch_any(set(cfg.CONF.server))

    except RuntimeError as excp:
        sys.stderr.write("ERROR: %s\n" % excp)
        sys.exit(1)