spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-26311) [YARN] New feature: custom log URL for stdout/stderr
Date Tue, 11 Dec 2018 01:25:00 GMT

    [ https://issues.apache.org/jira/browse/SPARK-26311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16715911#comment-16715911
] 

ASF GitHub Bot commented on SPARK-26311:
----------------------------------------

HeartSaVioR commented on a change in pull request #23260: [SPARK-26311][YARN] New feature:
custom log URL for stdout/stderr
URL: https://github.com/apache/spark/pull/23260#discussion_r240444139
 
 

 ##########
 File path: resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnable.scala
 ##########
 @@ -246,13 +246,56 @@ private[yarn] class ExecutorRunnable(
       sys.env.get("SPARK_USER").foreach { user =>
         val containerId = ConverterUtils.toString(c.getId)
         val address = c.getNodeHttpAddress
-        val baseUrl = s"$httpScheme$address/node/containerlogs/$containerId/$user"
 
-        env("SPARK_LOG_URL_STDERR") = s"$baseUrl/stderr?start=-4096"
-        env("SPARK_LOG_URL_STDOUT") = s"$baseUrl/stdout?start=-4096"
+        sparkConf.get(config.CUSTOM_LOG_URL) match {
+          case Some(customUrl) =>
+            val pathVariables = ExecutorRunnable.buildPathVariables(httpScheme, address,
+              YarnConfiguration.getClusterId(conf), containerId, user)
+            val envNameToFileNameMap = Map("SPARK_LOG_URL_STDERR" -> "stderr",
+              "SPARK_LOG_URL_STDOUT" -> "stdout")
+            val logUrls = ExecutorRunnable.replaceLogUrls(customUrl, pathVariables,
+              envNameToFileNameMap)
+
+            logUrls.foreach { case (envName, url) =>
+              env(envName) = url
+            }
+          case None =>
+            val baseUrl = s"$httpScheme$address/node/containerlogs/$containerId/$user"
 
 Review comment:
   Yes it will remove the branch. Will address.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> [YARN] New feature: custom log URL for stdout/stderr
> ----------------------------------------------------
>
>                 Key: SPARK-26311
>                 URL: https://issues.apache.org/jira/browse/SPARK-26311
>             Project: Spark
>          Issue Type: Improvement
>          Components: YARN
>    Affects Versions: 2.4.0
>            Reporter: Jungtaek Lim
>            Priority: Major
>
> Spark has been setting static log URLs for YARN application, which points to NodeManager
webapp. Normally it would work for both running apps and finished apps, but there're also
other approaches on maintaining application logs, like having external log service which enables
to avoid application log url to be a deadlink when NodeManager is not accessible. (Node decommissioned,
elastic nodes, etc.)
> Spark can provide a new configuration for custom log url on YARN mode, which end users
can set it properly to point application log to external log service.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message