Skip to content

Commit

Permalink
[SPARK-27061][K8S] Use UI_PORT default value
Browse files Browse the repository at this point in the history
  • Loading branch information
chandulal.kavar committed Mar 8, 2019
1 parent 0d8e4fc commit ffc2e2f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package org.apache.spark.deploy.k8s

import org.apache.spark.internal.config.UI._

private[spark] object Constants {

// Labels
Expand Down Expand Up @@ -47,7 +45,6 @@ private[spark] object Constants {
// Default and fixed ports
val DEFAULT_DRIVER_PORT = 7078
val DEFAULT_BLOCKMANAGER_PORT = 7079
val DEFAULT_UI_PORT = UI_PORT.defaultValue.get
val DRIVER_PORT_NAME = "driver-rpc-port"
val BLOCK_MANAGER_PORT_NAME = "blockmanager"
val UI_PORT_NAME = "spark-ui"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private[spark] class DriverServiceFeatureStep(
private val driverBlockManagerPort = kubernetesConf.sparkConf.getInt(
config.DRIVER_BLOCK_MANAGER_PORT.key, DEFAULT_BLOCKMANAGER_PORT)
private val driverUIPort = kubernetesConf.sparkConf.getInt(
UI_PORT.key, DEFAULT_UI_PORT)
UI_PORT.key, UI_PORT.defaultValue.get)

override def configurePod(pod: SparkPod): SparkPod = pod

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.apache.spark.deploy.k8s.Config._
import org.apache.spark.deploy.k8s.Constants._
import org.apache.spark.deploy.k8s.submit.JavaMainAppResource
import org.apache.spark.internal.config._
import org.apache.spark.internal.config.UI._
import org.apache.spark.util.ManualClock

class DriverServiceFeatureStepSuite extends SparkFunSuite {
Expand All @@ -42,7 +43,7 @@ class DriverServiceFeatureStepSuite extends SparkFunSuite {
val sparkConf = new SparkConf(false)
.set(DRIVER_PORT, 9000)
.set(DRIVER_BLOCK_MANAGER_PORT, 8080)
.set(UI_PORT_NAME, "4040")
.set(UI_PORT, 4080)
val kconf = KubernetesTestConf.createDriverConf(
sparkConf = sparkConf,
labels = DRIVER_LABELS)
Expand All @@ -57,7 +58,7 @@ class DriverServiceFeatureStepSuite extends SparkFunSuite {
verifyService(
9000,
8080,
4040,
4080,
s"${kconf.resourceNamePrefix}${DriverServiceFeatureStep.DRIVER_SVC_POSTFIX}",
driverService)
}
Expand Down Expand Up @@ -87,7 +88,7 @@ class DriverServiceFeatureStepSuite extends SparkFunSuite {
verifyService(
DEFAULT_DRIVER_PORT,
DEFAULT_BLOCKMANAGER_PORT,
DEFAULT_UI_PORT,
UI_PORT.defaultValue.get,
s"${kconf.resourceNamePrefix}${DriverServiceFeatureStep.DRIVER_SVC_POSTFIX}",
resolvedService)
val additionalProps = configurationStep.getAdditionalPodSystemProperties()
Expand Down

0 comments on commit ffc2e2f

Please sign in to comment.