Introduction | DB structure | Use cases | MOOT functions | Glossary |
Inspired by Eric Charles' analysis for ACD LATC configuration, I will make a(nother) stab at getting the concept of intent into MOOT. Eric has broken up the specification of ACD intent into 6 pieces: Mode, Bias, Timing, Hld, PHA and Veto. These pieces are known as precincts. Ultimately, intent boils down to LATC register specification (and other things; e.g., what belongs in an lci script, but for now we consider only LATC input, the most complicated part of the instrument configuration). The registers managed by a single precinct need not end up in the same LATC component. For example, Mode manages registers from AEM, ARC and AFE.
Eric had the idea of using xml files to describe intent and wrote a dtd (Document Type Definition) description of an XML format) for this purpose. The format has evolved somewhat to meet the needs of both the operator interface (reads and writes the files) and MOOT (reads only). For each precinct the registers and register fields it controls are listed and other inputs, if any, needed to generate settings are described. An XML document satisfying the dtd provides a full description of ACD intent by, for each precinct
It also specifies outputs: parameter files (in the MOOT sense; that is, sources used to create configuration binaries) and offline calibrations. See this old example which describes intent for the six ACD precincts (new design only allows an inline intent description for one precinct at a time). It is valid according to this XML schema. The most recent version of the schema can be found in the Offline CVS repository, package mootCore. A document describing intent for one of the precincts is called a vote; that is, a vote is a sort of instance of a precinct.
Introduction | DB structure | Use cases | MOOT functions | Glossary |
Recall that the source files used to generate a configuration (that is, the files which are input to FSW-supplied utilities like LATC) are known as Parameters. The goal is to generate the parameter files associated with a particular intent and also, given a configuration, to recover what the intent was when the configuration was generated. To do this, MOOT has to keep track of some additional (relatively) static relationships, such as the parameter classes associated with a particular precinct. It also has to keep track of relationships among instances of objects, such as the ancillary file(s) used in the generation of a particular parameter file.
The following can be thought of as primarily describing "things" or "classes of things" rather than relationships between things.
Ideally this is a relatively static table. For each delegate, experts should come up with a suitable description of its precincts.
Field name | Explanation, typical contents |
---|---|
key | Primary key, auto_increment; unique identifier |
name | Unique name, such as ACD_mode |
delegate_fk | Foreign key referencing Delegate table |
status | Indication of whether the precinct is to be used for new intent definitions |
creation_time | Timestamp for when row was inserted |
... | < and so forth.. more fields as needed > |
It might be helpful to extract important quantities from a vote file and store them in additional fields (e.g. method) in the row to make it easier for an operator to decide which votes to use by browsing the table.
Field name | Explanation, typical contents |
---|---|
key | Primary key, auto_increment; unique identifier |
name | Should give some inkling of the significance and purpose of this particular vote. Probably should not require uniqueness. |
source | Refers to a file which describes intent for a particular precinct. |
precinct_fk | Reference to row in Precincts |
status | Is this vote available for creating more parameter files? Is it obsolete? Defective? |
... | < and so forth.. more fields as needed > |
The pair (name, aclass_fk) is constrained to be unique. Vote files may (in fact, in current implementation, must) specify ancillary files by an alias.
Field name | Explanation, typical contents |
---|---|
key | Primary key, auto_increment; unique identifier |
name | Should give some inkling of the significance and purpose of this alias. Not unique. |
aclass_fk | Foreign key into Ancillary_class |
ancillary_fk | Foreign key into Ancillary. Must satisfy constraints: ancillary file referenced is of the correct class. |
last_modified_time | GMT timestamp |
last_modifier | OS username of creator or last updater of the row. |
The pair (name, precinct_fk) is constrained to be unique.
Field name | Explanation, typical contents |
---|---|
key | Primary key, auto_increment; unique identifier |
name | Should give some inkling of the significance and purpose of this alias. Not unique. |
precinct_fk | Foreign key into Precincts |
vote_fk | Foreign key into Votes |
last_modified_time | GMT timestamp |
last_modifier | OS username of creator or last updater of the row. |
Field name | Explanation, typical contents |
---|---|
parm_key | Primary key, auto_increment; unique identifier |
class_fk | Refers to row in Parameter_class |
vote_fk | Refers to row in Votes table. |
condition_fk | Refers to row in Conditions table. Conditions concept has been superseded by Precincts/Votes model. |
instrument | Defaults to "LAT" |
source | Path and filename for the parameter data relative to root directory of MOOT archive. |
src_fmt | Defaults to "xml" |
src_creation_time | GMT timestamp; defaults to "NOW". |
quality | One of "PROD", "DEV", "TEST", "SUPSED", "INVALID" |
flavor | Superseded by precincts/votes model |
vstart | Start of validity interval — but this isn't an especially useful concept for parameter files. |
vend | End of validity interval — but this isn't an especially useful concept for parameter files. |
description | Optional comments, currently restricted to 255 characters. Should max size be increased? |
status | One of "STARTED", "ABORT", "CREATED", "INVALID". This field is maintained by MOOT. |
checksum | Used in first cut of checking for identical files. Maintained by MOOT. |
size | Used in first cut of checking for identical files. Maintained by MOOT. |
creation_time | Timestamp (GMT) for creation of row in the database; maintained by MOOT. |
creator | Username (operating system login name, not MySQL username) of user creating the entry; maintained by MOOT. |
Several other relation tables will be added for various purposes: Vote_PClass_AClass, Container_Precinct, LATC_Backup.
Some relationships are more conveniently expressed with additional foreign keys.
Introduction | DB structure | Use cases | MOOT functions | Glossary |
The set of precincts is expected to be relatively static. They will be defined by subsystem or other experts once and for all (or nearly) and corresponding rows will be added to Precincts by the MOOT maintainer.
The collection of votes is likely to continue to increase, albeit slowly. A MOOT function will be provided so that experts can register them on their own. If all subsystems use Eric's scheme (and they will since Eric has done the work of defining precincts for them), a vote corresponds to an XML element, including its attributes and child elements, as serialized in a file. This file will be archived (that is, copied to MOOT's archive in SLAC afs space) upon registration just as parameter and ancillary files are archived.
Parameter files may be derived from any number (including zero) of ancillary files. In the new scheme of things, they will always be related to a vote. Someone (subsystem expert to begin with; ultimately perhaps an operator) will determine which vote should be used to generate a parameter file or files. The vote should, directly or indirectly, specify the procedure to be run and the inputs: ancillary files and/or constants. At the close of the procedure whoever (or whatever) invoked it should have all information necessary to register the new parameter file(s) and indicate which ancillary files they depend upon. MOOT functions will be available to
Note that the complete process, all the way from generating ancillary files to coming out with a new config, takes place in a sequence of steps which can be spaced out in time. Steps or parts of steps which are done via MOOT services are indicated like this.
The essential content (e.g., register settings) of the two sets of files will be identical, but other features, such as the votes associated with the parameter files when they were registered, may differ.
A new MOOT query will be added to return the key of the vote associated with a parameter file, making it possible to recover the complete set of votes (= intent) associated with a config.
Introduction | DB structure | Use cases | MOOT functions | Glossary |
MootBuild::registerVote(const std::string& precinct, const std::string& source, const std::string& descrip, const std::vector<std::pair<std::string, std::string>>& parmAnc) const std::string& schemaVersion="*", const std::string& schema="intent")The third-to-last argument is used to describe which ancillary file classes a parameter file produced by the Vote depends on. The service will add this information to the vote file before copying it to the archive. The last two arguments specify the schema file to be used when validating the vote file. By default the latest version of the file with core name "intent" will be used, e.g. something like intent_v2r0p0.xsd.
unsigned registerAncillary(const std::string& class, const std::string& source, const std::string& descrip, const std::string& instrument, const std::string& GMT_creationTime, PARMQUAL quality=PARMQUAL_test, const std::string& source_fmt="xml")
MootBuild::setAncAlias(const std::string& aliasName, unsigned ancKey, const std::string& ancClass)
MootBuild::setVoteAlias(const std::string& aliasName, unsigned voteKey, const std::string& precinct)
unsigned registerParameter(const std::string& class, const std::string& source, const std::string& descrip, const std::vector<unsigned>& ancKeys, unsigned voteKey=1, PARMQUAL quality=PARMQUAL_test, const std::string& sourceFmt="xml")[Do we want to return oldKey as older register-parameter routines did? Don't think so.]
The default value of 1 for voteKey refers to a dummy vote file; its use here implies the parameter file was generated in some non-standard manner.
If ancKeys is non-empty, MOOT will make entries in Ancillary_to_parameters relating the new parameter file to the ancillaries. Another possibility would be to use the vote key to determine what the ancillary files were, however we might get the wrong answer if the "new" parameter file was in fact generated a while ago, and since then the resolution of an alias name for some ancillary file had changed.
Still to do: check whether ancillary files are of proper classes as specified by vote.
unsigned resolveAncAlias(const std::string& alias, const std::string& ancClass)Returns key of file registered in Ancillary if there is one; else 0.
int resolveAncAliases(std::vector<unsigned>& ancKeys, unsigned voteKey)Return number of ancillary file keys found or negative value for error (e.g., no such voteKey) — or should it throw an exception in this case?
unsigned resolveVoteAlias(const std::string& alias, const std::string& precint)Returns key of file registered in Votes if there is one; else 0.
bool voteIsUpToDate(unsigned voteKey)Returns true if associated parameter files have been created for the ancillary files which are the resolutions of aliases mentioned in the file. The same function will also work for a global intent file whose contents are a list of references to aliases for "little" vote files. In this case the function will resolve the references, then check if the individual vote files are up to date.
bool configIsUpToDate(unsigned configKey)Only applies to configs for which optional global-intent file key has been supplied. This function checks that the global-intent file is up to date, then compares set of parameter files generated by use of global-intent file with current value of all relevant aliases with the set of parameter files specified when the config was built.
unsigned getVoteParameters(unsigned voteKey, std::vector..if vote is up to date; otherwise just set isUpToDate to false. May also be used with container vote file.& parmKeys, bool& isUpToDate);
Introduction | DB structure | Use cases | MOOT functions | Glossary |
The quantities controlled by a particular delegate may be further partitioned into precincts. A precinct is defined by the quantities it determines and by the kinds of inputs (e.g., data like ACD pedestal calibrations or settings like "number of counts above pedestal") used to determine them. Register values or other quantities controlled by a precinct would normally be established all at the same time by means of a single procedure.
A vote describes the particular inputs and (perhaps) procedure to be used (e.g., "run program X, using the most recent good pedestal calibration, establishing thresholds 17 counts above pedestal"). A vote file corresponds to the intent for the items (e.g. registers; flight software parameters) it controls. Roughly speaking, precinct/vote have a class/instance relationship. A global intent file is another xml file whose only content is a list of references to vote aliases. At any given time these may be resolved using MOOT's vote_alias table.
Created: 19 Jan 2007 Last revised: Wednesday, 07-Nov-2007 17:21:34 PST |
J. Bogart |