Repository: incubator-spark
Updated Branches:
  refs/heads/master d9bb32a79 -> b61435c7f


SPARK-1106: check key name and identity file before launch a cluster

I launched an EC2 cluster without providing a key name and an identity file. 
The error showed up after two minutes. It would be good to check those options 
before launch, given the fact that EC2 billing rounds up to hours.

JIRA: https://spark-project.atlassian.net/browse/SPARK-1106

Author: Xiangrui Meng <m...@databricks.com>

Closes #617 from mengxr/ec2 and squashes the following commits:

2dfb316 [Xiangrui Meng] check key name and identity file before launch a cluster


Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/b61435c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/b61435c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/b61435c7

Branch: refs/heads/master
Commit: b61435c7ff620a05bee65607aed249541ab54b13
Parents: d9bb32a
Author: Xiangrui Meng <m...@databricks.com>
Authored: Tue Feb 18 18:30:02 2014 -0800
Committer: Reynold Xin <r...@apache.org>
Committed: Tue Feb 18 18:30:02 2014 -0800

----------------------------------------------------------------------
 ec2/spark_ec2.py | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/b61435c7/ec2/spark_ec2.py
----------------------------------------------------------------------
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index e88f80a..b0512ca 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -218,6 +218,12 @@ def get_spark_ami(opts):
 # Returns a tuple of EC2 reservation objects for the master and slaves
 # Fails if there already instances running in the cluster's groups.
 def launch_cluster(conn, opts, cluster_name):
+  if opts.identity_file is None:
+    print >> stderr, "ERROR: Must provide an identity file (-i) for ssh 
connections."
+    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)    
   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")

Reply via email to