-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-5655] Don't chmod700 application files if running in YARN #4509
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
Conversation
|
Can one of the admins verify this patch? |
|
ok to test |
|
Test build #27213 has started for PR 4509 at commit
|
|
@vanzin what do you think? I think you made the original change. |
|
Let me take a look some more. I remember investigating this and that the Yarn-generated directory was already |
|
Test build #27213 has finished for PR 4509 at commit
|
|
Test PASSed. |
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.
need space before and after =
|
@growse thanks for the changes. Do we need to do something similar for |
|
Hey @growse, I tested on a kerberos cluster and did see what you mention in the bug. Thanks for that explanation. I think I was a little too paranoid with the original patch, mainly to cover the case of standalone. Since then, there has been a change in standalone mode that should make this fix a lot simpler. Basically, standalone mode now creates a per-app directory similarly to Yarn. So the code can get away with just changing the permissions of that "root" directory instead of every temp directory it creates. Talking in code, this means that That should cover both the driver in client mode (which calls that method to create a local temp directory, and thus is not under the control of the NM when running on Yarn) and also the containers in standalone and mesos. (In fact, there's a little redundancy between the work done by |
|
@andrewor14 - No problem. I don't think there's such a problem with @vanzin - Sounds good. The main point is that doing any form of permission setting in a YARN context breaks the functionality provided by the parent dir's setgid flag, as it sets the gid of the file to that of the container, rather than that of the nodemanager as it should. If there's a better solution to isolating the YARN case and not setting permissions, we should probably do that instead. |
|
Moving the chmod700 functionality has simplified this somewhat, have tested as working on YARN. |
|
Test build #27353 has started for PR 4509 at commit
|
|
Test build #27353 has finished for PR 4509 at commit
|
|
Test PASSed. |
|
That feels right-er to me. Any thoughts @vanzin? |
|
Yep, looks good. Thanks for fixing this! |
|
2 people have reviewed it, tests pass, looks like a clean fix. Since it could affect many users running YARN, I think it should back-port into 1.3. (The logic this changes wasn't present earlier, it appears.) |
[Was previously PR4507] As per SPARK-5655, recently committed code chmod 700s all application files created on the local fs by a spark executor. This is both unnecessary and broken on YARN, where files created in the nodemanager's working directory are already owned by the user running the job and the 'yarn' group. Group read permission is also needed for the auxiliary shuffle service to be able to read the files, as this is running as the 'yarn' user. Author: Andrew Rowson <github@growse.com> Closes #4509 from growse/master and squashes the following commits: 7ca993c [Andrew Rowson] Moved chmod700 functionality into Utils.getOrCreateLocalRootDirs f57ce6b [Andrew Rowson] [SPARK-5655] Don't chmod700 application files if running in a YARN container (cherry picked from commit 466b1f6) Signed-off-by: Sean Owen <sowen@cloudera.com>
|
I take it back. I think this may need to back port to 1.2 as well. Looking into that now. |
|
Yes, this should go into 1.2. Should be a clean merge, though. |
|
Merges cleanly into 1.2 here. Would personally be immensely useful to
|
[Was previously PR4507] As per SPARK-5655, recently committed code chmod 700s all application files created on the local fs by a spark executor. This is both unnecessary and broken on YARN, where files created in the nodemanager's working directory are already owned by the user running the job and the 'yarn' group. Group read permission is also needed for the auxiliary shuffle service to be able to read the files, as this is running as the 'yarn' user. Author: Andrew Rowson <github@growse.com> Closes #4509 from growse/master and squashes the following commits: 7ca993c [Andrew Rowson] Moved chmod700 functionality into Utils.getOrCreateLocalRootDirs f57ce6b [Andrew Rowson] [SPARK-5655] Don't chmod700 application files if running in a YARN container (cherry picked from commit 466b1f6) Signed-off-by: Sean Owen <sowen@cloudera.com>
|
@vanzin just a quick question as of this patch |
|
That's ok because the temp dir would be created underneath one of the "root local dirs" created by the So the top-most directory would have the right permissions (700 in the usual case, or whatever permissions Yarn sets when talking about Yarn containers). That's enough to prevent access to the underlying tree. |
|
I see, that's because all of those places call
|
|
That one could probably use the same treatment. Seems less important since, from the comment, it just stores class files created by the shell session, not really user data, but in any case, it's better to be safe. |
|
Is it a bad principle that code that needs to create local, secure storage should explicitly call chmod700? So in the case of To me, it would seem surprising to call |
( |
[Was previously PR4507] As per SPARK-5655, recently committed code chmod 700s all application files created on the local fs by a spark executor. This is both unnecessary and broken on YARN, where files created in the nodemanager's working directory are already owned by the user running the job and the 'yarn' group. Group read permission is also needed for the auxiliary shuffle service to be able to read the files, as this is running as the 'yarn' user. Author: Andrew Rowson <github@growse.com> Closes apache#4509 from growse/master and squashes the following commits: 7ca993c [Andrew Rowson] Moved chmod700 functionality into Utils.getOrCreateLocalRootDirs f57ce6b [Andrew Rowson] [SPARK-5655] Don't chmod700 application files if running in a YARN container (cherry picked from commit 466b1f6) Signed-off-by: Sean Owen <sowen@cloudera.com>
[Was previously PR4507]
As per SPARK-5655, recently committed code chmod 700s all application files created on the local fs by a spark executor. This is both unnecessary and broken on YARN, where files created in the nodemanager's working directory are already owned by the user running the job and the 'yarn' group. Group read permission is also needed for the auxiliary shuffle service to be able to read the files, as this is running as the 'yarn' user.