# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User rc # Date 1288148662 14400 # Node ID 29157e97e95453c5f9022d9c571527a6de4032e1 # Parent af2d04e3568078d8d7ad94e229a17983f8282e20 Added setup script to configure RabbitMQ --- a/transfer_datasets.ini.sample +++ b/transfer_datasets.ini.sample @@ -3,13 +3,8 @@ [data_transfer_user_login_info] #email = datatx@bx.psu.edu #password = datatx - -# The following section contains 4 config variables neede for the data transfer. -# Please copy the exact values for each of these variables from the universe_wsgi.ini -# configuration file for this installation +#api_key = Generate it from the User menu in Galaxy [universe_wsgi_config] -#host = 127.0.0.1 -#port = -#database_connection = -#library_import_dir = +# The http server section name in the Galaxy config file (universe_wsgi.ini) +#http_server_section = server:main --- a/universe_wsgi.ini.sample +++ b/universe_wsgi.ini.sample @@ -420,4 +420,4 @@ upload1 = local:/// #queue = galaxy_queue #exchange = galaxy_exchange #routing_key = bar_code_scanner - +#rabbitmqctl_path = /path/to/rabbitmqctl --- /dev/null +++ b/scripts/galaxy_messaging/server/setup_rabbitmq.py @@ -0,0 +1,34 @@ +# +# Configuration script for RabbitMQ in Galaxy +# +# Requirements: +# - set the rabbitmqctl_path variable in the 'galaxy_amqp' section in Galaxy config file +# +# Usage: +# $ python setup_rabbitmq.py <Galaxy config file> +# + +import os, sys, csv, ConfigParser + +def main( config_file ): + config = ConfigParser.ConfigParser() + config.read( config_file ) + rabbitmqctl_path = config.get( 'galaxy_amqp', 'rabbitmqctl_path' ) + username = config.get( 'galaxy_amqp', 'userid' ) + password = config.get( 'galaxy_amqp', 'password' ) + virtual_host = config.get( 'galaxy_amqp', 'virtual_host' ) + + cmd_list = [ + 'add_user %s %s' % ( username, password ), + 'add_vhost %s' % config.get( 'galaxy_amqp', 'virtual_host' ), + 'set_permissions -p %s %s "%s.*" ".*" ".*"' % ( virtual_host, username, username ) + ] + + for cmd in cmd_list: + retval = os.system( rabbitmqctl_path + ' ' + cmd ) + if retval: + print "Failed command: %s" % cmd + sys.exit(1) + +if __name__ == '__main__': + main( sys.argv[1] )