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

bank_table: add max-preempt-after column #556

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cmoussa1
Copy link
Member

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.


This PR begins to add support for enforcing preemptible-after limits on a per-bank basis by adding 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 value.

--max-preempt-after optional arguments are also added to the add-bank and edit-bank commands to allow an admin to both define and change the max-preempt-after attribute for a bank. The expected format for this attribute in both the add-bank and edit-bank commands is Flux Standard Duration (FSD). A bank's max-preempt-after can also be cleared by passing -1 as a value if the admin no longer wants to have a max preemptible-after attribute 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

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 command has 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 command:
--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.
Problem: The edit-bank command has no way to specify a
max-preempt-after value for a bank when it is being edited.

Add a new optional argument to the edit-bank command:
--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.
@cmoussa1 cmoussa1 added new feature new feature database related to the flux-accounting database labels Dec 19, 2024
@cmoussa1
Copy link
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.

Problem: There are no tests for adding/editing banks in the bank_table
with max-preempt-after values.

Add some tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database related to the flux-accounting database new feature new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bank_table: add max-preemptible-after column
1 participant