-
Notifications
You must be signed in to change notification settings - Fork 10
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
plugin: enforce max resource limits per-association #562
base: master
Are you sure you want to change the base?
Conversation
@ryanday36 when you get the chance, could you give this PR a high-level look and let me know if this looks good from your side? I think I'd mostly be curious if the way that the plugin is enforcing the resource limits looks good to you. |
ece2f0f
to
2864dd6
Compare
This looks like a good approach to me @cmoussa1. I'm not sure I understand where |
Thanks @ryanday36. The |
2864dd6
to
d3dccb4
Compare
Problem: The priority plugin tracks resource usage across an association's set of running jobs, but it does not enforce any limits on this resource usage in the event where an association goes over their limit. Add a check in job.state.depend to see if the job's resources would put the association over *either* their max_nodes or max_cores limit. If so, add a dependency on the job and hold it. In job.state.inactive, rework the check to see if there are any held jobs for the association to also ensure the held job would satisfy all three conditions: 1) the association is under their max-running-jobs limit 2) the job would not put the association over their max nodes limit 3) the job would not put the association over their max cores limit If all three conditions are met, remove the dependency from the job. Because there could be more than one dependency (the job is either held due to a max running jobs limit *or* the job is held due to a max resources limit), attempt to remove both dependencies.
Problem: t1005 and t1012 create JSON payloads to be sent to the plugin, but these payloads don't contain max_cores or max_nodes information per-association. Add this information to the payloads sent to the plugin in t1005 and t1012.
Problem: The flux-accounting testsuite doesn't have any tests for checking dependencies on jobs when an association has hit their max resource limits. Add some basic tests.
d3dccb4
to
265229c
Compare
Problem
The priority plugin tracks resource usage across an association's set of running jobs, but it does not enforce any limits
on this resource usage in the event where an association goes over their limit.
This PR looks to add limit enforcement on an association's set of running jobs according to their resource usage, specifically with
ncores
andnnodes
. Injob.state.depend
, the jobspec for a submitted job is unpacked and its job size is calculated. If the job would put the association over either theirmax_cores
ormax_nodes
limit, a dependency is added to the job and it is held until a currently running job completes and frees the appropriate amount of resources.Since the priority plugin is now enforcing two different kinds of limits (
max-running-jobs
andmax-resources
), it needs a way to keep track of which dependencies a job has since now it can have one or both. A map is added to the plugin where the key is a the ID of a held job and the value is a list of dependencies associated with the job. A number of helper functions are added to search for held jobs' dependencies and remove them from the internal map when the job no longer has any dependencies on it.In
job.state.inactive
, the process of releasing a held job is reworked to check if the job satisfies all requirements in order to be released. It is first checked to see that the association is under theirmax-running-jobs
limit and then checked to see that the held job would not put the association over either theirmax_cores
ormax_nodes
limit. The dependencies for the job are removed as they are satisfied, i.e if a job would satisfy themax-running-jobs
dependency but not themax-resources-dependency
, only themax-running-jobs
dependency is removed and the job continues to be held. Once all requirements are met, the rest of the remaining dependencies are removed from the job and it can be released to run.To avoid becoming its own mini scheduler, the priority plugin will only look at the first held job for the association. So, if an association has two held jobs, only the first held job will be considered for release.
I've expanded the test file that originally just tracked resources across an association's set of jobs to also test checking adding and removing dependencies. Different scenarios are walked through to make sure an association's set of jobs have the correct dependencies added to it and are removed correctly, such as having a job only have a
max-running-jobs
ormax-resources
dependency added to it, have both dependencies added to it at the same time, only have one of the two dependencies removed from a held job, etc.