aboutsummaryrefslogtreecommitdiff
path: root/yarn
diff options
context:
space:
mode:
authorThomas Graves <tgraves@apache.org>2014-08-05 12:52:52 -0500
committerThomas Graves <tgraves@apache.org>2014-08-05 12:52:52 -0500
commit1c5555a23d3aa40423d658cfbf2c956ad415a6b1 (patch)
treeb66cee1204610fca7374300b5229520613a1474b /yarn
parent2c0f705e26ca3dfc43a1e9a0722c0e57f67c970a (diff)
downloadspark-1c5555a23d3aa40423d658cfbf2c956ad415a6b1.tar.gz
spark-1c5555a23d3aa40423d658cfbf2c956ad415a6b1.tar.bz2
spark-1c5555a23d3aa40423d658cfbf2c956ad415a6b1.zip
SPARK-1890 and SPARK-1891- add admin and modify acls
It was easier to combine these 2 jira since they touch many of the same places. This pr adds the following: - adds modify acls - adds admin acls (list of admins/users that get added to both view and modify acls) - modify Kill button on UI to take modify acls into account - changes config name of spark.ui.acls.enable to spark.acls.enable since I choose poorly in original name. We keep backwards compatibility so people can still use spark.ui.acls.enable. The acls should apply to any web ui as well as any CLI interfaces. - send view and modify acls information on to YARN so that YARN interfaces can use (yarn cli for killing applications for example). Author: Thomas Graves <tgraves@apache.org> Closes #1196 from tgravescs/SPARK-1890 and squashes the following commits: 8292eb1 [Thomas Graves] review comments b92ec89 [Thomas Graves] remove unneeded variable from applistener 4c765f4 [Thomas Graves] Add in admin acls 72eb0ac [Thomas Graves] Add modify acls
Diffstat (limited to 'yarn')
-rw-r--r--yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala
index ed8f56ab8b..44e025b8f6 100644
--- a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala
+++ b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala
@@ -37,7 +37,7 @@ import org.apache.hadoop.yarn.api.protocolrecords._
import org.apache.hadoop.yarn.api.records._
import org.apache.hadoop.yarn.conf.YarnConfiguration
import org.apache.hadoop.yarn.util.Records
-import org.apache.spark.{SparkException, Logging, SparkConf, SparkContext}
+import org.apache.spark.{Logging, SecurityManager, SparkConf, SparkContext, SparkException}
/**
* The entry point (starting in Client#main() and Client#run()) for launching Spark on YARN. The
@@ -405,6 +405,13 @@ trait ClientBase extends Logging {
amContainer.setCommands(printableCommands)
setupSecurityToken(amContainer)
+
+ // send the acl settings into YARN to control who has access via YARN interfaces
+ val securityManager = new SecurityManager(sparkConf)
+ val acls = Map[ApplicationAccessType, String] (
+ ApplicationAccessType.VIEW_APP -> securityManager.getViewAcls,
+ ApplicationAccessType.MODIFY_APP -> securityManager.getModifyAcls)
+ amContainer.setApplicationACLs(acls)
amContainer
}
}