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

[WIP] priority plugin: add configurable plugin factor weights for priority calculation #220

Closed
wants to merge 6 commits into from

Conversation

cmoussa1
Copy link
Member

@cmoussa1 cmoussa1 commented Mar 16, 2022

This is a PR built on top of #207, a PR proposing adding a queue factor to priority calculation in the plugin.

Background

As more and more factors get added to the multi-factor priority plugin, there comes a need for configuring the weight of each factor to be more or less important in the overall calculation of a job's priority. For example, a scheduler operator may want to emphasize the importance of a user/bank's fairshare over what queue a job is submitted in, or vice versa.

Currently, the priority plugin defines the weights for each factor in the priority_calculation() function, which means the weights of both the fairshare and queue factors cannot be changed by a scheduler operator or sys admin.


This [WIP] PR looks to add configurable weights to both the flux-accounting DB and the priority plugin by adding a new table to the flux-accounting DB called plugin_factor_table. It will store all plugin factors and their associated weights, which are created when the database is first created. Commands to both view and edit these commands are also added, called view-plugin-factor and edit-plugin-factor, respectively.

These factors and their weights are included in the bulk update script, where it is then unpacked by the plugin into a map, with the name of the factor as the key, and its associated weight as the value. Its weight is then fetched in priority_calculation() when calculating the priority of a user/bank combo's job.

Both unit tests and sharness tests are added for the new commands and their effects on priority calculation in t1013-plugin-weights.t, which adds a user/bank combo who submits jobs under a number of different weight configurations for the various plugin factors.

Fixes #128

@cmoussa1 cmoussa1 added the new feature new feature label Mar 16, 2022
@cmoussa1 cmoussa1 force-pushed the plugin.weights branch 2 times, most recently from 4bb18ce to d2c9b83 Compare April 22, 2022 19:29
@cmoussa1 cmoussa1 changed the title [WIP] priority plugin: add configurable plugin factor weights for priority calculation priority plugin: add configurable plugin factor weights for priority calculation May 13, 2022
@cmoussa1
Copy link
Member Author

cmoussa1 commented May 13, 2022

OK, I think I'm getting closer, so I'll mark this as ready for some early initial review whenever convenient.

@cmoussa1 cmoussa1 marked this pull request as ready for review May 13, 2022 17:31
@cmoussa1 cmoussa1 requested a review from grondo May 13, 2022 17:31
@cmoussa1
Copy link
Member Author

Since queue priority and queue validation is soon to be disabled in flux-accounting (for now), I'll convert this back to [WIP] until we have a clearer idea of how queue support is going to be supported throughout the various flux components.

@cmoussa1 cmoussa1 changed the title priority plugin: add configurable plugin factor weights for priority calculation [WIP] priority plugin: add configurable plugin factor weights for priority calculation May 19, 2022
@cmoussa1 cmoussa1 marked this pull request as draft May 19, 2022 14:39
cmoussa1 added 6 commits June 3, 2022 07:40
Add a new table to the flux-accounting DB, plugin_factor_table, which
will hold the various factors and their associated weights to be used
in the multi-factor priority plugin. Insert the two factors, fairshare
and queue, as rows into the plugin_factor_table.
Add commands to view and edit the weights of each factor in the
plugin_factor_table.
Add a new RPC to flux-account-priority-update.py
which will fetch all plugin factors and their associated
weights from the flux-accounting DB's plugin_factor_table
and send it to the multi-factor priority plugin, where it
will be unpacked and stored in a map. The key-value pair
contains the plugin factor and its associated weight to be
used in the priority calculation of a job.
Instead of hard-coding the weights for all of the
priority factors in the priority_calculation() function,
fetch the weights stored in the plugin_factors map, which
contains information about the various priority factors and
their associated weights defined in the flux-accounting DB
plugin_factor_table. If for some reason the weight of either
factor cannot be found, a weight of 0 will be used in the
priority calculation of a job.
@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #220 (f5f00bf) into master (e796663) will decrease coverage by 0.27%.
The diff coverage is 85.36%.

❗ Current head f5f00bf differs from pull request most recent head 7ad1f14. Consider uploading reports for the commit 7ad1f14 to get more accurate results

@@            Coverage Diff             @@
##           master     #220      +/-   ##
==========================================
- Coverage   84.26%   83.99%   -0.28%     
==========================================
  Files          23       23              
  Lines        1176     1087      -89     
==========================================
- Hits          991      913      -78     
+ Misses        185      174      -11     
Impacted Files Coverage Δ
src/plugins/mf_priority.cpp 87.04% <85.36%> (-0.19%) ⬇️

@cmoussa1 cmoussa1 closed this Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

priority plugin: implement custom configuration for factor weights
1 participant