Description
Links on HistoryPage are not prepended with uiRoot (export APPLICATION_WEB_PROXY_BASE=<uiRoot path>). This makes it impossible/unpractical to expose the History Server in a multi-tenancy environment where each Spark service instance has one history server behind a multi-tenant enabled proxy server. All other Spark web UI pages are correctly prefixed when the APPLICATION_WEB_PROXY_BASE environment variable is set.
Repro steps:
- Configure history log collection:
conf/spark-defaults.conf
spark.eventLog.enabled true spark.eventLog.dir logs/history spark.history.fs.logDirectory logs/history
...create the logs folders:
$ mkdir -p logs/history
- Start the Spark shell and run the word count example:
$ bin/spark-shell ... scala> sc.textFile("README.md").flatMap(_.split(" ")).map(w => (w, 1)).reduceByKey(_ + _).collect scala> sc.stop
- Set the web proxy root path path (i.e. /testwebuiproxy/..):
$ export APPLICATION_WEB_PROXY_BASE=/testwebuiproxy/..
- Start the history server:
$ sbin/start-history-server.sh
- Bring up the History Server web UI at localhost:18080 and view the application link in the HTML source text:
... <thead><th width="" class="">App ID</th><th width="" class="">App Name</th>...</thead> <tbody> <tr> <td><a href="/history/local-1445896187531">local-1445896187531</a></td><td>Spark shell</td> ...
Notice, application link "/history/local-1445896187531" does not have the prefix /testwebuiproxy/..
All site-relative links (URL starting with "/") should have been prepended with the uiRoot prefix /testwebuiproxy/.. like this ...... <thead><th width="" class="">App ID</th><th width="" class="">App Name</th>...</thead> <tbody> <tr> <td><a href="/testwebuiproxy/../history/local-1445896187531">local-1445896187531</a></td><td>Spark shell</td> ...