Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-35715

Option "--files" with local:// prefix is not honoured for Spark on kubernetes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.2, 3.1.2
    • Fix Version/s: None
    • Component/s: Kubernetes
    • Labels:
      None

      Description

      When we provide a local file as a dependency using "--files" option, the file is not getting copied to work directories of executors.

      Example 1:

       

      $SPARK_HOME/bin/spark-submit --master k8s://https://<ip-address-k8s> \ 
      --deploy-mode cluster \ 
      --name spark-pi \ 
      --class org.apache.spark.examples.SparkPi \ 
      --conf spark.executor.instances=1 \ 
      --conf spark.kubernetes.container.image=<spark-3.1.2-image> \ 
      --conf spark.kubernetes.driver.pod.name=sparkdriverpod \ 
      --files local:///etc/xattr.conf \ 
      local:///opt/spark/examples/jars/spark-examples_2.12-3.1.2.jar 1000000
      

       

      Content of Spark Executor work-dir:

       

      ~$ kubectl exec -n default spark-pi-22de6279f6bec01c-exec-1 ls /opt/spark/work-dir/
      spark-examples_2.12-3.1.2.jar
      

       

      We can notice here that the file /etc/xattr.conf is NOT copied to  /opt/spark/work-dir/ .

       


       

      Instead of using "–files", if we use "--jars" option the file is getting copied as expected.

      Example 2:
      $SPARK_HOME/bin/spark-submit --master k8s://https://<ip-address-k8s> \ 
      --deploy-mode cluster \ 
      --name spark-pi \ 
      --class org.apache.spark.examples.SparkPi \ 
      --conf spark.executor.instances=1 \ 
      --conf spark.kubernetes.container.image=<spark-3.1.2-image> \ 
      --conf spark.kubernetes.driver.pod.name=sparkdriverpod \ 
      --jars local:///etc/xattr.conf \ 
      local:///opt/spark/examples/jars/spark-examples_2.12-3.1.2.jar 1000000
      
      
      
      Content of Spark Executor work-dir:

       

      ~$ kubectl exec -n default spark-pi-22de6279f6bec01c-exec-1 ls /opt/spark/work-dir/
      spark-examples_2.12-3.1.2.jar
      
      xattr.conf
      
      

      We can notice here that the file /etc/xattr.conf IS COPIED to  /opt/spark/work-dir/ .

       

      I tested this with versions 3.1.2 and 3.0.2. It is behaving the same way in both cases.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Pardhu Pardhu Madipalli
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: