Balance job scheduling by submitters
This patch is intended to prevent submitter starvation when jobs have the same priority and single submitter sends a large batch of jobs.
It is implemented by determining a number of already running jobs for each submitter and using it to annotate the jobs submitted to the queue. This allows reordering the job queue for picking a job from the submitter that could potentially be starving for an available device. To ensure fairness in edge cases (equal number of running jobs, single device of given device type) jobs sharing the same set of attributes are randomised.
This patch also changes in-tree tests to pass with scheduling adjustments and adds new ones to cover use cases described above.
Django database function Random() is not available in Django <3.2  hence added class.
Signed-off-by: Paweł Wieczorek email@example.com