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 package

Galaxy root package – this is a namespace package.

Subpackages

Submodules

galaxy.app module

class galaxy.app.UniverseApplication(**kwargs)[source]

Bases: galaxy.config.ConfiguresGalaxyMixin

Encapsulates the state of a Universe application

__init__(**kwargs)[source]
shutdown()[source]
configure_fluent_log()[source]
is_job_handler

galaxy.config module

Universe configuration builder.

galaxy.config.LOGGING_CONFIG_DEFAULT = {'filters': {'stack': {'()': 'galaxy.web.stack.application_stack_log_filter'}}, 'formatters': {'stack': {'()': 'galaxy.web.stack.application_stack_log_formatter'}}, 'handlers': {'console': {'filters': ['stack'], 'formatter': 'stack', 'class': 'logging.StreamHandler', 'stream': 'ext://sys.stderr', 'level': 'DEBUG'}}, 'loggers': {'paste.httpserver.ThreadPool': {'qualname': 'paste.httpserver.ThreadPool', 'level': 'WARN'}, 'routes.middleware': {'qualname': 'routes.middleware', 'level': 'WARN'}, 'galaxy': {'qualname': 'galaxy', 'level': 'DEBUG', 'propagate': 0, 'handlers': ['console']}}, 'root': {'level': 'INFO', 'handlers': ['console']}, 'version': 1}

Default value for logging configuration, passed to logging.config.dictConfig()

galaxy.config.resolve_path(path, root)[source]

If ‘path’ is relative make absolute by prepending ‘root’

galaxy.config.find_path(kwargs, var, root)[source]

Find a configuration path that may exist at different defaults.

galaxy.config.find_root(kwargs)[source]
class galaxy.config.Configuration(**kwargs)[source]

Bases: object

deprecated_options = ('database_file',)
__init__(**kwargs)[source]
sentry_dsn_public

Sentry URL with private key removed for use in client side scripts, sentry server will need to be configured to accept events

reload_sanitize_whitelist(explicit=True)[source]
get(key, default)[source]
get_bool(key, default)[source]
ensure_tempdir()[source]
check()[source]
is_admin_user(user)[source]

Determine if the provided user is listed in admin_users.

NOTE: This is temporary, admin users will likely be specified in the
database in the future.
resolve_path(path)[source]

Resolve a path relative to Galaxy’s root.

guess_galaxy_port()[source]
galaxy.config.parse_dependency_options(kwargs, root, dependency_resolvers_config_file)[source]
galaxy.config.get_database_engine_options(kwargs, model_prefix='')[source]

Allow options for the SQLAlchemy database engine to be passed by using the prefix “database_engine_option”.

galaxy.config.get_database_url(config)[source]
galaxy.config.init_models_from_config(config, map_install_models=False, object_store=None, trace_logger=None)[source]
galaxy.config.configure_logging(config)[source]

Allow some basic logging configuration to be read from ini file.

This should be able to consume either a galaxy.config.Configuration object or a simple dictionary of configuration variables.

class galaxy.config.ConfiguresGalaxyMixin[source]

Bases: object

Shared code for configuring Galaxy-like app objects.

wait_for_toolbox_reload(old_toolbox)[source]

galaxy.main module

Entry point for starting Galaxy without starting as part of a web server.

Example Usage: Start a job/workflow handler without a web server and with a given name using.

galaxy-main –server-name handler0

Start as a daemon with (requires daemonized - install with ‘pip install daemonize’):

galaxy-main -d –daemon-log-file=handler0-daemon.log –pid-file handler0.pid –server-name handler0

In daemon mode logging of Galaxy (as opposed to this script) is configured via a loggers section in Galaxy’s ini file - this can be overridden with sensible defaults logging to a single file with the following:

galaxy-main -d –server-name handler0 –daemon-log-file=handler0-daemon.log –pid-file handler0.pid –log-file handler0.log

This can also be used to start Galaxy as a uWSGI mule, e.g. for job handling:

uwsgi … –py-call-osafterfork –mule=lib/galaxy/main.py –mule=lib/galaxy/main.py –farm=job-handlers:1,2

The –py-call-osafterfork allows for proper shutdown on SIGTERM/SIGINT.

galaxy.main.load_galaxy_app(config_builder, config_env=False, log=None, **kwds)[source]
galaxy.main.handle_signal(signum, frame)[source]
galaxy.main.register_signals()[source]
galaxy.main.app_loop(args, log)[source]
galaxy.main.absolute_config_path(path, galaxy_root)[source]
galaxy.main.find_config(supplied_config, galaxy_root)[source]
class galaxy.main.GalaxyConfigBuilder(args=None, **kwds)[source]

Bases: object

Generate paste-like configuration from supplied command-line arguments.

__init__(args=None, **kwds)[source]
classmethod populate_options(arg_parser)[source]
config_is_ini
app_kwds()[source]
global_conf()[source]
setup_logging()[source]
galaxy.main.main()[source]

galaxy.queue_worker module

Galaxy control queue and worker. This is used to handle ‘app’ control like reloading the toolbox, etc., across multiple processes.

galaxy.queue_worker.send_local_control_task(app, task, kwargs={})[source]

This sends a message to the process-local control worker, which is useful for one-time asynchronous tasks like recalculating user disk usage.

galaxy.queue_worker.send_control_task(app, task, noop_self=False, kwargs={})[source]

This sends a control task out to all processes, useful for things like reloading a data table, which needs to happen individually in all processes.

galaxy.queue_worker.create_panel_section(app, **kwargs)[source]

Updates in memory toolbox dictionary.

galaxy.queue_worker.reload_tool(app, **kwargs)[source]
galaxy.queue_worker.reload_toolbox(app, **kwargs)[source]
galaxy.queue_worker.reload_data_managers(app, **kwargs)[source]
galaxy.queue_worker.reload_display_application(app, **kwargs)[source]
galaxy.queue_worker.reload_sanitize_whitelist(app)[source]
galaxy.queue_worker.recalculate_user_disk_usage(app, **kwargs)[source]
galaxy.queue_worker.reload_tool_data_tables(app, **kwargs)[source]
galaxy.queue_worker.rebuild_toolbox_search_index(app, **kwargs)[source]
galaxy.queue_worker.admin_job_lock(app, **kwargs)[source]
class galaxy.queue_worker.GalaxyQueueWorker(app, queue=None, task_mapping={'admin_job_lock': <function admin_job_lock at 0x7f6a6456fe60>, 'create_panel_section': <function create_panel_section at 0x7f6a6456f9b0>, 'rebuild_toolbox_search_index': <function rebuild_toolbox_search_index at 0x7f6a6456fde8>, 'recalculate_user_disk_usage': <function recalculate_user_disk_usage at 0x7f6a6456fcf8>, 'reload_data_managers': <function reload_data_managers at 0x7f6a6456fb90>, 'reload_display_application': <function reload_display_application at 0x7f6a6456fc08>, 'reload_sanitize_whitelist': <function reload_sanitize_whitelist at 0x7f6a6456fc80>, 'reload_tool': <function reload_tool at 0x7f6a6456fa28>, 'reload_tool_data_tables': <function reload_tool_data_tables at 0x7f6a6456fd70>, 'reload_toolbox': <function reload_toolbox at 0x7f6a6456faa0>}, connection=None)[source]

Bases: kombu.mixins.ConsumerMixin, threading.Thread

This is a flexible worker for galaxy’s queues. Each process, web or handler, will have one of these used for dispatching so called ‘control’ tasks.

__init__(app, queue=None, task_mapping={'admin_job_lock': <function admin_job_lock at 0x7f6a6456fe60>, 'create_panel_section': <function create_panel_section at 0x7f6a6456f9b0>, 'rebuild_toolbox_search_index': <function rebuild_toolbox_search_index at 0x7f6a6456fde8>, 'recalculate_user_disk_usage': <function recalculate_user_disk_usage at 0x7f6a6456fcf8>, 'reload_data_managers': <function reload_data_managers at 0x7f6a6456fb90>, 'reload_display_application': <function reload_display_application at 0x7f6a6456fc08>, 'reload_sanitize_whitelist': <function reload_sanitize_whitelist at 0x7f6a6456fc80>, 'reload_tool': <function reload_tool at 0x7f6a6456fa28>, 'reload_tool_data_tables': <function reload_tool_data_tables at 0x7f6a6456fd70>, 'reload_toolbox': <function reload_toolbox at 0x7f6a6456faa0>}, connection=None)[source]
bind_and_start()[source]
get_consumers(Consumer, channel)[source]
process_task(body, message)[source]
shutdown()[source]

galaxy.queues module

All message queues used by Galaxy

galaxy.queues.all_control_queues_for_declare(config, application_stack)[source]

For in-memory routing (used by sqlalchemy-based transports), we need to be able to build the entire routing table in producers.

Refactor later to actually persist this somewhere instead of building it repeatedly.

galaxy.queues.control_queue_from_config(config)[source]

Returns a Queue instance with the correct name and routing key for this galaxy process’s config

galaxy.queues.connection_from_config(config)[source]

galaxy.version module