commit/galaxy-central: 3 new changesets
3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/bf69f8db6dbb/ Changeset: bf69f8db6dbb Branch: stable User: dannon Date: 2013-05-30 17:23:29 Summary: Add specific ami functionality (via GET param) to cloudlaunch. Prevent existing instance selection when using a share string. Affected #: 2 files diff -r be47a7f089f91c4b72c0c5f89182a62589389e1f -r bf69f8db6dbb1fd7c6ec16fb97b2e7c763f2ab55 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py --- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py +++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py @@ -35,8 +35,8 @@ BaseUIController.__init__(self, app) @web.expose - def index(self, trans, share_string=None): - return trans.fill_template("cloud/index.mako", default_keypair = DEFAULT_KEYPAIR, share_string=share_string) + def index(self, trans, share_string=None, ami=None): + return trans.fill_template("cloud/index.mako", default_keypair = DEFAULT_KEYPAIR, share_string=share_string, ami=ami) @web.expose def get_account_info(self, trans, key_id, secret, **kwargs): @@ -92,7 +92,7 @@ return to_json_string(account_info) @web.expose - def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, zone=None, **kwargs): + def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=DEFAULT_AMI, zone=None, **kwargs): ec2_error = None try: # Create security group & key pair used when starting an instance @@ -113,11 +113,14 @@ user_provided_data['password'] = password if share_string: user_provided_data['share_string'] = share_string + rs = run_instance(ec2_conn=ec2_conn, + image_id = ami, user_provided_data=user_provided_data, key_name=kp_name, security_groups=[sg_name], - placement=zone) + placement=zone + ) if rs: instance = rs.instances[0] ct = 0 @@ -266,7 +269,7 @@ return None, None return kp.name, kp.material -def run_instance(ec2_conn, user_provided_data, image_id=DEFAULT_AMI, +def run_instance(ec2_conn, user_provided_data, image_id=None, kernel_id=None, ramdisk_id=None, key_name=DEFAULT_KEYPAIR, placement=None, security_groups=['CloudMan']): """ Start an instance. If instance start was OK, return the ResultSet object diff -r be47a7f089f91c4b72c0c5f89182a62589389e1f -r bf69f8db6dbb1fd7c6ec16fb97b2e7c763f2ab55 templates/webapps/galaxy/cloud/index.mako --- a/templates/webapps/galaxy/cloud/index.mako +++ b/templates/webapps/galaxy/cloud/index.mako @@ -202,12 +202,14 @@ </div><div id="hidden_options"> + %if not share_string: <div id='existing_instance_wrapper' style="display:none;" class="form-row"><label for="id_existing_instance">Instances in your account</label><select name="existing_instance" id="id_existing_instance"></select><input id='id_zone' type='hidden' name='zone' value=''/></div> + %endif <div id='cluster_name_wrapper' class="form-row"><label for="id_cluster_name">Cluster Name</label><input type="text" size="40" class="text-and-autocomplete-select" name="cluster_name" id="id_cluster_name"/><br/> @@ -244,6 +246,10 @@ </div> %endif + %if ami: + <input type='hidden' name='ami' value='${ami}'/> + %endif + <div class="form-row"><label for="id_instance_type">Instance Type</label><select name="instance_type" id="id_instance_type"> https://bitbucket.org/galaxy/galaxy-central/commits/51c57629182d/ Changeset: 51c57629182d Branch: stable User: dannon Date: 2013-05-31 17:55:46 Summary: Add bucket_default userData (param-based only) to cloudlaunch. Affected #: 2 files diff -r bf69f8db6dbb1fd7c6ec16fb97b2e7c763f2ab55 -r 51c57629182d2a77e5ddfe2742919a2412d42898 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py --- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py +++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py @@ -35,8 +35,12 @@ BaseUIController.__init__(self, app) @web.expose - def index(self, trans, share_string=None, ami=None): - return trans.fill_template("cloud/index.mako", default_keypair = DEFAULT_KEYPAIR, share_string=share_string, ami=ami) + def index(self, trans, share_string=None, ami=None, bucket_default = None): + return trans.fill_template("cloud/index.mako", + default_keypair = DEFAULT_KEYPAIR, + share_string=share_string, + ami=ami, + bucket_default=bucket_default) @web.expose def get_account_info(self, trans, key_id, secret, **kwargs): @@ -92,7 +96,7 @@ return to_json_string(account_info) @web.expose - def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=DEFAULT_AMI, zone=None, **kwargs): + def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=DEFAULT_AMI, zone=None, bucket_default=None, **kwargs): ec2_error = None try: # Create security group & key pair used when starting an instance @@ -113,6 +117,8 @@ user_provided_data['password'] = password if share_string: user_provided_data['share_string'] = share_string + if bucket_default: + user_provided_data['bucket_default'] = bucket_default rs = run_instance(ec2_conn=ec2_conn, image_id = ami, diff -r bf69f8db6dbb1fd7c6ec16fb97b2e7c763f2ab55 -r 51c57629182d2a77e5ddfe2742919a2412d42898 templates/webapps/galaxy/cloud/index.mako --- a/templates/webapps/galaxy/cloud/index.mako +++ b/templates/webapps/galaxy/cloud/index.mako @@ -250,6 +250,10 @@ <input type='hidden' name='ami' value='${ami}'/> %endif + %if bucket_default: + <input type='hidden' name='bucket_default' value='${bucket_default}'/> + %endif + <div class="form-row"><label for="id_instance_type">Instance Type</label><select name="instance_type" id="id_instance_type"> https://bitbucket.org/galaxy/galaxy-central/commits/64bc5a64b19e/ Changeset: 64bc5a64b19e Branch: stable User: dannon Date: 2013-06-30 07:26:31 Summary: Make default ami configurable via universe Affected #: 3 files diff -r 51c57629182d2a77e5ddfe2742919a2412d42898 -r 64bc5a64b19ea3161f95e74702cc1d44fb50e4e3 lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -251,6 +251,7 @@ self.datatypes_config = kwargs.get( 'datatypes_config_file', 'datatypes_conf.xml' ) # Cloud configuration options self.enable_cloud_launch = string_as_bool( kwargs.get( 'enable_cloud_launch', False ) ) + self.cloudlaunch_default_ami = kwargs.get( 'cloudlaunch_default_ami', 'ami-118bfc78' ) # Galaxy messaging (AMQP) configuration options self.amqp = {} try: diff -r 51c57629182d2a77e5ddfe2742919a2412d42898 -r 64bc5a64b19ea3161f95e74702cc1d44fb50e4e3 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py --- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py +++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py @@ -26,7 +26,6 @@ PKEY_PREFIX = 'gxy_pkey' DEFAULT_KEYPAIR = 'cloudman_keypair' -DEFAULT_AMI = 'ami-da58aab3' class CloudController(BaseUIController): @@ -96,7 +95,7 @@ return to_json_string(account_info) @web.expose - def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=DEFAULT_AMI, zone=None, bucket_default=None, **kwargs): + def launch_instance(self, trans, cluster_name, password, key_id, secret, instance_type, share_string, keypair, ami=None, zone=None, bucket_default=None, **kwargs): ec2_error = None try: # Create security group & key pair used when starting an instance @@ -120,6 +119,9 @@ if bucket_default: user_provided_data['bucket_default'] = bucket_default + if not ami: + ami = trans.app.config.cloudlaunch_default_ami + rs = run_instance(ec2_conn=ec2_conn, image_id = ami, user_provided_data=user_provided_data, diff -r 51c57629182d2a77e5ddfe2742919a2412d42898 -r 64bc5a64b19ea3161f95e74702cc1d44fb50e4e3 universe_wsgi.ini.sample --- a/universe_wsgi.ini.sample +++ b/universe_wsgi.ini.sample @@ -316,9 +316,10 @@ # Note that this requires java > 1.4 for executing yuicompressor.jar #pack_scripts = False -# Enable Cloud Launch +# Cloud Launch #enable_cloud_launch = False +#cloudlaunch_default_ami = ami-118bfc78 # -- Advanced proxy features Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org