-
Notifications
You must be signed in to change notification settings - Fork 122
docs: add BinPack, Gang, Priority plugin documentation #492
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
Open
Mike-4-prog
wants to merge
2
commits into
volcano-sh:master
Choose a base branch
from
Mike-4-prog:gang-plugin-doc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 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
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 |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| +++ | ||
| title = "BinPack" | ||
| date = 2024-01-01 | ||
| lastmod = 2024-01-01 | ||
| draft = false | ||
| toc = true | ||
| type = "docs" | ||
|
|
||
| # Add menu entry to sidebar. | ||
| linktitle = "BinPack" | ||
| [menu.v1-12-0] | ||
| parent = "plugins" | ||
| weight = 1 | ||
| +++ | ||
|
|
||
|
|
||
| The **BinPack Plugin** in Volcano aims to fill nodes as efficiently as possible, trying not to leave nodes idle. It scores nodes based on resource utilization and schedules pods to maximize usage, which is especially useful for small jobs or high-concurrency workloads. | ||
|
|
||
| ## Plugin Details | ||
|
|
||
| - **Plugin Name:** `binpack` | ||
| - **Location in source:** `pkg/scheduler/plugins/binpack/binpack.go` | ||
| - **Purpose:** Optimizes node usage by packing pods onto fewer nodes, improving cluster resource utilization. | ||
|
|
||
| ## Features | ||
|
|
||
| 1. **Node Scoring** | ||
| - Scores nodes according to available resources. | ||
| - Higher scores indicate better utilization of node resources. | ||
|
|
||
| 2. **Weighted Resource Consideration** | ||
| - Considers CPU, memory, and other resources with configurable weights. | ||
| - Different resources can be prioritized in node selection. | ||
|
|
||
| 3. **Pod Placement** | ||
| - Fills existing nodes as much as possible before using new nodes. | ||
| - Reduces fragmentation and improves autoscaling efficiency. | ||
|
|
||
| 4. **Integration with Scheduler** | ||
| - Injected as a plugin into Volcano's scheduling process. | ||
| - Works at the pod node-selection stage. | ||
|
|
||
| ## Source Overview | ||
|
|
||
| ```go | ||
| // Example snippet from binpack.go | ||
| func New(arguments framework.Arguments) framework.Plugin { | ||
| return &binPackPlugin{pluginArguments: arguments} | ||
| } | ||
| ``` | ||
| The full implementation includes functions for scoring nodes, handling resource weights, and integrating with the scheduling session. | ||
|
|
||
| ## Example Configuration | ||
|
|
||
| To enable the BinPack plugin, add it to the scheduler configuration: | ||
|
|
||
| ```yaml | ||
| # scheduler configuration | ||
| actions: "enqueue, allocate, preempt" | ||
| tiers: | ||
| - plugins: | ||
| - name: binpack | ||
| arguments: | ||
| binpack.cpu: 5 | ||
| binpack.memory: 1 | ||
| ``` | ||
| ### Configuration Parameters | ||
|
|
||
| | Parameter | Description | Default | | ||
| |-----------|-------------|---------| | ||
| | `binpack.cpu` | Weight for CPU resources in scoring | 5 | | ||
| | `binpack.memory` | Weight for memory resources in scoring | 1 | | ||
| | `binpack.gpu` | Weight for GPU resources in scoring | 0 | | ||
|
|
||
| ## Usage Scenarios | ||
|
|
||
| BinPack is particularly useful for: | ||
|
|
||
| - **Batch processing jobs** where maximizing node utilization reduces cost | ||
| - **Single query jobs** that run quickly and benefit from efficient packing | ||
| - **High-concurrency services** with many small pods that can be packed onto fewer nodes | ||
| - **Cloud cost optimization** where reducing node count minimizes infrastructure costs | ||
|
|
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 |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| +++ | ||
| title = "Gang" | ||
| date = 2024-01-01 | ||
| lastmod = 2024-01-01 | ||
| draft = false | ||
| toc = true | ||
| type = "docs" | ||
|
|
||
| # Add menu entry to sidebar. | ||
| linktitle = "Gang" | ||
| [menu.v1-12-0] | ||
| parent = "plugins" | ||
| weight = 2 | ||
| +++ | ||
|
|
||
|
|
||
|
|
||
| {{<figure library="1" src="gang.png" title="Gang Plugin">}} | ||
|
|
||
|
|
||
| The **Gang Plugin** in Volcano enforces gang scheduling constraints, ensuring that a group of related tasks (a "gang") is scheduled together. This plugin is responsible for validating jobs, managing preemption, pipelining, and detecting job starvation. | ||
|
|
||
| ## Plugin Details | ||
|
|
||
| - **Plugin Name:** `gang` | ||
| - **Location in source:** `pkg/scheduler/plugins/gang/gang.go` | ||
| - **Purpose:** Ensures gang scheduling constraints and job readiness for tasks and sub-jobs. | ||
|
|
||
| ## Features | ||
|
|
||
| 1. **Job Validation** | ||
| - Validates tasks and sub-jobs for gang scheduling. | ||
| - Checks minimum required tasks (`MinAvailable`) before scheduling. | ||
|
|
||
| 2. **Preemption** | ||
| - Determines which tasks can be preempted without violating gang scheduling constraints. | ||
| - Tracks ready task counts per job to maintain scheduling guarantees. | ||
|
|
||
| 3. **Job Ordering** | ||
| - Orders jobs and sub-jobs based on readiness. | ||
| - Ready jobs have higher priority over non-ready jobs. | ||
|
|
||
| 4. **Pipelining** | ||
| - Allows pipelined scheduling when tasks and sub-jobs meet pipelined conditions. | ||
|
|
||
| 5. **Starvation Detection** | ||
| - Detects jobs that cannot be scheduled due to insufficient resources. | ||
|
|
||
| ## Source Overview | ||
|
|
||
| ```go | ||
| // Example snippet from gang.go | ||
| func New(arguments framework.Arguments) framework.Plugin { | ||
| return &gangPlugin{pluginArguments: arguments} | ||
| } | ||
| ``` | ||
| The full implementation includes functions for `OnSessionOpen`, `OnSessionClose`, job validation, preemption, pipelining, and readiness checks. | ||
|
|
||
| ## Example Configuration | ||
|
|
||
| To enable the Gang plugin, add it to the scheduler configuration: | ||
|
|
||
| ```yaml | ||
| # scheduler configuration | ||
| arguments: | ||
| timeout: 600 | ||
| ``` | ||
|
|
||
| ### Configuration Parameters | ||
|
|
||
| | Parameter | Description | Default | | ||
| |-----------|-------------|---------| | ||
| | `gang.schedule.timeout` | Timeout in seconds for gang scheduling | 600 | | ||
| | `gang.schedule.retry` | Number of retry attempts for gang scheduling | 5 | | ||
|
|
||
| ## Usage Scenarios | ||
|
|
||
| Gang scheduling is typically used for: | ||
|
|
||
| - **Distributed training jobs** where all workers must start together | ||
| - **MPI jobs** that require all processes to be running simultaneously | ||
| - **Batch processing workloads** with task dependencies | ||
| - **Big data analytics** where partial execution is not meaningful | ||
|
|
Oops, something went wrong.
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.
The weight for
Ecosystemhas been changed to8, which places it afterScheduler(weight 7). However, in the latest[[docs]]menu (lines 78-80),Ecosystemhas weight6and appears beforeScheduler. This inconsistency in the sidebar structure between versions should be addressed to ensure a uniform user experience.