Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dynamic allocation: kubernetes cluster scheduler changes
  • Loading branch information
foxish committed May 14, 2017
commit a0f0fa841fecf3fa3c94d6d93a66e9b04d82c08c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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.deploy.kubernetes

import org.apache.spark.SparkException

object Util {
def parseKeyValuePairs(
maybeKeyValues: Option[String],
configKey: String,
keyValueType: String): Map[String, String] = {

maybeKeyValues.map(keyValues => {
keyValues.split(",").map(_.trim).filterNot(_.isEmpty).map(keyValue => {
keyValue.split("=", 2).toSeq match {
case Seq(k, v) =>
(k, v)
case _ =>
throw new SparkException(s"Custom $keyValueType set by $configKey must be a" +
s" comma-separated list of key-value pairs, with format <key>=<value>." +
s" Got value: $keyValue. All values: $keyValues")
}
}).toMap
}).getOrElse(Map.empty[String, String])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ package object config extends Logging {
.stringConf
.createOptional

private[spark] val SPARK_SHUFFLE_SERVICE_HOST =
ConfigBuilder("spark.shuffle.service.host")
.doc("Host for Spark Shuffle Service")
.internal()
.stringConf
.createOptional

// Note that while we set a default for this when we start up the
// scheduler, the specific default value is dynamically determined
// based on the executor memory.
Expand Down Expand Up @@ -271,6 +278,38 @@ package object config extends Logging {
.stringConf
.createOptional

private[spark] val KUBERNETES_SHUFFLE_NAMESPACE =
ConfigBuilder("spark.kubernetes.shuffle.namespace")
.doc("Namespace of the shuffle service")
.stringConf
.createWithDefault("default")

private[spark] val KUBERNETES_SHUFFLE_SVC_IP =
ConfigBuilder("spark.kubernetes.shuffle.ip")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug only?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like setting it lets you override the IP that the executor thinks its colocated shuffle service is on -- should put that in the doc

.doc("This setting is for debugging only. Setting this " +
"allows overriding the IP that the executor thinks its colocated " +
"shuffle service is on")
.stringConf
.createOptional

private[spark] val KUBERNETES_SHUFFLE_LABELS =
ConfigBuilder("spark.kubernetes.shuffle.labels")
.doc("Labels to identify the shuffle service")
.stringConf
.createOptional

private[spark] val KUBERNETES_SHUFFLE_DIR =
ConfigBuilder("spark.kubernetes.shuffle.dir")
.doc("Path to the shared shuffle directories.")
.stringConf
.createOptional

private[spark] val KUBERNETES_DYNAMIC_ALLOCATION_SIZE =
ConfigBuilder("spark.kubernetes.dynamic.allocation.size")
.doc("Number of pods to launch at once in each round of dynamic allocation.")
.intConf
.createWithDefault(5)

private[spark] val DRIVER_SERVICE_MANAGER_TYPE =
ConfigBuilder("spark.kubernetes.driver.serviceManagerType")
.doc("A tag indicating which class to use for creating the Kubernetes service and" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,5 @@ package object constants {
s"$INIT_CONTAINER_PROPERTIES_FILE_MOUNT_PATH/$INIT_CONTAINER_PROPERTIES_FILE_NAME"
private[spark] val DOWNLOAD_JARS_VOLUME_NAME = "download-jars"
private[spark] val DOWNLOAD_FILES_VOLUME_NAME = "download-files"
private[spark] val DEFAULT_SHUFFLE_MOUNT_NAME = "shuffle"
}
Loading