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 6eeae6d  [SPARK-54658] Add `Apache DataFusion Comet` example
6eeae6d is described below

commit 6eeae6d09f2348fa93b5fe35cc49349ec7d111f4
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Tue Dec 9 17:28:02 2025 -0800

    [SPARK-54658] Add `Apache DataFusion Comet` example
    
    ### What changes were proposed in this pull request?
    
    This PR aims to add `Apache DataFusion Comet` example.
    
    ### Why are the changes needed?
    
    To illustrate how to accelerate Apache Spark via Comet project.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No behavior change.
    
    ### How was this patch tested?
    
    Manually.
    
    ```
    $ kubectl apply -f examples/pi-with-comet.yaml
    
    $ kubectl logs -f pi-with-comet-0-driver | grep Comet
    Defaulted container "spark-kubernetes-driver" out of: 
spark-kubernetes-driver, download-comet (init)
    25/12/10 00:51:32 INFO CometDriverPlugin: CometDriverPlugin init
    25/12/10 00:51:32 INFO CometDriverPlugin: Setting 
spark.sql.extensions=org.apache.comet.CometSparkSessionExtensions
    25/12/10 00:51:32 INFO CometDriverPlugin: Comet is running in unified 
memory mode and sharing off-heap memory with Spark
    25/12/10 00:51:32 INFO DriverPluginContainer: Initialized driver component 
for plugin org.apache.spark.CometPlugin.
    25/12/10 00:51:40 INFO CometDriverPlugin: CometDriverPlugin shutdown
    
    $ kubectl get sparkapp
    NAME            CURRENT STATE      AGE
    pi-with-comet   ResourceReleased   39s
    ```
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #421 from dongjoon-hyun/SPARK-54658.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 examples/pi-with-comet.yaml | 86 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/examples/pi-with-comet.yaml b/examples/pi-with-comet.yaml
new file mode 100644
index 0000000..ac7c3cb
--- /dev/null
+++ b/examples/pi-with-comet.yaml
@@ -0,0 +1,86 @@
+# 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/v1
+kind: SparkApplication
+metadata:
+  name: pi-with-comet
+spec:
+  mainClass: "org.apache.spark.examples.SparkPi"
+  jars: "local:///opt/spark/examples/jars/spark-examples.jar"
+  sparkConf:
+    spark.comet.enabled: "true"
+    spark.comet.exec.enabled: "true"
+    spark.comet.exec.shuffle.enabled: "true"
+    spark.comet.exec.shuffle.mode: "auto"
+    spark.driver.extraClassPath: "local:///comet/comet.jar"
+    spark.dynamicAllocation.enabled: "true"
+    spark.dynamicAllocation.maxExecutors: "3"
+    spark.dynamicAllocation.shuffleTracking.enabled: "true"
+    spark.executor.extraClassPath: "local:///comet/comet.jar"
+    spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
+    spark.kubernetes.container.image: "apache/spark:3.5.7-java17"
+    spark.kubernetes.driver.pod.excludedFeatureSteps: 
"org.apache.spark.deploy.k8s.features.KerberosConfDriverFeatureStep"
+    spark.memory.offHeap.enabled: "true"
+    spark.memory.offHeap.size: "1g"
+    spark.plugins: "org.apache.spark.CometPlugin"
+    spark.shuffle.manager": 
"org.apache.spark.sql.comet.execution.shuffle.CometShuffleManager"
+  applicationTolerations:
+    resourceRetainPolicy: OnFailure
+  driverSpec:
+    podTemplateSpec:
+      spec:
+        initContainers:
+        - name: download-comet
+          image: busybox
+          command: ["sh", "-c"]
+          args:
+          - |
+            wget -O /comet/comet.jar 
"https://repo1.maven.org/maven2/org/apache/datafusion/comet-spark-spark3.5_2.12/0.12.0/comet-spark-spark3.5_2.12-0.12.0.jar";
+          volumeMounts:
+          - name: comet
+            mountPath: /comet
+        containers:
+        - name: spark-kubernetes-driver
+          volumeMounts:
+          - name: comet
+            mountPath: /comet
+        volumes:
+        - name: comet
+          emptyDir:
+            sizeLimit: 100Mi
+  executorSpec:
+    podTemplateSpec:
+      spec:
+        initContainers:
+        - name: download-comet
+          image: busybox
+          command: ["sh", "-c"]
+          args:
+          - |
+            wget -O /comet/comet.jar 
"https://repo1.maven.org/maven2/org/apache/datafusion/comet-spark-spark3.5_2.12/0.12.0/comet-spark-spark3.5_2.12-0.12.0.jar";
+          volumeMounts:
+          - name: comet
+            mountPath: /comet
+        containers:
+        - name: spark-kubernetes-executor
+          volumeMounts:
+          - name: comet
+            mountPath: /comet
+        volumes:
+        - name: comet
+          emptyDir:
+            sizeLimit: 100Mi
+  runtimeVersions:
+    sparkVersion: "3.5.7"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to