apiVersion: "sparkoperator.hpe.com/v1beta2"
kind: SparkApplication
metadata:
  name: spark-pi-oss-{{ts_nodash|replace("T", "")}}
spec:
  type: Python
  sparkVersion: '{{dag_run.conf["spark_image_version"]}}'
  mode: cluster
  image: '{{dag_run.conf["spark_image_url"]}}'
  imagePullPolicy: Always
  imagePullSecrets:
  - imagepull
  mainClass: org.apache.spark.examples.SparkPi
  mainApplicationFile: "local:///mounts/shared-volume/shared/aie-tutorials/current-release/Data-Analytics/Spark/pi/pi.py"
  restartPolicy:
    type: Never
  driver:
    cores: 1
    coreLimit: "1000m"
    memory: "512m"
    labels:
      version: '{{dag_run.conf["spark_image_version"]}}'
    volumeMounts:
      - name: shared-volume
        mountPath: /mounts/shared-volume/shared
  executor:
    cores: 1
    instances: 2
    coreLimit: "1000m"
    memory: "512m"
    labels:
      version: '{{dag_run.conf["spark_image_version"]}}'
    volumeMounts:
      - name: shared-volume
        mountPath: /mounts/shared-volume/shared
    volumes:
      - name: shared-volume
        persistentVolumeClaim:
          claimName: kubeflow-shared-pvc
