Skip to content

Commit 2909628

Browse files
committed
[SPARK-52304] Add pi-with-driver-timeout example
### What changes were proposed in this pull request? This PR aims to add `pi-with-driver-timeout` example. ### Why are the changes needed? `spark.driver.timeout` with `DriverTimeoutPlugin` is a new feature of Apache Spark 4.0.0 in order to guarantee the maximum run time of the jobs in the best effort approach. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manual test the example (timeout: 1minutes) ``` $ kubectl apply -f examples/pi-with-driver-timeout.yaml $ kubectl get sparkapp NAME CURRENT STATE AGE pi-with-driver-timeout TerminatedWithoutReleaseResources 2m59s ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#228 from dongjoon-hyun/SPARK-52304. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 38c2deb commit 2909628

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
apiVersion: spark.apache.org/v1beta1
16+
kind: SparkApplication
17+
metadata:
18+
name: pi-with-driver-timeout
19+
spec:
20+
mainClass: "org.apache.spark.examples.SparkPi"
21+
driverArgs: ["200000"]
22+
jars: "local:///opt/spark/examples/jars/spark-examples.jar"
23+
sparkConf:
24+
spark.driver.timeout: "1min" # Pod status will be 'Error'
25+
spark.plugins: "org.apache.spark.deploy.DriverTimeoutPlugin"
26+
spark.dynamicAllocation.enabled: "true"
27+
spark.dynamicAllocation.shuffleTracking.enabled: "true"
28+
spark.dynamicAllocation.maxExecutors: "3"
29+
spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
30+
spark.kubernetes.container.image: "apache/spark:4.0.0"
31+
applicationTolerations:
32+
resourceRetainPolicy: OnFailure
33+
runtimeVersions:
34+
scalaVersion: "2.13"
35+
sparkVersion: "4.0.0"

0 commit comments

Comments
 (0)