Skip to content

Commit

Permalink
SPARK-1417: Spark on Yarn - spark UI link from resourcemanager is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
tgravescs committed Apr 7, 2014
1 parent b5bae84 commit 2a6b1b7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private[spark] class SparkDeploySchedulerBackend(
"org.apache.spark.executor.CoarseGrainedExecutorBackend", args, sc.executorEnvs)
val sparkHome = sc.getSparkHome()
val appDesc = new ApplicationDescription(sc.appName, maxCores, sc.executorMemory, command,
sparkHome, sc.ui.appUIAddress, sc.eventLoggingInfo)
sparkHome, "http://" + sc.ui.appUIAddress, sc.eventLoggingInfo)

client = new AppClient(sc.env.actorSystem, masters, appDesc, this, conf)
client.start()
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/scala/org/apache/spark/ui/SparkUI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ private[spark] class SparkUI(
logInfo("Stopped Spark Web UI at %s".format(appUIAddress))
}

private[spark] def appUIAddress = "http://" + publicHost + ":" + boundPort
/**
* Return the application UI address. This does not include the scheme (http://).
*/
private[spark] def appUIAddress = publicHost + ":" + boundPort

}

Expand Down
30 changes: 30 additions & 0 deletions core/src/test/scala/org/apache/spark/SparkUISuite.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.spark

import java.net.URI

import org.scalatest.FunSuite

class SparkUISuite extends FunSuite with SharedSparkContext {

test("verify appUIAddress doesn't contain scheme") {
val appUIUri = new URI(sc.ui.appUIAddress)
assert(appUIUri.isAbsolute() == false)
}
}

0 comments on commit 2a6b1b7

Please sign in to comment.