James Kuszmaul | 827bd21 | 2023-05-15 23:57:39 -0700 | [diff] [blame] | 1 | namespace aos.util; |
| 2 | |
| 3 | // This file defines a schema for what to validate when we run the |
| 4 | // config_validator against an AOS config. |
| 5 | // The primary purpose of this config is to allow the user to specify what |
| 6 | // sets of nodes they expect to be able to log on so that we can validate the |
| 7 | // logging configurations. In the future this may also include flags to indicate |
| 8 | // how aggressively to do certain checks. |
| 9 | // |
| 10 | // This flatbuffer should not exist in serialized form anywhere, and so is |
| 11 | // safe to modify in non-backwards-compatible ways. |
| 12 | |
| 13 | // Species a set of nodes that you should be able to combine the logs from and |
| 14 | // subsequently replay. E.g., this allows you to write a check that says |
| 15 | // "If you combine logs from pi2 & pi4, you should be able to replay data from |
| 16 | // nodes pi2, pi4, and pi6"; or |
| 17 | // "When logs from all nodes are combined, you should be able to replay data |
| 18 | // for all nodes;" or |
| 19 | // "Each node should log all the data needed to replay its own data" |
| 20 | // (this would require muliple LoggerNodeSetValidation's). |
| 21 | // |
| 22 | // Each LoggerNodeSetValidation table represents a single set of logging nodes |
| 23 | // that should be able to replay data on some number of other nodes. An empty |
| 24 | // list of loggers or replay_nodes indicates "all nodes." The above examples |
| 25 | // could then be represented by, e.g.: |
| 26 | // "pi2 & pi4 -> pi2, pi4, & pi6": |
| 27 | // {"loggers": ["pi2", "pi4"], "replay_nodes": ["pi2", "pi4", "pi6"]} |
| 28 | // "all -> all": {"logger": [], "replay_nodes": []} |
| 29 | // "each node -> itself": [ |
| 30 | // {"logger": ["pi1"], "replay_nodes": ["pi1"]}, |
| 31 | // {"logger": ["pi2"], "replay_nodes": ["pi2"]}, |
| 32 | // {"logger": ["pi3"], "replay_nodes": ["pi3"]}, |
| 33 | // {"logger": ["pi4"], "replay_nodes": ["pi4"]}] |
| 34 | table LoggerNodeSetValidation { |
| 35 | loggers:[string] (id: 0); |
| 36 | replay_nodes:[string] (id: 1); |
| 37 | } |
| 38 | |
| 39 | // This table specifies which |
| 40 | table LoggingConfigValidation { |
| 41 | // If true, all channels should be logged by some valid set of loggers. |
| 42 | // Essentially, this is checking that no channels are configured to be |
| 43 | // NOT_LOGGED except for remote timestamp channels. |
| 44 | all_channels_logged:bool = true (id: 0); |
| 45 | // A list of all the sets of logger nodes that we care about. Typically this |
| 46 | // should at least include an entry that says that "logs from all nodes should |
| 47 | // combine to allow you to replay all nodes." |
| 48 | logger_sets:[LoggerNodeSetValidation] (id: 1); |
| 49 | } |
| 50 | |
| 51 | table ConfigValidatorConfig { |
| 52 | logging:LoggingConfigValidation (id: 0); |
| 53 | } |
| 54 | |
| 55 | root_type ConfigValidatorConfig; |