aboutsummaryrefslogtreecommitdiff
path: root/ec2/spark_ec2.py
diff options
context:
space:
mode:
authorAllan Douglas R. de Oliveira <allan@chaordicsystems.com>2014-05-03 16:52:19 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-05-03 16:52:19 -0700
commit4669a84ab10296e01a5fbbae1de9574b793b7ed5 (patch)
treeb295f1f39cb84ebbb9ee3e1f758bef54a154abd5 /ec2/spark_ec2.py
parent34719ba32ed421701eaa08bd47ce953cd9267ad7 (diff)
downloadspark-4669a84ab10296e01a5fbbae1de9574b793b7ed5.tar.gz
spark-4669a84ab10296e01a5fbbae1de9574b793b7ed5.tar.bz2
spark-4669a84ab10296e01a5fbbae1de9574b793b7ed5.zip
EC2 configurable workers
Added option to configure number of worker instances and to set SPARK_MASTER_OPTS Depends on: https://github.com/mesos/spark-ec2/pull/46 Author: Allan Douglas R. de Oliveira <allan@chaordicsystems.com> Closes #612 from douglaz/ec2_configurable_workers and squashes the following commits: d6c5d65 [Allan Douglas R. de Oliveira] Added master opts parameter 6c34671 [Allan Douglas R. de Oliveira] Use number of worker instances as string on template ba528b9 [Allan Douglas R. de Oliveira] Added SPARK_WORKER_INSTANCES parameter
Diffstat (limited to 'ec2/spark_ec2.py')
-rwxr-xr-xec2/spark_ec2.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index 31209a662b..db393748a3 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -103,6 +103,12 @@ def parse_args():
help="When destroying a cluster, delete the security groups that were created")
parser.add_option("--use-existing-master", action="store_true", default=False,
help="Launch fresh slaves, but use an existing stopped master if possible")
+ parser.add_option("--worker-instances", type="int", default=1,
+ help="Number of instances per worker: variable SPARK_WORKER_INSTANCES (default: 1)")
+ parser.add_option("--master-opts", type="string", default="",
+ help="Extra options to give to master through SPARK_MASTER_OPTS variable (e.g -Dspark.worker.timeout=180)")
+
+
(opts, args) = parser.parse_args()
if len(args) != 2:
@@ -223,7 +229,7 @@ def launch_cluster(conn, opts, cluster_name):
sys.exit(1)
if opts.key_pair is None:
print >> stderr, "ERROR: Must provide a key pair name (-k) to use on instances."
- sys.exit(1)
+ sys.exit(1)
print "Setting up security groups..."
master_group = get_or_make_group(conn, cluster_name + "-master")
slave_group = get_or_make_group(conn, cluster_name + "-slaves")
@@ -551,7 +557,9 @@ def deploy_files(conn, root_dir, opts, master_nodes, slave_nodes, modules):
"modules": '\n'.join(modules),
"spark_version": spark_v,
"shark_version": shark_v,
- "hadoop_major_version": opts.hadoop_major_version
+ "hadoop_major_version": opts.hadoop_major_version,
+ "spark_worker_instances": "%d" % opts.worker_instances,
+ "spark_master_opts": opts.master_opts
}
# Create a temp directory in which we will place all the files to be