This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 87920b5 [SPARK-49399] Add `pi-scala.yaml` and `pyspark-pi.yaml`
87920b5 is described below
commit 87920b57b4765f47028d6ec8c7b10d2eb89f1eef
Author: zhou-jiang <[email protected]>
AuthorDate: Wed Aug 28 08:09:06 2024 -0700
[SPARK-49399] Add `pi-scala.yaml` and `pyspark-pi.yaml`
### What changes were proposed in this pull request?
This adds example Spark applications spec for Spark scala image, and adds
an example for pyspark
### Why are the changes needed?
As of now, [Spark docker images](https://hub.docker.com/_/spark) are built
with types of all / python / scala / r. While existing examples cover usage of
Python image, this PR sets up examples for another image(scala). As R is being
deprecated, operator now serves example for Python / scala images to avoid
confusion.
Main example uses default image
[4.0.0-preview1-scala2.13-java17-python3-ubuntu, 4.0.0-preview1-python3,
4.0.0-preview1](https://github.com/apache/spark-docker/blob/b9f1f8e8ebed1959c2be3864a114b52f67519092/4.0.0-preview1/scala2.13-java17-python3-ubuntu/Dockerfile)
which includes Python:
examples/pi-scala.yaml uses scala image :
[4.0.0-preview1-scala2.13-java17-ubuntu,
4.0.0-preview1-scala](https://github.com/apache/spark-docker/blob/b9f1f8e8ebed1959c2be3864a114b52f67519092/4.0.0-preview1/scala2.13-java17-ubuntu/Dockerfile)
### Does this PR introduce _any_ user-facing change?
No - new release
### How was this patch tested?
CIs and integration tests
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #108 from jiangzho/docs.
Authored-by: zhou-jiang <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
examples/pi-scala.yaml | 33 +++++++++++++++++++++++++++++++++
examples/pyspark-pi.yaml | 31 +++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+)
diff --git a/examples/pi-scala.yaml b/examples/pi-scala.yaml
new file mode 100644
index 0000000..2c2f010
--- /dev/null
+++ b/examples/pi-scala.yaml
@@ -0,0 +1,33 @@
+# 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.
+apiVersion: spark.apache.org/v1alpha1
+kind: SparkApplication
+metadata:
+ name: pi-scala
+spec:
+ mainClass: "org.apache.spark.examples.SparkPi"
+ jars:
"local:///opt/spark/examples/jars/spark-examples_2.13-4.0.0-preview1.jar"
+ sparkConf:
+ spark.dynamicAllocation.enabled: "true"
+ spark.dynamicAllocation.shuffleTracking.enabled: "true"
+ spark.dynamicAllocation.maxExecutors: "3"
+ spark.log.structuredLogging.enabled: "false"
+ spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
+ spark.kubernetes.container.image: "spark:4.0.0-preview1-scala"
+ applicationTolerations:
+ resourceRetainPolicy: OnFailure
+ runtimeVersions:
+ scalaVersion: "2.13"
+ sparkVersion: "4.0.0-preview1"
diff --git a/examples/pyspark-pi.yaml b/examples/pyspark-pi.yaml
new file mode 100644
index 0000000..ad61f62
--- /dev/null
+++ b/examples/pyspark-pi.yaml
@@ -0,0 +1,31 @@
+# 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.
+apiVersion: spark.apache.org/v1alpha1
+kind: SparkApplication
+metadata:
+ name: pi-python
+spec:
+ pyFiles: "local:///opt/spark/examples/src/main/python/pi.py"
+ sparkConf:
+ spark.dynamicAllocation.enabled: "true"
+ spark.dynamicAllocation.shuffleTracking.enabled: "true"
+ spark.dynamicAllocation.maxExecutors: "3"
+ spark.log.structuredLogging.enabled: "false"
+ spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
+ spark.kubernetes.container.image: "spark:4.0.0-preview1"
+ applicationTolerations:
+ resourceRetainPolicy: OnFailure
+ runtimeVersions:
+ sparkVersion: "4.0.0-preview1"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]