Ejemplo n.º 1
0
def main():
    """
    The entry point for the service.
    This will load the configuration files and start a Tornado webservice
    with one or more sub processes.

    NOTES:
    tornado.options.parse_command_line(final=True)
    Allows you to run the service with custom options.

    Examples:
        Change the logging level to debug:
            + python repository --logging=DEBUG
            + python repository --logging=debug

        Configure custom syslog server:
            + python repository --syslog_host=54.77.151.169
    """
    koi.load_config(CONF_DIR)
    app = koi.make_application(
        __version__,
        options.service_type,
        APPLICATION_URLS)
    server = koi.make_server(app)

    audit.configure_logging()

    # Forks multiple sub-processes, one for each core
    server.start(int(options.processes))

    tornado.ioloop.IOLoop.instance().start()
Ejemplo n.º 2
0
def main():
    """
    The entry point for the Template service.
    This will load the configuration files and start a Tornado webservice
    with one or more sub processes.

    NOTES:
    tornado.options.parse_command_line(final=True)
    Allows you to run the service with custom options.

    Examples:
        Change the logging level to debug:
            + python template --logging=DEBUG
            + python template --logging=debug

        Configure custom syslog server:
            + python template --syslog_host=54.77.151.169
    """
    koi.load_config(CONF_DIR)
    app = koi.make_application(
        __version__,
        options.service_type,
        APPLICATION_URLS)
    server = koi.make_server(app)

    # Forks multiple sub-processes, one for each core
    server.start(int(options.processes))

    tornado.ioloop.IOLoop.instance().start()
Ejemplo n.º 3
0
def main():
    """
    The entry point for the Index service.
    This will load the configuration files and start a Tornado webservice
    with one or more sub processes.

    NOTES:
    tornado.options.parse_command_line(final=True)
    Allows you to run the service with custom options.

    Examples:
        Change the logging level to debug:
            + python index --logging=DEBUG
            + python index --logging=debug

        Configure custom syslog server:
            + python index --syslog_host=54.77.151.169
    """
    koi.load_config(CONF_DIR)

    db = DbInterface(
        options.url_index_db,
        options.index_db_port,
        options.index_db_path,
        options.index_schema)

    if options.poll_repositories:
        start_background_process(db)

    app = koi.make_application(
        __version__,
        options.service_type,
        APPLICATION_URLS,
        {'database': db})

    server = koi.make_server(app, CONF_DIR)

    # Forks multiple sub-processes, one for each core
    server.start(int(options.processes))

    tornado.ioloop.IOLoop.instance().start()