Uh oh!
There was an error while loading. Please reload this page.
SPARK-2333 - spark_ec2 script should allow option for existing security group - #1899
SPARK-2333 - spark_ec2 script should allow option for existing security group#1899vidaha wants to merge 2 commits into
Conversation
vidaha
commented
Aug 12, 2014
AmplabJenkins
commented
Aug 12, 2014
Can one of the admins verify this patch? |
vidaha
commented
Aug 12, 2014
Just FYI - I tested this and it worked - not sure if it's controversial to use the name tag rather than the group for destroy a cluster. |
JoshRosen
commented
Aug 12, 2014
Why is it useful to have the cluster name be different from the security group prefix? If I want to re-use an existing security group, I can just name my cluster after that security group. The cluster name only seems to be used to name the security groups, instance requests, and instances. What would happen if I launched a cluster with a name that's different from its security group, then attempted to run spark-ec2 commands by passing only the actual security group name as the cluster name? In this case, I think the instances would still be named with the cluster name, which might cause problems since the script would be expecting to find ones named after the security group. |
vidaha
commented
Aug 12, 2014
Hi Josh, IMHO, it's best not to require a Spark cluster name and the security group to be the same. While you can reuse an existing security group to launch another cluster, you can't launch more than one cluster with the same security group. Perhaps a company wants to have an internal-applications or dev security group and reuse that for launch multiple Spark clusters. In addition, AWS has a strict limit of 100 on the number of security groups on a VPC, and since two security groups are required (one of the masters and one for the workers), this means, that only 50 Spark clusters can be launched on a VPC. While that might seem like a reasonable limit, I can easily see companies having a use case to exceed that. Do you mind illustrating the problem about name conflicts? If I understand what you are saying, you are mentioned this scenario: % ./spark-ec2 … —security-group my-security-group launch my-cluster-name And then later, you also run: % ./spark-ec2 … launch my-security-group This works fine - I tested it - there will be two clusters with the same security group, but different names. These are some error cases that I thought might offer and tested for manually and they worked out fine:
I tried this, and amazon has the correct controls to prevent deleting a security group still in use by another cluster.
I tried this as well, and since the get_existing_cluster code was modified to use the name rather than the security group to identify the instance, this works right. You can’t run: % ./spark-ec2 … launch my-cluster-name if there is already a cluster with my-cluster-name launched. Are there some other possible conflicts that you can think of? If you can write out the commands to illustrate the use cases you are thinking of - I can run them and see what happens. -Vida |
JoshRosen
commented
Aug 12, 2014
After a closer look, it looks like the existing The code in this PR looks good; a couple of TODOs:
|
JoshRosen
commented
Aug 12, 2014
Jenkins, this is ok to test. Test this please. |
SparkQA
commented
Aug 12, 2014
QA tests have started for PR 1899. This patch merges cleanly. |
SparkQA
commented
Aug 12, 2014
QA tests have started for PR 1899. This patch merges cleanly. |
SparkQA
commented
Aug 12, 2014
QA results for PR 1899: |
SparkQA
commented
Aug 12, 2014
QA results for PR 1899: |
JoshRosen
commented
Aug 13, 2014
shivaram
commented
Aug 13, 2014
Some minor comments, but otherwise LGTM. One thing that might be worth noting is that we did use tags while launching clusters for AMPCamp[1] and one issue I ran into was that sometimes the create tag command failed because of eventual consistency between the instance being allocated and the instance being tag-able. We might want to retry the tag operation a few times since it is the only way to identify instances now. [1] https://github.com/amplab/training-scripts/blob/ampcamp4/spark_ec2.py#L342 |
SparkQA
commented
Aug 14, 2014
QA tests have started for PR 1899. This patch merges cleanly. |
vidaha
commented
Aug 14, 2014
Great - I made the small edits, and added a loop for retrying the tagging logic. I tested to see if I can bring up a cluster, and it went up fine - it didn't try tagging more than once. I have no way of testing the tagging retry logic though in failure case. By the way, I'm amending my commits rather than create a new one per edit - is that standard Spark etiquette? Let me know if not. |
vanzin
commented
Aug 14, 2014
@vidaha please update the PR title and description to say what the change does. Those actually become the final commit message in git. |
SparkQA
commented
Aug 14, 2014
QA tests have started for PR 1899. This patch merges cleanly. |
SparkQA
commented
Aug 14, 2014
QA results for PR 1899: |
SparkQA
commented
Aug 14, 2014
QA results for PR 1899: |
…y group - Uses the name tag to identify machines in a cluster. - Allows overriding the security group name so it doesn't need to coincide with the cluster name. - Outputs the request id's of up to 10 pending spot instance requests.
JoshRosen
commented
Aug 15, 2014
The committers use the merge_spark_pr.py script for merging pull requests. This script will squash together all of your commits into a single commit that uses the title of the PR plus the PR's description as the commit message, so you no longer need to worry about rebasing your patch into a single commit. I'd just copy-paste the description from your last commit into the description above so it becomes the commit message |
There was a problem hiding this comment.
What happens if an add_tag call fails? My bet is that it throws an exception rather than silently failing, in which case this re-try logic won't run. Rather than using this "set-and-test" logic, maybe we can just wrap the call in a try-except block?
@shivaram Did the eventual-consistency issue that you saw result in exceptions from add_tag?
There was a problem hiding this comment.
Yes - I am pretty sure it throws an exception. I don't remember what the type is -- All I see in my notes is that the exception says 'Instance not found'
SparkQA
commented
Aug 19, 2014
QA tests have started for PR 1899 at commit
|
vidaha
commented
Aug 19, 2014
Okay, I made the retry a try catch, and edited the title again. |
SparkQA
commented
Aug 19, 2014
QA tests have finished for PR 1899 at commit
|
JoshRosen
commented
Aug 19, 2014
There was a problem hiding this comment.
Minor nit: You can remove this TODO now.
shivaram
commented
Aug 19, 2014
LGTM |
JoshRosen
commented
Aug 19, 2014
Alright, great. I'm going to merge this into |
…ty group - Uses the name tag to identify machines in a cluster. - Allows overriding the security group name so it doesn't need to coincide with the cluster name. - Outputs the request id's of up to 10 pending spot instance requests. Author: Vida Ha <vida@databricks.com> Closes#1899 from vidaha/vida/ec2-reuse-security-group and squashes the following commits: c80d5c3 [Vida Ha] wrap retries in a try catch block b2989d5 [Vida Ha] SPARK-2333: spark_ec2 script should allow option for existing security group (cherry picked from commit 94053a7) Signed-off-by: Josh Rosen <joshrosen@apache.org>
douglaz
commented
Aug 31, 2014
Opened an issue related to this PR: https://issues.apache.org/jira/browse/SPARK-3332 |
This reverts #1899 and #2163, two patches that modified `spark-ec2` so that clusters are identified using tags instead of security groups. The original motivation for this patch was to allow multiple clusters to run in the same security group. Unfortunately, tagging is not atomic with launching instances on EC2, so with this approach we have the possibility of `spark-ec2` launching instances and crashing before they can be tagged, effectively orphaning those instances. The orphaned instances won't belong to any cluster, so the `spark-ec2` script will be unable to clean them up. Since this feature may still be worth supporting, there are several alternative approaches that we might consider, including detecting orphaned instances and logging warnings, or maybe using another mechanism to group instances into clusters. For the 1.1.0 release, though, I propose that we just revert this patch. Author: Josh Rosen <joshrosen@apache.org> Closes#2225 from JoshRosen/revert-ec2-cluster-naming and squashes the following commits: 0c18e86 [Josh Rosen] Revert "SPARK-2333 - spark_ec2 script should allow option for existing security group" c2ca2d4 [Josh Rosen] Revert "Spark-3213 Fixes issue with spark-ec2 not detecting slaves created with "Launch More like this""
…ty group - Uses the name tag to identify machines in a cluster. - Allows overriding the security group name so it doesn't need to coincide with the cluster name. - Outputs the request id's of up to 10 pending spot instance requests. Author: Vida Ha <vida@databricks.com> Closesapache#1899 from vidaha/vida/ec2-reuse-security-group and squashes the following commits: c80d5c3 [Vida Ha] wrap retries in a try catch block b2989d5 [Vida Ha] SPARK-2333: spark_ec2 script should allow option for existing security group
…ing and column masking (apache#1899) Initial PR to integrate UC-Spark-Plugin