Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Commit 5e58c80

Browse files
committed
Properly handle no extra python files.
Puts in a filler for the environment variable so that the arguments are passed through correctly.
1 parent 6674ab0 commit 5e58c80

File tree

1 file changed

+6
-2
lines changed
  • resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/submit/submitsteps

1 file changed

+6
-2
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/kubernetes/submit/submitsteps/PythonStep.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ private[spark] class PythonStep(
2727
filesDownloadPath: String) extends KubernetesSubmissionStep {
2828

2929
override def prepareSubmission(driverSpec: KubernetesDriverSpec): KubernetesDriverSpec = {
30+
val resolvedOtherPyFilesString = if (otherPyFiles.isEmpty) {
31+
"no-py-files"
32+
} else {
33+
otherPyFiles.mkString(",")
34+
}
3035
val withPythonPrimaryFileContainer = new ContainerBuilder(driverSpec.driverContainer)
3136
.addNewEnv()
3237
.withName(ENV_PYSPARK_PRIMARY)
3338
.withValue(KubernetesFileUtils.resolveFilePath(primaryPyFile, filesDownloadPath))
3439
.endEnv()
3540
.addNewEnv()
3641
.withName(ENV_PYSPARK_FILES)
37-
.withValue(
38-
KubernetesFileUtils.resolveFilePaths(otherPyFiles, filesDownloadPath).mkString(","))
42+
.withValue(resolvedOtherPyFilesString)
3943
.endEnv()
4044
driverSpec.copy(driverContainer = withPythonPrimaryFileContainer.build())
4145
}

0 commit comments

Comments
 (0)