From b0dfdbdd181d1eea83d70dd0959297903952dd74 Mon Sep 17 00:00:00 2001 From: Holden Karau Date: Tue, 16 Dec 2014 14:37:04 -0800 Subject: SPARK-4767: Add support for launching in a specified placement group to spark_ec2 Placement groups are cool and all the cool kids are using them. Lets add support for them to spark_ec2.py because I'm lazy Author: Holden Karau Closes #3623 from holdenk/SPARK-4767-add-support-for-launching-in-a-specified-placement-group-to-spark-ec2-scripts and squashes the following commits: 111a5fd [Holden Karau] merge in master 70ace25 [Holden Karau] Placement groups are cool and all the cool kids are using them. Lets add support for them to spark_ec2.py because I'm lazy --- ec2/spark_ec2.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ec2') diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index 92adfd2d07..4e8f5c1f44 100755 --- a/ec2/spark_ec2.py +++ b/ec2/spark_ec2.py @@ -120,6 +120,10 @@ def parse_args(): "Only possible on EBS-backed AMIs. " + "EBS volumes are only attached if --ebs-vol-size > 0." + "Only support up to 8 EBS volumes.") + parser.add_option("--placement-group", type="string", default=None, + help="Which placement group to try and launch " + + "instances into. Assumes placement group is already " + + "created.") parser.add_option( "--swap", metavar="SWAP", type="int", default=1024, help="Swap space to set up per node, in MB (default: %default)") @@ -429,6 +433,7 @@ def launch_cluster(conn, opts, cluster_name): instance_type=opts.instance_type, block_device_map=block_map, subnet_id=opts.subnet_id, + placement_group=opts.placement_group, user_data=user_data_content) my_req_ids += [req.id for req in slave_reqs] i += 1 @@ -482,6 +487,7 @@ def launch_cluster(conn, opts, cluster_name): max_count=num_slaves_this_zone, block_device_map=block_map, subnet_id=opts.subnet_id, + placement_group=opts.placement_group, user_data=user_data_content) slave_nodes += slave_res.instances print "Launched %d slaves in %s, regid = %s" % (num_slaves_this_zone, @@ -509,7 +515,9 @@ def launch_cluster(conn, opts, cluster_name): max_count=1, block_device_map=block_map, subnet_id=opts.subnet_id, + placement_group=opts.placement_group, user_data=user_data_content) + master_nodes = master_res.instances print "Launched master in %s, regid = %s" % (zone, master_res.id) -- cgit v1.2.3