Skip to content

Commit 24f66ec

Browse files
committed
[SPARK-52481] Add Spark History Server example
### What changes were proposed in this pull request? Add `Spark History Server` example. ### Why are the changes needed? Since Apache Spark 4.0, Spark rolls the event logs by default and compressed them by default. - apache/spark#43638 - apache/spark#43036 However, we still need more configurations to allow SHS manages the event log directories. This PR aims to provide an example of `Spark History Server` with the configuration. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manual review. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#249 from dongjoon-hyun/SPARK-52481. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent a1b3d7b commit 24f66ec

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

examples/localstack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
- /bin/sh
3939
- -c
4040
- >
41+
awslocal s3 mb s3://spark-events;
4142
awslocal s3 mb s3://data;
4243
awslocal s3 cp /opt/code/localstack/Makefile s3://data/
4344
---

examples/spark-history-server.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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: spark-history-server
19+
spec:
20+
mainClass: "org.apache.spark.deploy.history.HistoryServer"
21+
sparkConf:
22+
spark.jars.packages: "org.apache.hadoop:hadoop-aws:3.4.1"
23+
spark.jars.ivy: "/tmp/.ivy2.5.2"
24+
spark.driver.memory: "2g"
25+
spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
26+
spark.kubernetes.container.image: "apache/spark:4.0.0-java21-scala"
27+
spark.history.fs.logDirectory: "s3a://spark-events"
28+
spark.history.fs.cleaner.enabled: "true"
29+
spark.history.fs.cleaner.maxAge: "30d"
30+
spark.history.fs.cleaner.maxNum: "100"
31+
spark.history.fs.eventLog.rolling.maxFilesToRetain: "10"
32+
spark.hadoop.fs.defaultFS: "s3a://spark-events"
33+
spark.hadoop.fs.s3a.endpoint: "http://localstack:4566"
34+
spark.hadoop.fs.s3a.path.style.access: "true"
35+
spark.hadoop.fs.s3a.access.key: "test"
36+
spark.hadoop.fs.s3a.secret.key: "test"
37+
runtimeVersions:
38+
sparkVersion: "4.0.0"
39+
applicationTolerations:
40+
restartConfig:
41+
restartPolicy: Always
42+
maxRestartAttempts: 9223372036854775807

0 commit comments

Comments
 (0)