HyukjinKwon commented on a change in pull request #33121:
URL: https://github.com/apache/spark/pull/33121#discussion_r660259216



##########
File path: project/SparkBuild.scala
##########
@@ -802,11 +805,29 @@ object Hive {
 }
 
 object YARN {
+  val genConfigProperties = TaskKey[Unit]("gen-config-properties",
+    "Generate config.properties which contains a setting whether Hadoop is 
provided or not")
+  val propFileName = "config.properties"
+
   lazy val settings = Seq(
     excludeDependencies --= Seq(
       ExclusionRule(organization = "com.sun.jersey"),
       ExclusionRule("javax.servlet", "javax.servlet-api"),
-      ExclusionRule("javax.ws.rs", "jsr311-api"))
+      ExclusionRule("javax.ws.rs", "jsr311-api")),
+      Compile / unmanagedResources :=

Review comment:
       nit but looks like should indent 2 spaces back for these

##########
File path: project/SparkBuild.scala
##########
@@ -413,6 +413,9 @@ object SparkBuild extends PomBuild {
 
   enable(KubernetesIntegrationTests.settings)(kubernetesIntegrationTests)
 
+  if (profiles.contains("hadoop-provided")) {
+    sys.props("spark.yarn.isHadoopProvided") = "true"
+  }

Review comment:
       nit but would it be better to move this logic into the `YARN`?

##########
File path: project/SparkBuild.scala
##########
@@ -802,11 +805,29 @@ object Hive {
 }
 
 object YARN {
+  val genConfigProperties = TaskKey[Unit]("gen-config-properties",
+    "Generate config.properties which contains a setting whether Hadoop is 
provided or not")
+  val propFileName = "config.properties"
+
   lazy val settings = Seq(
     excludeDependencies --= Seq(
       ExclusionRule(organization = "com.sun.jersey"),
       ExclusionRule("javax.servlet", "javax.servlet-api"),
-      ExclusionRule("javax.ws.rs", "jsr311-api"))
+      ExclusionRule("javax.ws.rs", "jsr311-api")),
+      Compile / unmanagedResources :=
+        (Compile / 
unmanagedResources).value.filter(!_.getName.endsWith(s"$propFileName")),
+      genConfigProperties := {
+        val file = (Compile / classDirectory).value / 
s"org/apache/spark/deploy/yarn/$propFileName"
+        val isHadoopProvided = 
sys.props.getOrElse("spark.yarn.isHadoopProvided", "false")
+        IO.write(file, s"spark.yarn.isHadoopProvided = $isHadoopProvided")
+      },
+      (Compile / copyResources) := (Def.taskDyn {
+        val c = (Compile / copyResources).value
+          Def.task {

Review comment:
       looks like we should indent 2 spaces back here too




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to