1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/b9af82c027e7/ Changeset: b9af82c027e7 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 b37711ed16fe64bc96ec8eacc6e6ce7026643bab -r b9af82c027e7d720214f12f212adc592e6841ce9 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 b37711ed16fe64bc96ec8eacc6e6ce7026643bab -r b9af82c027e7d720214f12f212adc592e6841ce9 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"> 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.