aboutsummaryrefslogtreecommitdiff
path: root/ec2
diff options
context:
space:
mode:
authorHolden Karau <holden@pigscanfly.ca>2014-12-16 14:37:04 -0800
committerJosh Rosen <joshrosen@databricks.com>2014-12-16 14:37:04 -0800
commitb0dfdbdd181d1eea83d70dd0959297903952dd74 (patch)
tree9df39af8a1500d717881ecf93f684e1c70e88f8d /ec2
parent6530243a52b05007e566d458cd8f075e851e91f1 (diff)
downloadspark-b0dfdbdd181d1eea83d70dd0959297903952dd74.tar.gz
spark-b0dfdbdd181d1eea83d70dd0959297903952dd74.tar.bz2
spark-b0dfdbdd181d1eea83d70dd0959297903952dd74.zip
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 <holden@pigscanfly.ca> 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
Diffstat (limited to 'ec2')
-rwxr-xr-xec2/spark_ec2.py8
1 files changed, 8 insertions, 0 deletions
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)