Skip to content

pjbriggs/galaxy-admin-utils

Repository files navigation

galaxy-admin-utils

Utility scripts to help with managing local production instances of Galaxy.

Monitoring and controlling Galaxy processes in a multi-server set-up

  • galaxy_status.sh: monitor status of Galaxy server processes

    Usage: galaxy_status.sh

    Must be run from the location were the Galaxy .pid and .log files have been written.

    Reports the status of each server process that has a PID file, either Running (server is alive but not yet serving content), Active (server is available to serve content), or Not running (server is no longer alive).

  • run-server.sh: interact with a single Galaxy server process

    Usage: run-server.sh SERVER args...

    Must be executed from the directory where the run.sh and universe_wsgi.ini files are located

    Can be used to interact with a single Galaxy server process in a load-balanced set-up where there are multiple co-operating servers e.g. web0, web1, manager, handler0 etc

    For example to stop handler1 do

    $ sh run-server.sh web0 --stop-daemon

  • rolling-restart.sh: restart Galaxy processes in a "rolling" fashion

    Usage: rolling-restart.sh [OPTIONS]

    Must be executed from the directory where the run.sh and universe_wsgi.ini files are located

    Stops and starts each of the servers listed in universe_wsgi.ini in turn waiting for each one to come back online before restarting the next.

    If specified, OPTIONS can be one or more of the arguments recognised by run.sh.

    For set ups with multiple handlers and web servers this should mean that Galaxy remains available to end users throughout the restart process.

    For "legacy" Galaxy setups which specify a "manager" server process, this will not be restarted via this script (use e.g. run-server.sh instead).

Getting information about a tool on the toolshed

  • get_galaxy_slots.sh: extract references to GALAXY_SLOTS from the XML files in a toolshed repo, to get an indication of whether a tool is multicore (and an idea of the optimal number of cores to use).

    Usage: get_galaxy_slots.sh TOOL_REPO

    TOOL_REPO should be a URL from the tool's page on the toolshed, which can be hg cloned.

    Reports each XML file with a reference to GALAXY_SLOTS along with the tool id and the line that contains the reference, e.g.

    $ get_galaxy_slots.sh https://[email protected]/repos/devteam/tophat
    ...
    tophat/tophat_wrapper.xml:
    * id="tophat"
    * --num-threads="\${GALAXY_SLOTS:-4}"
    

Backing up/copying Galaxy data and codebase

  • backup_galaxy.sh: dump SQL database and rsync database files and codebase for a local Galaxy instance

    Usage: backup_galaxy.sh [--dry-run] GALAXY_DIR [ BACKUP_DIR ]

    Reads information from universe_wsgi.ini file in GALAXY_DIR and generates a dump of the SQL database, plus a "mirroring" rsync of the database files directory and the Galaxy codebase.

    Creates the following directory structure under BACKUP_DIR:

    logs/ Logs from rsyncing the files code/ Mirror of galaxy-dist, local_tools, shed_tools etc files/ Mirror of Galaxy's database/files directory sql/ Timestamped SQL dumps from Galaxy's database

    If BACKUP_DIR is not specified then it defaults to the current working directory.

    If --dry-run is specified then the directory structure is created and the SQL dump and rsync commands are constructed but not executed.

  • snapshot_galaxy.sh: make a complete copy of a local Galaxy install.

    Usage: snapshot_galaxy.sh GALAXY_DIR SNAPSHOT_DIR [ NAME ]

    Essentially does cp -a of the entire contents of a Galaxy install directory to a timestamped subdirectory under SNAPSHOT_DIR. Versions can be restored using cp -a from the snapshot directory.

    This script is only suitable for small local installs which use the SQLite database backend (i.e. those produced by the install_galaxy.sh script); for production-type instances use backup_galaxy.sh.

Quick deployment of local Galaxy instances

The old deploy_galaxy.sh script (which automatically created a basic local instance of Galaxy) has been removed - the install_galaxy.sh script https://github.com/pjbriggs/bioinf-software-install/blob/master/install_galaxy.sh has replaced it.

Bootstrapping utilities

Some simple bootstrapping utilties are in the bootstrap subdirectory. These use the bioblend package http://bioblend.readthedocs.org/en/latest/index.html to perform operations from the command line via the Galaxy API:

  • create_user.py: create a new user account
  • install_tool.py: install a tool from a toolshed

This is work in progress.

Toolbox filters

Toolbox filter files are in the toolbox_filters subdirectory:

  • metagenomics.py

See https://wiki.galaxyproject.org/UserDefinedToolboxFilters for information on installing and using toolbox filters in Galaxy.

Acknowledgements

Thanks to the following for their contributions and improvements:

About

Utility scripts for working with local instances of Penn State's Galaxy platform http://wiki.galaxyproject.org/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •