Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.webapps.galaxy package

Subpackages

Submodules

galaxy.webapps.galaxy.buildapp module

Provides factory methods to assemble the Galaxy web application

class galaxy.webapps.galaxy.buildapp.GalaxyWebApplication(galaxy_app, session_cookie='galaxysession', name=None)[source]

Bases: WebApplication

injection_aware: bool = True
galaxy.webapps.galaxy.buildapp.app_factory(*args, **kwargs)[source]

Return a wsgi application serving the root object

galaxy.webapps.galaxy.buildapp.app_pair(global_conf, load_app_kwds=None, wsgi_preflight=True, **kwargs)[source]

Return a wsgi application serving the root object and the Galaxy application.

When creating an app for asgi, set wsgi_preflight to False to allow FastAPI middleware to handle CORS options, etc..

galaxy.webapps.galaxy.buildapp.postfork_setup()[source]
galaxy.webapps.galaxy.buildapp.populate_api_routes(webapp, app)[source]
galaxy.webapps.galaxy.buildapp.wrap_in_middleware(app, global_conf, application_stack, **local_conf)[source]

Based on the configuration wrap app in a set of common and useful middleware.

galaxy.webapps.galaxy.fast_app module

galaxy.webapps.galaxy.fast_app.add_galaxy_middleware(app: FastAPI, gx_app)[source]
galaxy.webapps.galaxy.fast_app.initialize_fast_app(gx_wsgi_webapp, gx_app)[source]

galaxy.webapps.galaxy.fast_factory module

Module containing factory class for building uvicorn app for Galaxy.

Information on uvicorn, its various settings, and how to invoke it can be found at https://www.uvicorn.org/.

Galaxy can be launched with uvicorn using the following invocation:

uvicorn --app-dir lib --factory galaxy.webapps.galaxy.fast_factory:factory

Use the environment variable GALAXY_CONFIG_FILE to specify a Galaxy configuration file. Galaxy configuration can be loading from a YAML or an .ini file (reads app:main currently but can be overridden with GALAXY_CONFIG_SECTION).

GALAXY_CONFIG_FILE=config/galaxy.yml uvicorn --app-dir lib --factory galaxy.webapps.galaxy.fast_factory:factory

Note

Information on additional ways to configure uvicorn can be found at https://www.uvicorn.org/.

Warning

If an ini file is supplied via GALAXY_CONFIG_FILE, the server properties such as host and port are not read from the file like older forms of configuring Galaxy.

Gunicorn is a server with more complex management options.

This factory function can be executed as a uvicorn worker managed with gunicorn with the following command-line.

gunicorn 'galaxy.webapps.galaxy.fast_factory:factory()' --env GALAXY_CONFIG_FILE=config/galaxy.ini --pythonpath lib -w 4 -k uvicorn.workers.UvicornWorker --config lib/galaxy/web_stack/gunicorn_config.py
galaxy.webapps.galaxy.fast_factory.factory()[source]

galaxy.webapps.galaxy.workers module