-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-37372][K8S] Removing redundant label addition #34646
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
Conversation
|
Test build #145390 has finished for PR 34646 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
dongjoon-hyun
left a comment
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.
nit. editition -> addition in the PR title and description, @Yikun ?
...s/core/src/test/scala/org/apache/spark/deploy/k8s/features/BasicDriverFeatureStepSuite.scala
Outdated
Show resolved
Hide resolved
dongjoon-hyun
left a comment
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.
This PR aims to more than a simple removing. We had better make the PR clear about what it's doing in the code.
|
@dongjoon-hyun Thanks for you patient review, and I rename the title to |
|
@dongjoon-hyun Would you mind taking a look again? Or I misundertanded your suggestion, it's not enough to update the PR message, I should split this PR to 2 PRs:
Or maybe there were some misleading, I clarify in #34646 (comment) , anyway, much thanks for your review. |
|
@dongjoon-hyun Friendly ping...Thanks Unrelated failed. |
ad5341d to
526b359
Compare
|
I separate the test refactoring in #35209 to make PR clear. |
| .addToLabels( | ||
| SPARK_APP_NAME_LABEL, | ||
| KubernetesConf.getAppNameLabel(kubernetesConf.appName) | ||
| ) |
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.
FYI, these labels are ready included in KubernetesExecutorConf.labels:
Lines 158 to 165 in 068d53b
| override def labels: Map[String, String] = { | |
| val presetLabels = Map( | |
| SPARK_VERSION_LABEL -> SPARK_VERSION, | |
| SPARK_EXECUTOR_ID_LABEL -> executorId, | |
| SPARK_APP_ID_LABEL -> appId, | |
| SPARK_APP_NAME_LABEL -> KubernetesConf.getAppNameLabel(appName), | |
| SPARK_ROLE_LABEL -> SPARK_POD_EXECUTOR_ROLE, | |
| SPARK_RESOURCE_PROFILE_ID_LABEL -> resourceProfileId.toString) |
This also addresses the comment in https://github.com/apache/spark/pull/33508/files#r682842336
| .editOrNewMetadata() | ||
| .withName(driverPodName) | ||
| .addToLabels(conf.labels.asJava) | ||
| .addToLabels(SPARK_APP_NAME_LABEL, KubernetesConf.getAppNameLabel(conf.appName)) |
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.
FYI, this label are ready included by KubernetesDriverConf.labels:
Lines 96 to 103 in 068d53b
| override def labels: Map[String, String] = { | |
| val presetLabels = Map( | |
| SPARK_VERSION_LABEL -> SPARK_VERSION, | |
| SPARK_APP_ID_LABEL -> appId, | |
| SPARK_APP_NAME_LABEL -> KubernetesConf.getAppNameLabel(appName), | |
| SPARK_ROLE_LABEL -> SPARK_POD_DRIVER_ROLE) | |
| val driverCustomLabels = KubernetesUtils.parsePrefixedKeyValuePairs( | |
| sparkConf, KUBERNETES_DRIVER_LABEL_PREFIX) |
dongjoon-hyun
left a comment
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.
+1, LGTM. Thank you for simplification, @Yikun .
Merged to master for Apache Spark 3.3.
|
@dongjoon-hyun Thanks! |
### What changes were proposed in this pull request? Remove redundant Pod label addtions in driver and executor. ### Why are the changes needed? These labels are already included by conf.labels as preset labels, we don't need do a extra addition. ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? UT passed: Especially: https://github.com/apache/spark/blob/a3886ba976469bef0dfafc3da8686a53c5a59d95/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesConfSuite.scala#L157-L164 Closes apache#34646 from Yikun/SPARK-labels-improve. Authored-by: Yikun Jiang <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
…r/ExecutorFeatureStepSuite ### What changes were proposed in this pull request? - Rename DRIVER_LABELS to CUSTOM_DRIVER_LABELS, LABELS to CUSTOM_EXECUTORS_LABELS, make their names more clear. - Refactoring on preset labels and add preset labels test. ### Why are the changes needed? There are two type Pod label in current implementations: [preset label](https://github.com/apache/spark/blob/068d53bd5d89c96bf0cdb05d3ec7f2f023cf3875/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesConf.scala#L158-L165) set by spark and custom label set by user, but there are some mix up in testcase, so this PR just fix it. Also see realted: #34646 (comment) ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? UT Closes #35209 from Yikun/SPARK-37908. Authored-by: Yikun Jiang <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
What changes were proposed in this pull request?
Remove redundant Pod label addtions in driver and executor.
Why are the changes needed?
These labels are already included by conf.labels as preset labels, we don't need do a extra addition.
Does this PR introduce any user-facing change?
NO
How was this patch tested?
UT passed:
Especially:
spark/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesConfSuite.scala
Lines 157 to 164 in a3886ba