|
39 | 39 | from optparse import OptionParser |
40 | 40 | from sys import stderr |
41 | 41 |
|
| 42 | +SPARK_EC2_VERSION = "1.2.0" |
| 43 | +SPARK_EC2_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 44 | + |
42 | 45 | VALID_SPARK_VERSIONS = set([ |
43 | 46 | "0.7.3", |
44 | 47 | "0.8.0", |
|
54 | 57 | "1.2.0", |
55 | 58 | ]) |
56 | 59 |
|
57 | | -DEFAULT_SPARK_VERSION = "1.2.0" |
| 60 | +DEFAULT_SPARK_VERSION = SPARK_EC2_VERSION |
58 | 61 | DEFAULT_SPARK_GITHUB_REPO = "https://github.com/apache/spark" |
59 | | -SPARK_EC2_DIR = os.path.dirname(os.path.realpath(__file__)) |
60 | 62 | MESOS_SPARK_EC2_BRANCH = "branch-1.3" |
61 | 63 |
|
62 | 64 | # A URL prefix from which to fetch AMI information |
@@ -103,12 +105,10 @@ class UsageError(Exception): |
103 | 105 | # Configure and parse our command-line arguments |
104 | 106 | def parse_args(): |
105 | 107 | parser = OptionParser( |
106 | | - usage="spark-ec2 [options] <action> <cluster_name>" |
107 | | - + "\n\n<action> can be: launch, destroy, login, stop, start, get-master, reboot-slaves", |
108 | | - add_help_option=False) |
109 | | - parser.add_option( |
110 | | - "-h", "--help", action="help", |
111 | | - help="Show this help message and exit") |
| 108 | + prog="spark-ec2", |
| 109 | + version="%prog {v}".format(v=SPARK_EC2_VERSION), |
| 110 | + usage="%prog [options] <action> <cluster_name>\n\n" |
| 111 | + + "<action> can be: launch, destroy, login, stop, start, get-master, reboot-slaves") |
112 | 112 | parser.add_option( |
113 | 113 | "-s", "--slaves", type="int", default=1, |
114 | 114 | help="Number of slaves to launch (default: %default)") |
|
0 commit comments