Skip to content

Conversation

holdenk
Copy link
Contributor

@holdenk holdenk commented Oct 30, 2020

What changes were proposed in this pull request?

Add a developer API for custom driver & executor feature steps.

Why are the changes needed?

While we allow templates for the basis of pod creation, some deployments need more flexibility in how the pods are configured. This adds a developer API for custom deployments.

Does this PR introduce any user-facing change?

New developer API.

How was this patch tested?

Extended tests to verify custom step is applied when configured.

@SparkQA
Copy link

SparkQA commented Oct 30, 2020

Test build #130463 has finished for PR 30206 at commit 4838f42.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait KubernetesFeatureConfigStep

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-33261][KUBERNETES] Add a developer API for custom feature steps. [SPARK-33261][K8S] Add a developer API for custom feature steps Oct 30, 2020
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @holdenk . Can we make this accept multiple steps as a comma separated style?

cc @jiangzho and @aaruna

@SparkQA
Copy link

SparkQA commented Oct 30, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35069/

@SparkQA
Copy link

SparkQA commented Oct 30, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35069/

@holdenk
Copy link
Contributor Author

holdenk commented Oct 30, 2020

That's a great suggestion @dongjoon-hyun , I'll try and get that done today :)

@SparkQA
Copy link

SparkQA commented Oct 30, 2020

Test build #130477 has finished for PR 30206 at commit 09febce.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 30, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35081/

@SparkQA
Copy link

SparkQA commented Oct 30, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35081/

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the updates. It's great. I left a few minor comments about naming and a new test case.

@tgravescs
Copy link
Contributor

a few other things is that SparkPod is private[spark] as well.

This I think opens it up for user to do anything with the Pod, correct me if I'm wrong, which is good and possibly bad. Are there any security concerns here? Like seeing secrets they shouldn't be able to. I can't think of any in the Spark ones directly but wanted to ask more expert in the k8s area.

I'm curious, what sort of thing can't be done via templates?

@holdenk
Copy link
Contributor Author

holdenk commented Nov 3, 2020

So since we allow the user to specify templates anyways I don't see this as opening any additional security concerns. As for why templates are not enough, for some deployments I believe people want to be able to customize the pod at the end of the feature steps rather than at the start. I think also there are situations where we need to generate stuff based on pod name.

@holdenk
Copy link
Contributor Author

holdenk commented Dec 3, 2020

Let's open up SparkPod to an Experimental dev API. WDYT @tgravescs ?

@tgravescs
Copy link
Contributor

yeah that seems fine to me to make SparkPod developer api

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Dec 6, 2020

Since we have an agreement, could you resolve the conflict to proceed further, @holdenk ?

Also, please update the PR according to the existing comments.

@dongjoon-hyun dongjoon-hyun dismissed their stale review December 6, 2020 09:29

The comment is outdated.

@holdenk holdenk force-pushed the SPARK-33261-allow-people-to-extend-pod-feature-steps branch from 09febce to 2117566 Compare December 9, 2020 19:22
@dongjoon-hyun
Copy link
Member

Thank you so much for your update, @holdenk !

@tgravescs
Copy link
Contributor

is this targeted for 3.1?

@dongjoon-hyun
Copy link
Member

@tgravescs . I believe so because this is a part of K8s GA in Apache Spark 3.1.

@dongjoon-hyun
Copy link
Member

Please let us know if you have any concerns on this. We can postpone it to Apache Spark 3.2 if you want to do so.

@SparkQA
Copy link

SparkQA commented Dec 9, 2020

Test build #132510 has finished for PR 30206 at commit a66c00f.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@holdenk holdenk force-pushed the SPARK-33261-allow-people-to-extend-pod-feature-steps branch from 963b786 to e990f33 Compare December 11, 2020 22:49
@SparkQA
Copy link

SparkQA commented Dec 11, 2020

Test build #132679 has finished for PR 30206 at commit e990f33.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 11, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37282/

@SparkQA
Copy link

SparkQA commented Dec 12, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37282/

@SparkQA
Copy link

SparkQA commented Dec 12, 2020

Test build #132684 has finished for PR 30206 at commit cfe5bc1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class TestStepTwo extends KubernetesFeatureConfigStep

@SparkQA
Copy link

SparkQA commented Dec 12, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37287/

@SparkQA
Copy link

SparkQA commented Dec 12, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37287/

@holdenk
Copy link
Contributor Author

holdenk commented Dec 14, 2020

Merging to the current dev branch for 3.2.

@asfgit asfgit closed this in 5885cc1 Dec 14, 2020
flyrain pushed a commit to flyrain/spark that referenced this pull request Sep 21, 2021
### What changes were proposed in this pull request?

Add a developer API for custom driver & executor feature steps.

### Why are the changes needed?

While we allow templates for the basis of pod creation, some deployments need more flexibility in how the pods are configured. This adds a developer API for custom deployments.

### Does this PR introduce _any_ user-facing change?

New developer API.

### How was this patch tested?

Extended tests to verify custom step is applied when configured.

Closes apache#30206 from holdenk/SPARK-33261-allow-people-to-extend-pod-feature-steps.

Authored-by: Holden Karau <hkarau@apple.com>
Signed-off-by: Holden Karau <hkarau@apple.com>
dongjoon-hyun added a commit that referenced this pull request Feb 2, 2022
…Step developer api

### What changes were proposed in this pull request?

This patch adds the support for extending user feature steps with configuration by adding 2 developer api:
- `KubernetesDriverCustomFeatureConfigStep`: to help user extend custom feature step in executor side
- `KubernetesExecutorCustomFeatureConfigStep`: to help user extend custom feature step in driver side

Before this patch user can only add feature step like:
- `class TestStep extends KubernetesFeatureConfigStep`: without any kubernetes conf

After this patch user can add feature step with configuration like:
- `class TestStepWithDriverConf extends KubernetesDriverCustomFeatureConfigStep`: only driver
- `class TestStepWithExecConf extends KubernetesExecutorCustomFeatureConfigStep`: only executor
- `class TestStepWithK8SConf extends KubernetesDriverCustomFeatureConfigStep with KubernetesExecutorCustomFeatureConfigStep`: both driver and executor

### Why are the changes needed?
In #30206 , a developer API for custom feature steps has been added, but it didn't support initialize user feature step with kubernetes conf (like `KubernetesConf`/`KubernetesDriverConf`/`KubernetesExecutorConf`).

In most of scenarios, users want to make corresponding changes in their feature steps according to the configuration. Such as, the customized scheduler scenario, user wants to configure pod according to passed job configuration.

### Does this PR introduce _any_ user-facing change?
Improve the developer API for for custom feature steps.

### How was this patch tested?
- Added UT
- Runing k8s integration test manaully: `build/sbt -Pkubernetes -Pkubernetes-integration-tests -Dtest.exclude.tags=minikube,r "kubernetes-integration-tests/test`

Closes: #34924

Closes #35345 from Yikun/SPARK-37145-alt.

Lead-authored-by: Yikun Jiang <yikunkero@gmail.com>
Co-authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun added a commit that referenced this pull request Jul 17, 2025
…cludedFeatureSteps`

### What changes were proposed in this pull request?

This PR aims to support `spark.kubernetes.(driver|executor).pod.excludedFeatureSteps` configuration.

### Why are the changes needed?

Since Apache Spark 3.2, we have been providing `spark.kubernetes.(driver|executor).pod.featureSteps`.
- #30206

This PR aims to allow users to exclude feature steps selectively by configurations. Please note that this is designed to allow to exclude all steps including both built-in and user-provided steps.

### Does this PR introduce _any_ user-facing change?

No because this is a new feature.

### How was this patch tested?

Pass the CIs with newly added test cases.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #51522 from dongjoon-hyun/SPARK-52830.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
haoyangeng-db pushed a commit to haoyangeng-db/apache-spark that referenced this pull request Jul 22, 2025
…cludedFeatureSteps`

### What changes were proposed in this pull request?

This PR aims to support `spark.kubernetes.(driver|executor).pod.excludedFeatureSteps` configuration.

### Why are the changes needed?

Since Apache Spark 3.2, we have been providing `spark.kubernetes.(driver|executor).pod.featureSteps`.
- apache#30206

This PR aims to allow users to exclude feature steps selectively by configurations. Please note that this is designed to allow to exclude all steps including both built-in and user-provided steps.

### Does this PR introduce _any_ user-facing change?

No because this is a new feature.

### How was this patch tested?

Pass the CIs with newly added test cases.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#51522 from dongjoon-hyun/SPARK-52830.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants