diff --git a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala index 38b57c1a01279..e8410093d92fa 100644 --- a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala +++ b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala @@ -325,7 +325,7 @@ object SparkSubmit extends CommandLineUtils { // Require all python files to be local, so we can add them to the PYTHONPATH // In YARN cluster mode, python files are distributed as regular files, which can be non-local. // In Mesos cluster mode, non-local python files are automatically downloaded by Mesos. - if (args.isPython && !isYarnCluster && !isMesosCluster) { + if (args.isPython && !isYarnCluster && !isMesosCluster && !isKubernetesCluster) { if (Utils.nonLocalPaths(args.primaryResource).nonEmpty) { printErrorAndExit(s"Only local python files are supported: ${args.primaryResource}") } @@ -336,7 +336,7 @@ object SparkSubmit extends CommandLineUtils { } // Require all R files to be local - if (args.isR && !isYarnCluster && !isMesosCluster) { + if (args.isR && !isYarnCluster && !isMesosCluster && !isKubernetesCluster) { if (Utils.nonLocalPaths(args.primaryResource).nonEmpty) { printErrorAndExit(s"Only local R files are supported: ${args.primaryResource}") } @@ -682,10 +682,10 @@ object SparkSubmit extends CommandLineUtils { // explicitly sets `spark.submit.pyFiles` in his/her default properties file. sysProps.get("spark.submit.pyFiles").foreach { pyFiles => val resolvedPyFiles = Utils.resolveURIs(pyFiles) - val formattedPyFiles = if (!isYarnCluster && !isMesosCluster) { + val formattedPyFiles = if (!isYarnCluster && !isMesosCluster && !isKubernetesCluster) { PythonRunner.formatPaths(resolvedPyFiles).mkString(",") } else { - // Ignoring formatting python path in yarn and mesos cluster mode, these two modes + // Ignoring formatting python path in yarn, mesos, and kubernetes cluster mode, these modes // support dealing with remote python files, they could distribute and add python files // locally. resolvedPyFiles