Warning

This document is for an in-development version 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 = {'disable_existing_loggers': False, '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'}, 'amqp': {'qualname': 'amqp', 'level': 'INFO'}}, 'root': {'level': 'DEBUG', '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', 'track_jobs_in_database')
__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, attach_to_pools=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, get_response=False, routing_key='control.*', 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. Set noop_self to True to not run task for current process. Set get_response to True to wait for and return the task results as a list.

class galaxy.queue_worker.ControlTask(control_worker)[source]

Bases: object

__init__(control_worker)[source]
connection
control_queues
exchange
declare_queues
on_response(message)[source]
send_task(payload, routing_key, local=False, get_response=False, timeout=10)[source]
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.reload_job_rules(app, **kwargs)[source]
galaxy.queue_worker.job_rule_modules(app)[source]
galaxy.queue_worker.admin_job_lock(app, **kwargs)[source]
class galaxy.queue_worker.GalaxyQueueWorker(app, task_mapping={'admin_job_lock': <function admin_job_lock at 0x7fcf3b494938>, 'create_panel_section': <function create_panel_section at 0x7fcf3b490f50>, 'rebuild_toolbox_search_index': <function rebuild_toolbox_search_index at 0x7fcf3b494758>, 'recalculate_user_disk_usage': <function recalculate_user_disk_usage at 0x7fcf3b494668>, 'reload_data_managers': <function reload_data_managers at 0x7fcf3b494500>, 'reload_display_application': <function reload_display_application at 0x7fcf3b494578>, 'reload_job_rules': <function reload_job_rules at 0x7fcf3b4947d0>, 'reload_sanitize_whitelist': <function reload_sanitize_whitelist at 0x7fcf3b4945f0>, 'reload_tool': <function reload_tool at 0x7fcf3b494398>, 'reload_tool_data_tables': <function reload_tool_data_tables at 0x7fcf3b4946e0>, 'reload_toolbox': <function reload_toolbox at 0x7fcf3b494410>})[source]

Bases: kombu.mixins.ConsumerProducerMixin, 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, task_mapping={'admin_job_lock': <function admin_job_lock at 0x7fcf3b494938>, 'create_panel_section': <function create_panel_section at 0x7fcf3b490f50>, 'rebuild_toolbox_search_index': <function rebuild_toolbox_search_index at 0x7fcf3b494758>, 'recalculate_user_disk_usage': <function recalculate_user_disk_usage at 0x7fcf3b494668>, 'reload_data_managers': <function reload_data_managers at 0x7fcf3b494500>, 'reload_display_application': <function reload_display_application at 0x7fcf3b494578>, 'reload_job_rules': <function reload_job_rules at 0x7fcf3b4947d0>, 'reload_sanitize_whitelist': <function reload_sanitize_whitelist at 0x7fcf3b4945f0>, 'reload_tool': <function reload_tool at 0x7fcf3b494398>, 'reload_tool_data_tables': <function reload_tool_data_tables at 0x7fcf3b4946e0>, 'reload_toolbox': <function reload_toolbox at 0x7fcf3b494410>})[source]
declare_queues
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(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.

galaxy.queues.control_queues_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