bank_table: add max-preempt-after column#556
Open
cmoussa1 wants to merge 4 commits intoflux-framework:masterfrom
Open
bank_table: add max-preempt-after column#556cmoussa1 wants to merge 4 commits intoflux-framework:masterfrom
max-preempt-after column#556cmoussa1 wants to merge 4 commits intoflux-framework:masterfrom
Conversation
Member
Author
|
@ryanday36 when you have some time, could you give this a look and let me know if this looks like something you'd be good with in terms of managing banks in the flux-accounting database? Note that this doesn't actually enforce the limit in the priority plugin (yet); it's just the first part in being able to define and set this limit in the DB. |
9debb7a to
9f85ca7
Compare
7c89ae1 to
a6a3de5
Compare
02ac4d2 to
3deb9e0
Compare
Problem: The bank_table does not have a way to track a max preemptible-after value for a certain bank. This kind of information is needed to enforce a limit on association-set preemptible-after values on their jobs as well as set a default on their job in the case where the association does not set one on their own. Add a new column to the bank_table called "max_preempt_after", which is a floating point number representing the max number of seconds in which a job submitted under this bank can run before being preempted. It does not require a value and does not have a default. Update the schema version number of the flux-accounting database to account for the change to bank_table. Add "max_preempt_after" to the list of column names defined in the BANK_TABLE constant in __init__.py.
Problem: The add-bank and edit-bank commands have no way to specify a max-preempt-after value for a bank when it is being added to the bank_table. Add a new optional argument to the add-bank and edit-bank commands: --max-preempt-after, which takes a Flux Standard Duration (FSD) value representing the max amount of time in which a job submitted under this bank can run before being preempted. The max-preempt-after attribute for a bank can also be cleared by passing -1 to the --max-preempt-after optional argument in the edit-bank command.
Problem: There are a number of tests that check the output of the view-bank commands that are now out-of-date because of the addition of the max-preempt-after column. Edit the expected output for a number of files in the flux-accounting testsuite to account for the addition of the max-preempt-after column.
Problem: There are no tests for adding/editing banks in the bank_table with max-preempt-after values. Add some tests.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #556 +/- ##
=======================================
Coverage 84.11% 84.11%
=======================================
Files 26 26
Lines 2185 2185
=======================================
Hits 1838 1838
Misses 347 347 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The
bank_tabledoes not have a way to track a maxpreemptible-aftervalue for a certain bank. This kind of information is needed to enforce a limit on association-setpreemptible-aftervalues on their jobs as well as set a default on their job in the case where the association does not set one on their own.This PR begins to add support for enforcing
preemptible-afterlimits on a per-bank basis by adding a new column to thebank_tablecalledmax_preempt_after, which is a floating point number representing the max number of seconds in which a job submitted under this bank can run before being preempted. It does not require a value and does not have a default value.--max-preempt-afteroptional arguments are also added to theadd-bankandedit-bankcommands to allow an admin to both define and change themax-preempt-afterattribute for a bank. The expected format for this attribute in both theadd-bankandedit-bankcommands is Flux Standard Duration (FSD). A bank'smax-preempt-aftercan also be cleared by passing-1as a value if the admin no longer wants to have a maxpreemptible-afterattribute defined for a particular bank.I've added some basic tests to a new test file that adds multiple banks with different FSD values as well as resets its value after setting a value initially.
Fixes #553