-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add support for separate resource pools with independent queue priorities. #517
Conversation
jankaspar
commented
Feb 18, 2021
•
edited
edited
- Each executer can specify resource pool it belongs to in the configuration
- Priorities are newly tracked per pool identifiers, in the beginning of scheduling priorities corresponding to the pool are loaded.
- Metrics are also produced broken down per pool. For queued resources metrics we count the job under each pool it could run in based on its requirements.
func GroupSchedulingInfoByPool(reports map[string]*api.ClusterSchedulingInfoReport) map[string]map[string]*api.ClusterSchedulingInfoReport { | ||
result := map[string]map[string]*api.ClusterSchedulingInfoReport{} | ||
for id, report := range reports { | ||
poolReports := result[report.Pool] |
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.
If I am reading this loop body correctly, could it be written as:
poolReports, ok := result[report.Pool]
if !ok {
poolReports = map[string]*api.ClusterSchedulingInfoReport{}
result[report.Pool] = poolReports
}
poolReports[id] + report
Not suggesting that it gets rewritten that way, primarily checking my understanding of the code.
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.
yes, your version is equivalent and more idiomatic, will update it.