Skip to content

Commit 4ecd227

Browse files
authored
Merge pull request apache-spark-on-k8s#254 from palantir/resync-kube
[NOSQUASH] Resync kube
2 parents 0f31d8a + 08da6ae commit 4ecd227

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

docs/running-on-kubernetes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ are set up as described above:
8585
--conf spark.kubernetes.driver.docker.image=kubespark/spark-driver:v2.2.0-kubernetes-0.3.0 \
8686
--conf spark.kubernetes.executor.docker.image=kubespark/spark-executor:v2.2.0-kubernetes-0.3.0 \
8787
--conf spark.kubernetes.initcontainer.docker.image=kubespark/spark-init:v2.2.0-kubernetes-0.3.0 \
88-
local:///opt/spark/examples/jars/spark_examples_2.11-2.2.0.jar
88+
local:///opt/spark/examples/jars/spark-examples_2.11-2.2.0-k8s-0.3.0.jar
8989

9090
The Spark master, specified either via passing the `--master` command line argument to `spark-submit` or by setting
9191
`spark.master` in the application's configuration, must be a URL with the format `k8s://<api_server_url>`. Prefixing the
@@ -147,7 +147,7 @@ and then you can compute the value of Pi as follows:
147147
--conf spark.kubernetes.executor.docker.image=kubespark/spark-executor:v2.2.0-kubernetes-0.3.0 \
148148
--conf spark.kubernetes.initcontainer.docker.image=kubespark/spark-init:v2.2.0-kubernetes-0.3.0 \
149149
--conf spark.kubernetes.resourceStagingServer.uri=http://<address-of-any-cluster-node>:31000 \
150-
examples/jars/spark_examples_2.11-2.2.0.jar
150+
examples/jars/spark-examples_2.11-2.2.0-k8s-0.3.0.jar
151151

152152
The Docker image for the resource staging server may also be built from source, in a similar manner to the driver
153153
and executor images. The Dockerfile is provided in `dockerfiles/resource-staging-server/Dockerfile`.
@@ -189,7 +189,7 @@ If our local proxy were listening on port 8001, we would have our submission loo
189189
--conf spark.kubernetes.driver.docker.image=kubespark/spark-driver:v2.2.0-kubernetes-0.3.0 \
190190
--conf spark.kubernetes.executor.docker.image=kubespark/spark-executor:v2.2.0-kubernetes-0.3.0 \
191191
--conf spark.kubernetes.initcontainer.docker.image=kubespark/spark-init:v2.2.0-kubernetes-0.3.0 \
192-
local:///opt/spark/examples/jars/spark_examples_2.11-2.2.0.jar
192+
local:///opt/spark/examples/jars/spark-examples_2.11-2.2.0-k8s-0.3.0.jar
193193

194194
Communication between Spark and Kubernetes clusters is performed using the fabric8 kubernetes-client library.
195195
The above mechanism using `kubectl proxy` can be used when we have authentication providers that the fabric8
@@ -252,7 +252,7 @@ the command may then look like the following:
252252
--conf spark.shuffle.service.enabled=true \
253253
--conf spark.kubernetes.shuffle.namespace=default \
254254
--conf spark.kubernetes.shuffle.labels="app=spark-shuffle-service,spark-version=2.2.0" \
255-
local:///opt/spark/examples/jars/spark_examples_2.11-2.2.0.jar 10 400000 2
255+
local:///opt/spark/examples/jars/spark-examples_2.11-2.2.0-k8s-0.3.0.jar 10 400000 2
256256

257257
## Advanced
258258

@@ -334,7 +334,7 @@ communicate with the resource staging server over TLS. The trustStore can be set
334334
--conf spark.kubernetes.resourceStagingServer.uri=https://<address-of-any-cluster-node>:31000 \
335335
--conf spark.ssl.kubernetes.resourceStagingServer.enabled=true \
336336
--conf spark.ssl.kubernetes.resourceStagingServer.clientCertPem=/home/myuser/cert.pem \
337-
examples/jars/spark_examples_2.11-2.2.0.jar
337+
examples/jars/spark-examples_2.11-2.2.0-k8s-0.3.0.jar
338338

339339
### Spark Properties
340340

resource-managers/kubernetes/architecture-docs/scheduler-backend.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ When a job is running, the scheduler backend configures and creates executor pod
1717

1818
- The pod's container runs a pre-built Docker image containing a Spark distribution (with Kubernetes integration) and
1919
invokes the Java runtime with the CoarseGrainedExecutorBackend main class.
20-
- The scheduler backend specifies environment variables on the executor pod to configure its runtime, p
21-
articularly for its JVM options, number of cores, heap size, and the driver's hostname.
20+
- The scheduler backend specifies environment variables on the executor pod to configure its runtime, particularly for its JVM options, number of cores, heap size, and the driver's hostname.
2221
- The executor container has [resource limits and requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container)
2322
that are set in accordance to the resource limits specified in the Spark configuration (executor.cores and executor.memory in the application's SparkConf)
2423
- The executor pods may also be launched into a particular [Kubernetes namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/%5C),

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/submit/submitsteps/BaseDriverConfigurationStep.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ private[spark] class BaseDriverConfigurationStep(
4848
// Memory settings
4949
private val driverMemoryMiB = submissionSparkConf.get(
5050
org.apache.spark.internal.config.DRIVER_MEMORY)
51+
private val driverMemoryString = submissionSparkConf.get(
52+
org.apache.spark.internal.config.DRIVER_MEMORY.key,
53+
org.apache.spark.internal.config.DRIVER_MEMORY.defaultValueString)
5154
private val memoryOverheadMiB = submissionSparkConf
5255
.get(KUBERNETES_DRIVER_MEMORY_OVERHEAD)
5356
.getOrElse(math.max((MEMORY_OVERHEAD_FACTOR * driverMemoryMiB).toInt,
@@ -102,7 +105,7 @@ private[spark] class BaseDriverConfigurationStep(
102105
.addToEnv(driverExtraClasspathEnv.toSeq: _*)
103106
.addNewEnv()
104107
.withName(ENV_DRIVER_MEMORY)
105-
.withValue(driverContainerMemoryWithOverheadMiB + "M") // JVM treats the "M" unit as "Mi"
108+
.withValue(driverMemoryString)
106109
.endEnv()
107110
.addNewEnv()
108111
.withName(ENV_DRIVER_MAIN_CLASS)

resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/kubernetes/submit/submitsteps/BaseDriverConfigurationStepSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ private[spark] class BaseDriverConfigurationStepSuite extends SparkFunSuite {
4242
test("Set all possible configurations from the user.") {
4343
val sparkConf = new SparkConf()
4444
.set(KUBERNETES_DRIVER_POD_NAME, "spark-driver-pod")
45-
.set(org.apache.spark.internal.config.DRIVER_CLASS_PATH, "/opt/spark/spark-exmaples.jar")
45+
.set(org.apache.spark.internal.config.DRIVER_CLASS_PATH, "/opt/spark/spark-examples.jar")
4646
.set("spark.driver.cores", "2")
4747
.set(KUBERNETES_DRIVER_LIMIT_CORES, "4")
48-
.set(org.apache.spark.internal.config.DRIVER_MEMORY, 256L)
48+
.set(org.apache.spark.internal.config.DRIVER_MEMORY.key, "256M")
4949
.set(KUBERNETES_DRIVER_MEMORY_OVERHEAD, 200L)
5050
.set(DRIVER_DOCKER_IMAGE, "spark-driver:latest")
5151
.set(s"spark.kubernetes.driver.annotation.$CUSTOM_ANNOTATION_KEY", CUSTOM_ANNOTATION_VALUE)
@@ -80,8 +80,8 @@ private[spark] class BaseDriverConfigurationStepSuite extends SparkFunSuite {
8080
.map(env => (env.getName, env.getValue))
8181
.toMap
8282
assert(envs.size === 6)
83-
assert(envs(ENV_SUBMIT_EXTRA_CLASSPATH) === "/opt/spark/spark-exmaples.jar")
84-
assert(envs(ENV_DRIVER_MEMORY) === "456M")
83+
assert(envs(ENV_SUBMIT_EXTRA_CLASSPATH) === "/opt/spark/spark-examples.jar")
84+
assert(envs(ENV_DRIVER_MEMORY) === "256M")
8585
assert(envs(ENV_DRIVER_MAIN_CLASS) === MAIN_CLASS)
8686
assert(envs(ENV_DRIVER_ARGS) === "arg1 arg2")
8787
assert(envs(DRIVER_CUSTOM_ENV_KEY1) === "customDriverEnv1")

0 commit comments

Comments
 (0)