-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-40187][DOCS] Add Apache YuniKorn scheduler docs
#37622
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1811,6 +1811,50 @@ spec: | |
| queue: default | ||
| ``` | ||
|
|
||
| #### Using Apache YuniKorn as Customized Scheduler for Spark on Kubernetes | ||
|
|
||
| [Apache YuniKorn](https://yunikorn.apache.org/) is a resource scheduler for Kubernetes that provides advanced batch scheduling | ||
| capabilities, such as job queuing, resource fairness, min/max queue capacity and flexible job ordering policies. | ||
| For available Apache YuniKorn features, please refer to [this doc](https://yunikorn.apache.org/docs/next/get_started/core_features). | ||
|
|
||
| ##### Prerequisites | ||
|
yangwwei marked this conversation as resolved.
|
||
|
|
||
| Install Apache YuniKorn: | ||
|
|
||
| ```bash | ||
| helm repo add yunikorn https://apache.github.io/yunikorn-release | ||
| helm repo update | ||
| kubectl create namespace yunikorn | ||
| helm install yunikorn yunikorn/yunikorn --namespace yunikorn | ||
|
yangwwei marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| the above steps will install the latest version of YuniKorn on an existing Kubernetes cluster. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use specific version instead recommending
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| ##### Get started | ||
|
|
||
| Submit Spark jobs with the following extra options: | ||
|
|
||
| ```bash | ||
| --conf spark.kubernetes.scheduler.name=yunikorn | ||
| --conf spark.kubernetes.driver.annotation.yunikorn.apache.org/app-id={{APP_ID}} | ||
| --conf spark.kubernetes.executor.annotation.yunikorn.apache.org/app-id={{APP_ID}} | ||
| ``` | ||
|
|
||
| Note, `{{APP_ID}}` is the builtin variable that will be substituted with Spark job ID automatically. | ||
|
yangwwei marked this conversation as resolved.
Outdated
|
||
| With the above configuration, the job will be scheduled by YuniKorn scheduler instead of the default Kubernetes scheduler. | ||
|
|
||
| ##### Work with YuniKorn queues | ||
|
yangwwei marked this conversation as resolved.
Outdated
|
||
|
|
||
| Apache YuniKorn supports 2 types of resource queues: | ||
|
|
||
| - Static | ||
| - Dynamic | ||
|
|
||
| The static queues are predefined in YuniKorn configmap, and the dynamic queues are automatically created by the scheduler | ||
| based on [placement rules](https://yunikorn.apache.org/docs/next/user_guide/placement_rules). Spark supports to run with | ||
|
yangwwei marked this conversation as resolved.
Outdated
|
||
| both queue setup. Refer to this [doc](https://yunikorn.apache.org/docs/next/user_guide/resource_quota_management) for more | ||
| information about how to run Spark with different queue setup. | ||
|
|
||
|
yangwwei marked this conversation as resolved.
|
||
| ### Stage Level Scheduling Overview | ||
|
|
||
| Stage level scheduling is supported on Kubernetes when dynamic allocation is enabled. This also requires <code>spark.dynamicAllocation.shuffleTracking.enabled</code> to be enabled since Kubernetes doesn't support an external shuffle service at this time. The order in which containers for different profiles is requested from Kubernetes is not guaranteed. Note that since dynamic allocation on Kubernetes requires the shuffle tracking feature, this means that executors from previous stages that used a different ResourceProfile may not idle timeout due to having shuffle data on them. This could result in using more cluster resources and in the worst case if there are no remaining resources on the Kubernetes cluster then Spark could potentially hang. You may consider looking at config <code>spark.dynamicAllocation.shuffleTracking.timeout</code> to set a timeout, but that could result in data having to be recomputed if the shuffle data is really needed. | ||
|
|
||
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.
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.
We cannot use the version number alias
nexthere because it will be fragile in the future.v1.0.0link instead.1.0.0yet.We need Apache YuniKorn community's help here, @yangwwei .
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.
hi @dongjoon-hyun This is how the doc site works, next -> is the current under-development version, we shouldn't use this, that's a good point; but I think we can use the latest stable version: this points to https://yunikorn.apache.org/docs/. Only the past versions are accessible via https://yunikorn.apache.org/docs/{VERSION_NUM}, that's why you did not see 1.0.0 there, 1.0.0 is the current stable version.
If we use a hard-coded version, e.g 1.0.0 here, we will need to come back to update the doc quite often, I don't feel that is good. So my question is: is it better to use the latest stable version here or a hard-coded version that will need updates over time? Please let me know, thanks!
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.
That's what I asked here. Apache YuniKorn community should provide 1.0.0 like Apache Spark did.
That is mandatory in order to guarantee when we support something. Please see Volcano example.