Skip to content

Set Partition Based On Run Age for Commissioning Proposals

Robert Rosca requested to merge feat/commissioning-partition-by-age into master

Description

Since commissioning proposals are always in the active state for the whole cycle, they always get upex-middle as their partition, even when they should no longer be prioritised. Calibration jobs for old commissioning runs shouldn't be prioritised over current user runs jobs.

There's a new key in the webservice.yaml configuration:

...

correct:
  ...
  commissioning-max-age-days: 3

Which can be used to set the age at which correct jobs for commissioning runs are bumped down from upex-middle to exfel.

To do this get_slurm_partition needed some new arguments (run_id, cycle), which get passed if necessary. The new check only runs if the additional args are set and if the 4th index of cycle is not 0 (indicating it's a commissioning proposal), then it uses mdc.get_run_by_id_api to get the start time of the run (*) as a string, parse it, and compare it with the max age days setting. If the age is greater than the setting, then partition is set to exfel.

How Has This Been Tested?

Added unit tests.

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Test (additional or refactored tests)

Checklist:

  • My code follows the code style of this project.
  • I added tests where appropriate.

Reviewers

@calibration

Notes:

  • * for whatever reason when I wrote this I used begin_at instead of end_at (or stop at, whatever), should the check be against the end time instead?
  • This only runs for correct jobs, it is ignored for darks. Should the check be done for darks as well? It's (marginally) more complex as there are multiple runs and one (youngest?) should be picked for the comparison, but it doesn't seem like much more work
  • Should the partitions themselves, and their priorities, be configurable as well?
Edited by Robert Rosca

Merge request reports