Set priorityClassName for Spark tasks#7476
Merged
davidmirror-ops merged 1 commit intoJun 5, 2026
Merged
Conversation
Signed-off-by: madiyar-wayve <madiyar.aitzhanov@wayve.ai>
929a701 to
3bc838d
Compare
priorityClassNamepriorityClassName for Spark tasks
Author
|
I don't know what happened, but I didn't want to close this PR |
Tom-Newton
approved these changes
Jun 5, 2026
Tom-Newton
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Maybe in future we should switch to using the driver and exectutor pod templates https://github.com/kubeflow/spark-operator/blob/master/docs/api-docs.md#sparkpodspec. I think that would enable a simpler implementation where we don't need to manually add support for new properties.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tracking issue
Related to #6348.
Why are the changes needed?
These changes will allow setting
priorityClassNamefor Spark tasks.What changes were proposed in this pull request?
The Spark K8s plugin now propagates the
priorityClassNamefrom the resolved pod spec onto both the driver and executor specs of the generatedSparkApplication:createDriverSpec, setspec.sparkSpec.PriorityClassNamefrompodSpec.PriorityClassName.createExecutorSpec, setspec.sparkSpec.PriorityClassNamefrompodSpec.PriorityClassName.The value is set via the existing
strPtrhelper, which returnsnilfor an empty string. This means that when no priority class is configured, the field is left unset rather than being populated with an empty string, preserving the previous behavior in that case.The
podSpec.PriorityClassNamevalue honors anything coming from the task's pod template / overlay pod spec, since it is read afterMergeOverlayPodSpecOntoBaseis applied.How was this patch tested?
Added unit tests in
spark_test.go:TestBuildResourcePriorityClassName: setspriorityClassNameon the pod spec and asserts that both the driver and executor specs of the resultingSparkApplicationhave the expectedPriorityClassName.TestBuildResourceNoPriorityClassName: verifies that when no priority class is set, both the driver and executorPriorityClassNamefields are leftnil(unset) rather than an empty string.All new and existing Spark plugin unit tests pass.
Labels
Setup process
N/A
Screenshots
N/A
Check all the applicable boxes
Related PRs
N/A
Stack
Docs link
N/A