From b61435c7ff620a05bee65607aed249541ab54b13 Mon Sep 17 00:00:00 2001 From: Xiangrui Meng Date: Tue, 18 Feb 2014 18:30:02 -0800 Subject: 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 Closes #617 from mengxr/ec2 and squashes the following commits: 2dfb316 [Xiangrui Meng] check key name and identity file before launch a cluster --- ec2/spark_ec2.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ec2') diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index e88f80aa62..b0512ca891 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") -- cgit v1.2.3