Ejemplo n.º 1
0
def build_galaxy_app(simple_kwargs) -> GalaxyUniverseApplication:
    """Build a Galaxy app object from a simple keyword arguments.

    Construct paste style complex dictionary and use load_app_properties so
    Galaxy override variables are respected. Also setup "global" references
    to sqlalchemy database context for Galaxy and install databases.
    """
    log.info("Galaxy database connection: %s",
             simple_kwargs["database_connection"])
    simple_kwargs['global_conf'] = get_webapp_global_conf()
    simple_kwargs['global_conf'][
        '__file__'] = "lib/galaxy/config/sample/galaxy.yml.sample"
    simple_kwargs = load_app_properties(kwds=simple_kwargs)
    # Build the Universe Application
    app = GalaxyUniverseApplication(**simple_kwargs)
    if not simple_kwargs.get("enable_celery_tasks"):
        rebind_container_to_task(app)

    log.info("Embedded Galaxy application started")

    global galaxy_context
    global install_context
    galaxy_context = app.model.context
    install_context = app.install_model.context

    # Toolbox indexing happens via the work queue out of band recently, and,
    # beyond potentially running async after tests execute doesn't execute
    # without building a uwsgi app (app.is_webapp = False for this test kit).
    # We need to ensure to build an index for the test galaxy app -- this is
    # pretty fast with the limited toolset
    app.reindex_tool_search()

    return app
Ejemplo n.º 2
0
def build_galaxy_app(simple_kwargs):
    """Build a Galaxy app object from a simple keyword arguments.

    Construct paste style complex dictionary and use load_app_properties so
    Galaxy override variables are respected. Also setup "global" references
    to sqlalchemy database context for Galaxy and install databases.
    """
    log.info("Galaxy database connection: %s",
             simple_kwargs["database_connection"])
    simple_kwargs['global_conf'] = get_webapp_global_conf()
    simple_kwargs['global_conf']['__file__'] = "config/galaxy.ini.sample"
    simple_kwargs = load_app_properties(kwds=simple_kwargs)
    # Build the Universe Application
    app = GalaxyUniverseApplication(**simple_kwargs)
    log.info("Embedded Galaxy application started")
    database_contexts.galaxy_context = app.model.context
    database_contexts.install_context = app.install_model.context
    return app
Ejemplo n.º 3
0
            tool_config_file=[
                galaxy_tool_conf_file, galaxy_shed_tool_conf_file
            ],
            tool_sheds_config_file=galaxy_tool_sheds_conf_file,
            tool_parse_help=False,
            tool_data_table_config_path=galaxy_tool_data_table_conf_file,
            update_integrated_tool_panel=False,
            use_heartbeat=False)

        # ---- Build Galaxy Application --------------------------------------------------
        if not galaxy_database_connection.startswith(
                'sqlite://'
        ) and not install_galaxy_database_connection.startswith('sqlite://'):
            kwargs['database_engine_option_pool_size'] = '10'
            kwargs['database_engine_option_max_overflow'] = '20'
        galaxyapp = GalaxyUniverseApplication(**kwargs)

        log.info("Embedded Galaxy application started")

        # ---- Run galaxy webserver ------------------------------------------------------
        galaxy_server = None
        galaxy_global_conf['database_file'] = galaxy_database_connection
        galaxywebapp = galaxybuildapp.app_factory(galaxy_global_conf,
                                                  use_translogger=False,
                                                  static_enabled=True,
                                                  app=galaxyapp)
        database_contexts.galaxy_context = galaxyapp.model.context
        database_contexts.install_context = galaxyapp.install_model.context
        if galaxy_test_port is not None:
            galaxy_server = httpserver.serve(galaxywebapp,
                                             host=galaxy_test_host,
Ejemplo n.º 4
0
 if not galaxy_database_connection.startswith( 'sqlite://' ):
     kwargs[ 'database_engine_option_max_overflow' ] = '20'
 galaxyapp = GalaxyUniverseApplication( allow_user_creation = True,
                                        allow_user_deletion = True,
                                        admin_users = '*****@*****.**',
                                        allow_library_path_paste = True,
                                        database_connection = galaxy_database_connection,
                                        database_engine_option_pool_size = '10',
                                        datatype_converters_config_file = "datatype_converters_conf.xml.sample",
                                        file_path = galaxy_file_path,
                                        global_conf = global_conf,
                                        id_secret = 'changethisinproductiontoo',
                                        job_queue_workers = 5,
                                        log_destination = "stdout",
                                        migrated_tools_config = galaxy_migrated_tool_conf_file,
                                        new_file_path = galaxy_tempfiles,
                                        running_functional_tests=True,
                                        shed_tool_data_table_config = shed_tool_data_table_conf_file,
                                        shed_tool_path = galaxy_shed_tool_path,
                                        template_path = "templates",
                                        tool_data_path = tool_data_path,
                                        tool_dependency_dir = galaxy_tool_dependency_dir,
                                        tool_path = tool_path,
                                        tool_config_file = [ galaxy_tool_conf_file, galaxy_shed_tool_conf_file ],
                                        tool_sheds_config_file = galaxy_tool_sheds_conf_file,
                                        tool_parse_help = False,
                                        tool_data_table_config_path = galaxy_tool_data_table_conf_file,
                                        update_integrated_tool_panel = False,
                                        use_heartbeat = False,
                                        **kwargs )
 
 log.info( "Embedded Galaxy application started" )