-
Notifications
You must be signed in to change notification settings - Fork 701
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
[FEAT] add driverPod/executorPod in Spark #6085
[FEAT] add driverPod/executorPod in Spark #6085
Conversation
Add driverPod/executorPod field in SparkJob class and use them as Spark driver and executor Signed-off-by: machichima <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6085 +/- ##
==========================================
+ Coverage 36.86% 36.87% +0.01%
==========================================
Files 1318 1318
Lines 134530 134703 +173
==========================================
+ Hits 49591 49674 +83
- Misses 80619 80702 +83
- Partials 4320 4327 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fix protobuf number mismatch pass K8sPod instead of annotation and label separately Signed-off-by: machichima <[email protected]>
successfully apply pods specify in SparkJob Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
ae39e8f
to
394c269
Compare
Signed-off-by: machichima <[email protected]>
394c269
to
da4199b
Compare
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
c3eed97
to
70cfdff
Compare
// of c.Name | ||
if val, ok := taskTemplate.GetConfig()[PrimaryContainerKey]; ok { | ||
primaryContainerName = val | ||
c.Name = primaryContainerName |
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.
could we add a small unit test for it
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.
I am wondering whether this part is needed. As I know, to set the primary container name, we need to define in pod_template=PodTemplate(primary_container_name="primary")
. But if we set this, we will get into case *core.TaskTemplate_K8SPod
here. Therefore, this if val, ok := taskTemplate.GetConfig()[PrimaryContainerKey]
will never be True.
I am thinking of removing this and use TaskTemplate_K8SPod
in spark_test.go
instead.
Signed-off-by: machichima <[email protected]>
Code Review Agent Run #ebad2bActionable Suggestions - 8
Additional Suggestions - 1
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
Signed-off-by: machichima <[email protected]>
As for spark driver/executor podTemplate, flytekit will only pass the container match the primary_container_name Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Code Review Agent Run Status
|
Signed-off-by: machichima <[email protected]>
Code Review Agent Run Status
|
Signed-off-by: machichima <[email protected]>
Code Review Agent Run Status
|
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
c90d9dd
to
a783bdd
Compare
Code Review Agent Run Status
|
Signed-off-by: machichima <[email protected]>
Code Review Agent Run Status
|
LGTM, thank you! |
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.
LGTM. Thank you.
Tracking issue
#4105
Why are the changes needed?
Enable setting K8sPod separately for Spark Driver and Executor pods.
What changes were proposed in this pull request?
Add driverPod and executorPod field with type K8sPod in SparkJob. Uses existing
mergePodSpecs
to merge default podSpec with our driverPod or executorPod.How was this patch tested?
Unit tests
I extended the existing Spark unit test
TestBuildResourceContainer
andTestBuildResourcePodTemplate
and create a new test namedTestBuildResourceCustomK8SPod
for testing.Test with my_spark example
See flyteorg/flytekit#3016
Setup process
Screenshots
Check all the applicable boxes
Related PRs
flyteorg/flytekit#3016
Docs link
Summary by Bito
This PR enhances Spark task configuration by introducing separate driver and executor pod specifications through new SparkJob message fields. The implementation adds support for customizing Kubernetes pod configurations independently for Spark driver and executor components, including tolerations, environment variables, and other pod settings. The changes encompass protobuf definitions with generated code for multiple languages and improvements to pod helper functions.Unit tests added: True
Estimated effort to review (1-5, lower is better): 4