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.HaltableContainer[source]

Bases: galaxy.di.Container

__init__()None[source]
Parameters

container – Optional container if provided the existing definitions will be copied

:param log_undefined_deps indicates if a log message should be emmited when an undefined dep is loaded

haltables: List[Tuple[str, Callable]]
shutdown()[source]
class galaxy.app.MinimalGalaxyApplication(fsmon=False, configure_logging=True, **kwargs)[source]

Bases: galaxy.structured_app.BasicApp, galaxy.config.ConfiguresGalaxyMixin, galaxy.app.HaltableContainer

Encapsulates the state of a minimal Galaxy application

__init__(fsmon=False, configure_logging=True, **kwargs)None[source]
Parameters

container – Optional container if provided the existing definitions will be copied

:param log_undefined_deps indicates if a log message should be emmited when an undefined dep is loaded

name: str
config: Any
configure_fluent_log()[source]
application_stack: galaxy.web_stack.ApplicationStack
model: galaxy.model.base.SharedModelMapping
security: galaxy.security.idencoding.IdEncodingHelper
auth_manager: galaxy.auth.AuthManager
toolbox: Any
security_agent: Any
quota_agent: galaxy.quota.QuotaAgent
datatypes_registry: galaxy.datatypes.registry.Registry
class galaxy.app.GalaxyManagerApplication(**kwargs)[source]

Bases: galaxy.structured_app.MinimalManagerApp, galaxy.app.MinimalGalaxyApplication

Extends the MinimalGalaxyApplication with most managers that are not tied to a web or job handling context.

__init__(**kwargs)[source]
Parameters

container – Optional container if provided the existing definitions will be copied

:param log_undefined_deps indicates if a log message should be emmited when an undefined dep is loaded

tag_handler: galaxy.model.tags.GalaxyTagHandler
user_manager: Any
hda_manager: Any
history_manager: Any
dataset_collections_service: Any
workflow_manager: Any
workflow_contents_manager: Any
library_folder_manager: Any
library_manager: Any
role_manager: Any
file_sources: galaxy.files.ConfiguredFileSources
installed_repository_manager: Any
is_webapp: bool
new_installation: bool
genome_builds: galaxy.util.dbkeys.GenomeBuilds
model: galaxy.model.mapping.GalaxyModelMapping
install_model: galaxy.model.base.ModelMapping
security_agent: galaxy.model.security.GalaxyRBACAgent
host_security_agent: galaxy.model.security.HostAgent
class galaxy.app.UniverseApplication(**kwargs)[source]

Bases: galaxy.structured_app.StructuredApp, galaxy.app.GalaxyManagerApplication

Encapsulates the state of a Universe application

__init__(**kwargs)None[source]
Parameters

container – Optional container if provided the existing definitions will be copied

:param log_undefined_deps indicates if a log message should be emmited when an undefined dep is loaded

amqp_internal_connection_obj: Optional[kombu.connection.Connection]
queue_worker: Any
dependency_resolvers_view: galaxy.tool_util.deps.views.DependencyResolversView
test_data_resolver: galaxy.tool_util.verify.test_data.TestDataResolver
dynamic_tool_manager: Any
api_keys_manager: Any
genomes: Any
data_provider_registry: Any
error_reports: Any
tool_cache: Any
tool_shed_repository_cache: Any
watchers: Any
webhooks_registry: galaxy.webhooks.WebhooksRegistry
security_agent: galaxy.model.security.GalaxyRBACAgent
host_security_agent: galaxy.model.security.HostAgent
workflow_scheduling_manager: Any
trs_proxy: galaxy.workflow.trs_proxy.TrsProxy
interactivetool_manager: Any
property is_job_handler
is_webapp: bool
new_installation: bool
tag_handler: galaxy.model.tags.GalaxyTagHandler
file_sources: galaxy.files.ConfiguredFileSources
genome_builds: galaxy.util.dbkeys.GenomeBuilds
job_metrics: galaxy.job_metrics.JobMetrics
model: galaxy.model.mapping.GalaxyModelMapping
install_model: galaxy.model.base.ModelMapping
dataset_collections_service: Any
history_manager: Any
hda_manager: Any
workflow_manager: Any
workflow_contents_manager: Any
library_folder_manager: Any
library_manager: Any
role_manager: Any
tool_data_tables: Any
job_config: Any
installed_repository_manager: Any
job_manager: Any
user_manager: Any
class galaxy.app.StatsdStructuredExecutionTimer(galaxy_statsd_client, *args, **kwds)[source]

Bases: galaxy.util.StructuredExecutionTimer

__init__(galaxy_statsd_client, *args, **kwds)[source]

Initialize self. See help(type(self)) for accurate signature.

to_str(**kwd)[source]
class galaxy.app.ExecutionTimerFactory(config)[source]

Bases: object

__init__(config)[source]

Initialize self. See help(type(self)) for accurate signature.

get_timer(*args, **kwd)[source]

galaxy.config_watchers module

class galaxy.config_watchers.ConfigWatchers(app: galaxy.structured_app.StructuredApp)[source]

Bases: object

Contains ToolConfWatcher, ToolWatcher and ToolDataWatcher objects.

__init__(app: galaxy.structured_app.StructuredApp)[source]

Initialize self. See help(type(self)) for accurate signature.

property watchers
change_state(active)[source]
start()[source]
shutdown()[source]
update_watch_data_table_paths()[source]
property data_manager_configs
property tool_data_paths
property tool_config_paths
property job_rules_paths

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]
class galaxy.main.GalaxyConfigBuilder(args=None, **kwds)[source]

Bases: object

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

__init__(args=None, **kwds)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod populate_options(arg_parser)[source]
property config_is_ini
app_kwds()[source]
global_conf()[source]
setup_logging()[source]
galaxy.main.main(func=<function app_loop>)[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, get_response=False, kwargs=None)[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=None)[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(queue_worker)[source]

Bases: object

__init__(queue_worker)[source]

Initialize self. See help(type(self)) for accurate signature.

property connection
property control_queues
property exchange
property declare_queues
on_response(message)[source]
send_task(payload, routing_key, local=False, get_response=False, timeout=10)[source]
galaxy.queue_worker.reconfigure_watcher(app, **kwargs)[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, save_integrated_tool_panel=True, **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_allowlist(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.reload_core_config(app, **kwargs)[source]
galaxy.queue_worker.reload_tour(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=None)[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=None)[source]

Initialize self. See help(type(self)) for accurate signature.

send_control_task(task, noop_self=False, get_response=False, routing_key='control.*', kwargs=None)[source]
send_local_control_task(task, get_response=False, kwargs=None)[source]
property 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)Optional[kombu.connection.Connection][source]

galaxy.version module