Repository: spark
Updated Branches:
  refs/heads/branch-1.0 a83a794f1 -> 6195fb8db


SPARK-1408 Modify Spark on Yarn to point to the history server when app ...

...finishes

Note this is dependent on https://github.com/apache/spark/pull/204 to have a 
working history server, but there are no code dependencies.

This also fixes SPARK-1288 yarn stable finishApplicationMaster incomplete. 
Since I was in there I made the diagnostic message be passed properly.

Author: Thomas Graves <[email protected]>

Closes #362 from tgravescs/SPARK-1408 and squashes the following commits:

ec89705 [Thomas Graves] Fix typo.
446122d [Thomas Graves] Make config yarn specific
f5d5373 [Thomas Graves] SPARK-1408 Modify Spark on Yarn to point to the history 
server when app finishes

(cherry picked from commit 0058b5d2c74147d24b127a5432f89ebc7050dc18)
Signed-off-by: Thomas Graves <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6195fb8d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6195fb8d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6195fb8d

Branch: refs/heads/branch-1.0
Commit: 6195fb8db9f194856df7f5c02f5023596d0c3253
Parents: a83a794
Author: Thomas Graves <[email protected]>
Authored: Thu Apr 17 16:36:37 2014 -0500
Committer: Thomas Graves <[email protected]>
Committed: Thu Apr 17 16:36:50 2014 -0500

----------------------------------------------------------------------
 docs/running-on-yarn.md                                          | 1 +
 .../scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala   | 3 +--
 .../scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6195fb8d/docs/running-on-yarn.md
----------------------------------------------------------------------
diff --git a/docs/running-on-yarn.md b/docs/running-on-yarn.md
index 9825143..9765062 100644
--- a/docs/running-on-yarn.md
+++ b/docs/running-on-yarn.md
@@ -42,6 +42,7 @@ System Properties:
 * `spark.yarn.preserve.staging.files`, set to true to preserve the staged 
files(spark jar, app jar, distributed cache files) at the end of the job rather 
then delete them.
 * `spark.yarn.scheduler.heartbeat.interval-ms`, the interval in ms in which 
the Spark application master heartbeats into the YARN ResourceManager. Default 
is 5 seconds. 
 * `spark.yarn.max.executor.failures`, the maximum number of executor failures 
before failing the application. Default is the number of executors requested 
times 2 with minimum of 3.
+* `spark.yarn.historyServer.address`, the address of the Spark history server 
(i.e. host.com:18080). The address should not contain a scheme (http://). 
Defaults to not being set since the history server is an optional service. This 
address is given to the Yarn ResourceManager when the Spark application 
finishes to link the application from the ResourceManager UI to the Spark 
history server UI. 
 
 # Launching Spark on YARN
 

http://git-wip-us.apache.org/repos/asf/spark/blob/6195fb8d/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
----------------------------------------------------------------------
diff --git 
a/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
 
b/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
index 67ec95c..f078d06 100644
--- 
a/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
+++ 
b/yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
@@ -366,8 +366,7 @@ class ApplicationMaster(args: ApplicationMasterArguments, 
conf: Configuration,
         finishReq.setAppAttemptId(appAttemptId)
         finishReq.setFinishApplicationStatus(status)
         finishReq.setDiagnostics(diagnostics)
-        // Set tracking url to empty since we don't have a history server.
-        finishReq.setTrackingUrl("")
+        
finishReq.setTrackingUrl(sparkConf.get("spark.yarn.historyServer.address", ""))
         resourceManager.finishApplicationMaster(finishReq)
       }
     }

http://git-wip-us.apache.org/repos/asf/spark/blob/6195fb8d/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
----------------------------------------------------------------------
diff --git 
a/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
 
b/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
index 581cfe4..b225be6 100644
--- 
a/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
+++ 
b/yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
@@ -347,8 +347,8 @@ class ApplicationMaster(args: ApplicationMasterArguments, 
conf: Configuration,
 
       logInfo("finishApplicationMaster with " + status)
       if (registered) {
-        // Set tracking URL to empty since we don't have a history server.
-        amClient.unregisterApplicationMaster(status, "" /* appMessage */ , "" 
/* appTrackingUrl */)
+        val trackingUrl = sparkConf.get("spark.yarn.historyServer.address", "")
+        amClient.unregisterApplicationMaster(status, diagnostics, trackingUrl)
       }
     }
   }

Reply via email to