Skip to content
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

Merged
merged 8 commits into from
Feb 22, 2021

Conversation

jankaspar
Copy link
Collaborator

@jankaspar jankaspar commented Feb 18, 2021

  • 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.

ingvarm-gr
ingvarm-gr previously approved these changes Feb 19, 2021
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]

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.

Copy link
Collaborator Author

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.

JamesMurkin
JamesMurkin previously approved these changes Feb 22, 2021
@jankaspar jankaspar merged commit 9d4d8a9 into master Feb 22, 2021
@jankaspar jankaspar deleted the resource-pools branch March 16, 2021 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants