-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23984][K8S] Initial Python Bindings for PySpark on K8s #21092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fb5b9ed
initial architecture for PySpark w/o dockerfile work
ifilonenko b7b3db0
included entrypoint logic
ifilonenko 98cef8c
satisfying integration tests
ifilonenko dc670dc
end-to-end working pyspark
ifilonenko eabe4b9
Merge pull request #1 from ifilonenko/py-spark
ifilonenko 8d3debb
resolved comments and fixed --pyfiles issue and allowed for python2 o…
ifilonenko 91e2a2c
Merge pull request #2 from ifilonenko/py-spark
ifilonenko 5761ee8
Merge branch 'master' of https://github.com/ifilonenko/spark
ifilonenko 98cc044
restructured step based pattern to resolve comments
ifilonenko 678d381
Merge pull request #3 from ifilonenko/py-spark
ifilonenko bf738dc
resolved comments
ifilonenko c59068d
Merge pull request #4 from ifilonenko/py-spark
ifilonenko 0344f90
resolving style issues
ifilonenko 306f3ed
Merge pull request #5 from ifilonenko/py-spark
ifilonenko f2fc53e
resolved commits
ifilonenko 6f66d60
merge conflicts
ifilonenko 914ff75
resolve rebase conflicts
ifilonenko d400607
import statements refactoring
ifilonenko 72953a3
Merge branch 'py-spark'
ifilonenko 7bedeb6
resolved comments
ifilonenko 1801e96
merge conflicts
ifilonenko 24a704e
setIfMissing
ifilonenko 6a6d69d
added e2e tests on --py-files and inclusion of docs on config values
ifilonenko ab92913
style issues
ifilonenko a61d897
resolve comments on docs and addition of unit test
ifilonenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,6 @@ package org.apache.spark.deploy.k8s.features.bindings | |
| import scala.collection.JavaConverters._ | ||
|
|
||
| import io.fabric8.kubernetes.api.model.ContainerBuilder | ||
| import io.fabric8.kubernetes.api.model.EnvVar | ||
| import io.fabric8.kubernetes.api.model.EnvVarBuilder | ||
| import io.fabric8.kubernetes.api.model.HasMetadata | ||
|
|
||
|
|
@@ -35,20 +34,20 @@ private[spark] class PythonDriverFeatureStep( | |
| override def configurePod(pod: SparkPod): SparkPod = { | ||
| val roleConf = kubernetesConf.roleSpecificConf | ||
| require(roleConf.mainAppResource.isDefined, "PySpark Main Resource must be defined") | ||
| val maybePythonArgs: Option[EnvVar] = Option(roleConf.appArgs).filter(_.nonEmpty).map( | ||
| val maybePythonArgs = Option(roleConf.appArgs).filter(_.nonEmpty).map( | ||
| s => | ||
| new EnvVarBuilder() | ||
| .withName(ENV_PYSPARK_ARGS) | ||
| .withValue(s.mkString(",")) | ||
| .build()) | ||
| val maybePythonFiles: Option[EnvVar] = kubernetesConf.pyFiles().map( | ||
| val maybePythonFiles = kubernetesConf.pyFiles().map( | ||
| pyFiles => | ||
| new EnvVarBuilder() | ||
| .withName(ENV_PYSPARK_FILES) | ||
| .withValue(KubernetesUtils.resolveFileUrisAndPath(pyFiles.split(",")) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a comment on why we need switch from ","s to ":"s. |
||
| .mkString(":")) | ||
| .build()) | ||
| val envSeq : Seq[EnvVar] = | ||
| val envSeq = | ||
| Seq(new EnvVarBuilder() | ||
| .withName(ENV_PYSPARK_PRIMARY) | ||
| .withValue(KubernetesUtils.resolveFileUri(kubernetesConf.pySparkMainResource().get)) | ||
|
|
@@ -62,7 +61,11 @@ private[spark] class PythonDriverFeatureStep( | |
| maybePythonFiles.toSeq | ||
|
|
||
| val withPythonPrimaryContainer = new ContainerBuilder(pod.container) | ||
| .addAllToEnv(pythonEnvs.asJava).build() | ||
| .addAllToEnv(pythonEnvs.asJava) | ||
| .addToArgs("driver-py") | ||
| .addToArgs("--properties-file", SPARK_CONF_PATH) | ||
| .addToArgs("--class", roleConf.mainClass) | ||
| .build() | ||
|
|
||
| SparkPod(pod.pod, withPythonPrimaryContainer) | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use something more descriptive than
s.