-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add --ec2-security-group flag support #112
Conversation
Thank you for the kind words @serialx, and sorry about the delay in reviewing this. I will try to look at it next weekend. |
@@ -23,6 +23,9 @@ providers: | |||
# vpc-id: <id> | |||
# subnet-id: <id> | |||
# placement-group: <name> | |||
# security-groups: | |||
# - sg-group1 |
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.
I was thinking these would be security group names, not IDs. I think that's more user-friendly. Do you agree?
Thanks for the clean PR, @serialx. In addition to the line comments, there was one other minor issue: The error message when the user provides a nonexistent security group is confusing.
If possible, I would prefer it if we could tell the user "Security group 'group-name' does not exist in VPC 'vpc-id'." Is there a relatively straightforward way of doing that? |
19bede3
to
942badd
Compare
Thank you for your detailed feedback. I've been testing out the group name approach and have not been successful with this error:
I guess this is not supported on VPC environments. |
About the non-existent security group I get this error:
Would this suffice? Maybe the botocore became more friendly on error cases. :) |
Regarding this error:
My intention was that we would let users pass in security group names, but wherever necessary we would translate them into security group IDs to satisfy AWS's API. That lets us separate the user-interface from what we have to pass to AWS. Does that make sense? |
bb36c00
to
593695d
Compare
Totally got your message. Revised the commit to fully support group names. :) Also, groups which are not found will issue the following error message.
|
""" | ||
ec2 = boto3.resource(service_name='ec2', region_name=region) | ||
|
||
# Resolve security group names |
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.
I think we can drop all the comments like this one since the code is pretty self-explanatory.
In general, I prefer to add comments to explain why something was done when it may not be obvious, as opposed to what was done which is usually clear enough from the code.
@serialx - Apologies for taking so long to review this. It's summertime over here and I've been spending much less time at the keyboard than usual. 😄 This PR looks pretty good to me and I'd like to get it in soon. My only remaining concern is that we are allowing the user to mix specifying security groups by name and by ID. I'd prefer it if we allowed security groups to be specified only by name. It makes the interface and code a bit simpler. Is that OK with you? Is there some case where someone might really need to specify the security group by ID and not by name? |
593695d
to
4813b6b
Compare
I think supporting only group names is fine. Changed the commit including the the changes you mentioned in the comment. |
4813b6b
to
da9826e
Compare
da9826e
to
e3226a2
Compare
Thanks @serialx. Merging this in. |
* master: 0.6.0 dev begins add some minor steps update standalone version in example this is 0.5.0 upgrade dependencies (nchammas#128) use latest Amazon Linux AMI rephrase note about future Windows support remove note about squashing PR commits up default Spark version to 1.6.2 add CHANGES for spark download source and additional security groups rename some internals related to security groups Resolve nchammas#72 add --ec2-security-group flag support (nchammas#112) added HADOOP_LIBEXEC_DIR env var (nchammas#127) Add option to download Spark from a custom URL (nchammas#125) add custom Hadoop URL change; reformat Markdown links
This PR makes the following changes:
--ec2-security-group
flag supportI tested this PR by actually launching multiple clusters that we use everyday. :)
Fixes #72
BTW, having great fun using flintrock. We've replaced our internal production spark-ec2 scripts to flintrock. We are testing it right now. Great software!