Skip to content

Commit 5f9b23f

Browse files
committed
[SPARK-52512] Add pi-with-eventlog example
### What changes were proposed in this pull request? This PR aims to add an event-log enabled `SparkPi` example. ### Why are the changes needed? To provide a rich example about how to use the event logs and SHS. ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Manually. ``` $ kubectl get sparkapp NAME CURRENT STATE AGE pi-with-eventlog ResourceReleased 3m23s spark-history-server RunningHealthy 6m31s ``` ![Screenshot 2025-06-17 at 09 17 36](https://github.com/user-attachments/assets/70387571-1d7e-41ce-8643-0b9fb56ba52c) ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#250 from dongjoon-hyun/SPARK-52512. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 24f66ec commit 5f9b23f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

examples/pi-with-eventlog.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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-eventlog
19+
spec:
20+
mainClass: "org.apache.spark.examples.SparkPi"
21+
jars: "local:///opt/spark/examples/jars/spark-examples.jar"
22+
sparkConf:
23+
spark.jars.packages: "org.apache.hadoop:hadoop-aws:3.4.1"
24+
spark.jars.ivy: "/tmp/.ivy2.5.2"
25+
spark.dynamicAllocation.enabled: "true"
26+
spark.dynamicAllocation.shuffleTracking.enabled: "true"
27+
spark.dynamicAllocation.maxExecutors: "3"
28+
spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
29+
spark.kubernetes.container.image: "apache/spark:4.0.0-java21-scala"
30+
spark.eventLog.enabled: "true"
31+
spark.eventLog.dir: "s3a://spark-events/"
32+
spark.hadoop.fs.s3a.endpoint: "http://localstack:4566"
33+
spark.hadoop.fs.s3a.path.style.access: "true"
34+
spark.hadoop.fs.s3a.access.key: "test"
35+
spark.hadoop.fs.s3a.secret.key: "test"
36+
applicationTolerations:
37+
resourceRetainPolicy: OnFailure
38+
runtimeVersions:
39+
sparkVersion: "4.0.0"

0 commit comments

Comments
 (0)