Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Apr 30, 2021

What changes were proposed in this pull request?

Since SPARK-22757, KubernetesUtils has been used as an important utility class by all K8s modules and ExternalClusterManagers. This PR aims to promote KubernetesUtils to DeveloperApi in order to maintain it officially in a backward compatible way at Apache Spark 3.2.0.

Why are the changes needed?

Apache Spark 3.1.1 makes Kubernetes module GA and provides an extensible external cluster manager framework. To have ExternalClusterManager for K8s environment, KubernetesUtils class is crucial and needs to be stable. By promoting to a subset of K8s developer API, we can maintain these more sustainable way and give a better and stable functionality to K8s users.

In this PR, Since annotations denote the last function signature changes because these are going to become public at Apache Spark 3.2.0.

Version Function Name
2.3.0 parsePrefixedKeyValuePairs
2.3.0 requireNandDefined
2.3.0 parsePrefixedKeyValuePairs
2.4.0 parseMasterUrl
3.0.0 requireBothOrNeitherDefined
3.0.0 requireSecondIfFirstIsDefined
3.0.0 selectSparkContainer
3.0.0 formatPairsBundle
3.0.0 formatPodState
3.0.0 containersDescription
3.0.0 containerStatusDescription
3.0.0 formatTime
3.0.0 uniqueID
3.0.0 buildResourcesQuantities
3.0.0 uploadAndTransformFileUris
3.0.0 uploadFileUri
3.0.0 requireBothOrNeitherDefined
3.0.0 buildPodWithServiceAccount
3.0.0 isLocalAndResolvable
3.1.1 renameMainAppResource
3.1.1 addOwnerReference
3.2.0 loadPodFromTemplate

Does this PR introduce any user-facing change?

Yes, but this is new API additions.

How was this patch tested?

Pass the CIs.

@dongjoon-hyun
Copy link
Member Author

Hi, @attilapiros . Could you review this PR, please?

@SparkQA
Copy link

SparkQA commented Apr 30, 2021

Test build #138101 has finished for PR 32406 at commit c405cab.

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

@SparkQA
Copy link

SparkQA commented Apr 30, 2021

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

@SparkQA
Copy link

SparkQA commented Apr 30, 2021

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

@dongjoon-hyun
Copy link
Member Author

Hi, @viirya . Could you review this?

Copy link
Contributor

@attilapiros attilapiros left a comment

Choose a reason for hiding this comment

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

I found these two issues.
After they are addressed LGTM.

}

@Since("3.2.0")
def loadPodFromTemplate(
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Apr 30, 2021

Choose a reason for hiding this comment

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

As I mentioned in the PR title, the signature is change recently (2fa792a), @attilapiros .
I know that because I changed it. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Please see the following PR description.

In this PR, Since annotations denote the last function signature changes because these are going to become public at Apache Spark 3.2.0.

}

@Since("3.0.0")
def buildPodWithServiceAccount(serviceAccount: Option[String], pod: SparkPod): Option[Pod] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not released yet, @attilapiros ! :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

Looks okay to make them as DeveloperApi.

@dongjoon-hyun
Copy link
Member Author

Thank you, @viirya and @attilapiros .
Although some APIs are very stable since 2.3.0, this PR starts to annotate these APIs as @Unstable at Apache Spark 3.2.0. This is just a beginning to give a better dev experience in K8s area.

@dongjoon-hyun
Copy link
Member Author

Thank you so much for your review, @viirya and @attilapiros !

@dongjoon-hyun
Copy link
Member Author

Then, I'll merge this with 2 approvals. :)

@dongjoon-hyun dongjoon-hyun deleted the SPARK-35280 branch April 30, 2021 18:39
flyrain pushed a commit to flyrain/spark that referenced this pull request Sep 21, 2021
Since SPARK-22757, `KubernetesUtils` has been used as an important utility class by all K8s modules and `ExternalClusterManager`s. This PR aims to promote `KubernetesUtils` to `DeveloperApi` in order to maintain it officially in a backward compatible way at Apache Spark 3.2.0.

Apache Spark 3.1.1 makes `Kubernetes` module GA and provides an extensible external cluster manager framework. To have `ExternalClusterManager` for K8s environment, `KubernetesUtils` class is crucial and needs to be stable. By promoting to a subset of K8s developer API, we can maintain these more sustainable way and give a better and stable functionality to K8s users.

In this PR, `Since` annotations denote the last function signature changes because these are going to become public at Apache Spark 3.2.0.

| Version | Function Name |
|-|-|
| 2.3.0 | parsePrefixedKeyValuePairs |
| 2.3.0 | requireNandDefined |
| 2.3.0 | parsePrefixedKeyValuePairs |
| 2.4.0 | parseMasterUrl |
| 3.0.0 | requireBothOrNeitherDefined |
| 3.0.0 | requireSecondIfFirstIsDefined |
| 3.0.0 | selectSparkContainer |
| 3.0.0 | formatPairsBundle |
| 3.0.0 | formatPodState |
| 3.0.0 | containersDescription |
| 3.0.0 | containerStatusDescription |
| 3.0.0 | formatTime |
| 3.0.0 | uniqueID |
| 3.0.0 | buildResourcesQuantities |
| 3.0.0 | uploadAndTransformFileUris |
| 3.0.0 | uploadFileUri |
| 3.0.0 | requireBothOrNeitherDefined |
| 3.0.0 | buildPodWithServiceAccount |
| 3.0.0 | isLocalAndResolvable |
| 3.1.1 | renameMainAppResource |
| 3.1.1 | addOwnerReference |
| 3.2.0 | loadPodFromTemplate |

Yes, but this is new API additions.

Pass the CIs.

Closes apache#32406 from dongjoon-hyun/SPARK-35280.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun added a commit that referenced this pull request Aug 29, 2023
…erApi`

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

This PR aims to promote `SparkKubernetesClientFactory` as **stable** `DeveloperApi` in order to maintain it officially in a backward compatible way at Apache Spark 4.0.0.

### Why are the changes needed?

Like SPARK-35280 and SPARK-37497, `SparkKubernetesClientFactory` is also able to be used to develop new `ExternalClusterManager` for K8s environment.
- #32406
- #34751

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

No. Previously, it was `private[spark]`.

### How was this patch tested?

Manual review because this is only a visibility change.

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

No.

Closes #42709 from dongjoon-hyun/SPARK-44995.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
viirya pushed a commit to viirya/spark-1 that referenced this pull request Oct 19, 2023
…erApi`

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

This PR aims to promote `SparkKubernetesClientFactory` as **stable** `DeveloperApi` in order to maintain it officially in a backward compatible way at Apache Spark 4.0.0.

### Why are the changes needed?

Like SPARK-35280 and SPARK-37497, `SparkKubernetesClientFactory` is also able to be used to develop new `ExternalClusterManager` for K8s environment.
- apache#32406
- apache#34751

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

No. Previously, it was `private[spark]`.

### How was this patch tested?

Manual review because this is only a visibility change.

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

No.

Closes apache#42709 from dongjoon-hyun/SPARK-44995.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit c596fce)
Signed-off-by: Dongjoon Hyun <[email protected]>
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.

4 participants