-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-5668] Display region in spark_ec2.py get_existing_cluster() #4457
Conversation
Show the region for the different messages displayed by get_existing_cluster(): The search, found and error messages.
Can one of the admins verify this patch? |
ok to test |
Test build #27039 has started for PR 4457 at commit
|
Test build #27039 has finished for PR 4457 at commit
|
Test PASSed. |
@@ -607,14 +608,17 @@ def get_existing_cluster(conn, opts, cluster_name, die_on_error=True): | |||
elif (cluster_name + "-slaves") in group_names: | |||
slave_nodes.append(inst) | |||
if any((master_nodes, slave_nodes)): | |||
print "Found %d master(s), %d slaves" % (len(master_nodes), len(slave_nodes)) | |||
print "Found %d master(s), %d slaves" % (len(master_nodes), len(slave_nodes)) \ | |||
+ " in region " + opts.region |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really minor point, but I would leave this print statement unchanged since users are unlikely to take action at this particular point, and we printed the region earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nchmmas, I was wondering the same. I'll remove it when I review it. Thank you.
@MiguelPeralvo Do you think we should print the region when launching a cluster, or does that already happen? Also, I think we should update the help text for the |
Regarding the help text, I'd say that it applies to the destroy, login, reboot-slaves, get-master, stop and start options, not only launch. Something like "EC2 region to launch/destroy/login/reboot-slaves/get-master/stop/start instances in" or "EC2 region where to apply action to: launch/destroy/login/reboot-slaves/get-master/stop/start instances in" is a potential text, but I'm happy to apply any other that reflects better where the parameter region applies, maybe "EC2 region used to find instances in or to launch them in", as you proposed (all the other actions involve the search). Regarding the region being printed when launching a cluster: As the "get_existing_cluster()" method gets used by all actions, the region will get printed for all of them if the proposed change is applied. I'm in favor of the region being printed out. For example, this would be the beginning of the output of a launch execution with the region change being applied:
If we don't apply the proposed change to the "get_existing_cluster()" method, the zone appears, but not the region. For example, this would be the beginning of the output of a launch execution:
I've tested launch with the default region, without the region change and when the key pair is not found in the default region, this is the output I get from spark-ec2 (again, it makes it a little bit difficult for a new user to figure out what's wrong):
|
Please, feel free to change the wording for --region, if required.
Test build #27191 has started for PR 4457 at commit
|
Test build #27191 has finished for PR 4457 at commit
|
Test FAILed. |
Removed trailing space from line 611 to make it PEP 8 compliant.
Test build #27192 has started for PR 4457 at commit
|
Test build #27192 has finished for PR 4457 at commit
|
Test FAILed. |
The MiMa fail may be flaky. It passed in my computer. |
@@ -132,7 +132,7 @@ def parse_args(): | |||
help="Master instance type (leave empty for same as instance-type)") | |||
parser.add_option( | |||
"-r", "--region", default="us-east-1", | |||
help="EC2 region zone to launch instances in") | |||
help="EC2 region used to to launch instances in, or to find them in") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "to to". Yes the Mima result must be a false positive given the nature of this change.
Fixed typo found by @srowen "to to".
Test build #27211 has started for PR 4457 at commit
|
Test build #27211 has finished for PR 4457 at commit
|
Test PASSed. |
Looks good. If there aren't any additional comments, I can merge this soon |
LGTM |
Show the region for the different messages displayed by get_existing_cluster(): The search, found and error messages.