Belle II Software light-2406-ragdoll
|
Public Member Functions | |
def | __init__ (self, db, running, staging, valid_from, mode, dry_run=False) |
def | calculate_update (self) |
def | apply_update (self) |
Protected Member Functions | |
def | _check_state (self, tagname, taginfo, required) |
def | _check_all (self) |
def | _check_running_tag (self, tagname, payloads) |
def | _check_staging_tag_simple (self, tagname, payloads) |
def | _check_staging_tag (self, tagname, payloads) |
Protected Attributes | |
_db | |
Reference to the database object to use for queries. | |
_dry_run | |
If we're in dry run mode be less critical about globaltag states (just show warnings) but refuse to do any actual update. | |
_valid_from | |
First valid run for the update. | |
_mode | |
True if we want to allow payloads in the staging tag to be closed, for example when retiring a payload. | |
_allow_closed | |
Do we allow closed iovs in staging? | |
_fix_closed | |
Do we want to automatically open closed iovs? | |
_staging_coverage | |
Dictionary mapping payload names in the staging tag to the coverage they have in the staging tag, filled by check_staging_tag. | |
_operations | |
Operations for the update, filled by calculate_update() | |
_running_info | |
Globaltag information for the running tag. | |
_staging_info | |
Globaltag information for the staging tag. | |
_running_payloads | |
Payloads currently in the running tag. | |
_staging_payloads | |
Payloads currently in the staging tag. | |
_staging_first_iovs | |
First iov per payload name in staging to not close and open the same revision. | |
Calculate and apply the necessary changes to update a running globaltag For this we take two globaltags: the running one and a staging one containing all the payloads and iovs to be added to the running tag. We then 1. Make sure they are in the correct states (RUNNING and VALIDATED) 2. Make sure all payloads in the running tag start and end (except for open iovs) before the given ``valid_from`` run 3. Make sure the staging tag is overlap and gap free 4. Make all payloads in staging start at either 0,0 or on/after the given ``valid_from`` run 5. Make sure all payloads in staging are unbound unless the mode is ``ALLOW_CLOSED`` or ``FIX_CLOSED``. In case of ``FIX_CLOSED`` extend the last iov to infinity 6. Close all payloads to be updated in the running tag that are open just before the validity in the staging tag.
Definition at line 56 of file runningupdate.py.
def __init__ | ( | self, | |
db, | |||
running, | |||
staging, | |||
valid_from, | |||
mode, | |||
dry_run = False |
|||
) |
Initialize the class Arguments: db (ConditionsDB): reference to the database object running (str): name of the running tag staging (str): name of the staging tag valid_from (tuple(int,int)): first valid exp,run mode (RunningTagUpdateMode): the mode of the update dry_run (bool): If true only check, don't do anything. But be more lenient with globaltag state of staging.
Definition at line 76 of file runningupdate.py.
|
protected |
Run all necessary checks on all globaltags
Definition at line 158 of file runningupdate.py.
|
protected |
Check that all payloads in the running tag start and end (or are open) before the first valid run for the update
Definition at line 170 of file runningupdate.py.
|
protected |
Check if the staging tag is 1. overlap free 2. gap free 3. all payloads are open (unless the mode allows closed payloads) 4. all payloads start at 0,0 or after the first valid run for the update Arguments: tagname (str): Name of the globaltag for error messages payloads (list(conditions_db.PayloadInformation)): List of payloads in the tag
Definition at line 235 of file runningupdate.py.
|
protected |
Extra simple case where we want to have a very simple staging tag just consisting of (0,0,-1,-1) iovs, one per payload
Definition at line 206 of file runningupdate.py.
|
protected |
Check the state of a globaltag given the tag information object returned by the database 1) that it's found and 2) that it has the same state as in ``required`` Parameters: tagname: name of the tag for error messages taginfo: tag information returned from the database, None if the tag could not be found required: required state for the tag. Raises: an `RunningTagUpdaterError` if any condition is not fulfilled
Definition at line 135 of file runningupdate.py.
def apply_update | ( | self | ) |
Apply a previously calculated update to the globaltag Warning: This action cannot be undone, only call it after checking the operations returned by the calculation of the update
Definition at line 381 of file runningupdate.py.
def calculate_update | ( | self | ) |
Calculate the operations needed to merge staging into the running base tag
Definition at line 332 of file runningupdate.py.
|
protected |
Do we allow closed iovs in staging?
Definition at line 109 of file runningupdate.py.
|
protected |
Reference to the database object to use for queries.
Definition at line 89 of file runningupdate.py.
|
protected |
If we're in dry run mode be less critical about globaltag states (just show warnings) but refuse to do any actual update.
Definition at line 101 of file runningupdate.py.
|
protected |
Do we want to automatically open closed iovs?
Definition at line 112 of file runningupdate.py.
|
protected |
True if we want to allow payloads in the staging tag to be closed, for example when retiring a payload.
Definition at line 107 of file runningupdate.py.
|
protected |
Operations for the update, filled by calculate_update()
Definition at line 117 of file runningupdate.py.
|
protected |
Globaltag information for the running tag.
Definition at line 120 of file runningupdate.py.
|
protected |
Payloads currently in the running tag.
Definition at line 129 of file runningupdate.py.
|
protected |
Dictionary mapping payload names in the staging tag to the coverage they have in the staging tag, filled by check_staging_tag.
Definition at line 115 of file runningupdate.py.
|
protected |
First iov per payload name in staging to not close and open the same revision.
Definition at line 133 of file runningupdate.py.
|
protected |
Globaltag information for the staging tag.
Definition at line 122 of file runningupdate.py.
|
protected |
Payloads currently in the staging tag.
Definition at line 131 of file runningupdate.py.
|
protected |
First valid run for the update.
Definition at line 103 of file runningupdate.py.