-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_template.yaml.dist
197 lines (181 loc) · 5.36 KB
/
config_template.yaml.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
###################
# Template to be used by build_cruise_definition to create loggers,
# modes and templates.
#
# Typical invocation would be
#
# venv/bin/python local/rcrv/build_cruise_definition.py \
# --template local/rcrv/config_template.yaml \
# --host_path http://157.245.173.52:8000/api/ \
# --destination /opt/openrvdas/local/rcrv/cruise.yaml \
#
# The idea is that a default set of configs is defined for every
# sensor that is not otherwise overridden by an explicit sensor-named
# declaration.
####################
# Cruise boilerplate
cruise:
id: RCRV-Sample
start: '2020-01-01'
end: '2020-12-31'
####################
# By default, all loggers will have the configs defined under
# 'default'; this can be overridden by having the name of a sensor as
# a key along with the set of configs that it should have, as in the
# example below for gyro004.
loggers:
default: # Default set of configurations for a sensor
configs:
- 'off' # 'off' is a yaml keyword, so needs to be quoted
- stderr # echo raw input to stderr
- udp # parse and rebroadcast to UDP
- file/udp # store raw to logfile, parse and rebroadcast to UDP
- file/udp/db # store raw to logfile, parse and store to db
#gyro004: # example of a non-default set of configs for a sensor
# configs:
# - 'off'
# - udp
# - file/udp/db
####################
# For each mode, what config should be run when OpenRVDAS is put in
# that mode. The _SENSOR_ID_ lines are wildcarded defaults: a matching
# entry will be added for each sensor discovered by CORIOLIX for every
# sensor that does not have a config explicitly defined.
modes:
'off':
default: 'off'
monitor:
default: udp
#gyro004: 'off' # example of non-default config for mode
underway:
default: file/udp/db
####################
default_mode: 'off'
####################
# Some globals that we're going to define for the configs. These will
# be swapped in wherever they appear in the config templates. In
# addition to the variables defined in config_globals, the
# build_cruise_definition.py script will fill in the following variables
# from the CORIOLIX database:
#
# _SENSOR_ID_ -> sensor_id
# _UDP_PORT_ -> transmit_port
# _FIELD_PATTERNS_ -> text_regex_format
#
# _DATA_TABLE_ -> A dict passed to CORIOLIXWriters where keys are
# coriolix data tables and the values are lists of fields that
# are to be written to that table. e.g.:
#
# gnss_gga_bow_archive:
# - longitude
# - latitude
# gnss_vtg_bow_archive:
# - cog
# - sog
config_globals:
_UDP_WRITE_PORT_: 6221
_FILE_BASE_: /var/tmp/log/openrvdas
####################
# Templates for configs
configs_templates:
# Template for logger off
'off':
name: _SENSOR_ID_->off
# Template for writing raw output to stderr
stderr:
name: _SENSOR_ID_->stderr
readers:
- class: UDPReader
kwargs:
port: _UDP_PORT_
writers:
- class: TextFileWriter
# Template for writing parsed output to stdout
parsed:
name: _SENSOR_ID_->parsed
readers:
- class: UDPReader
kwargs:
port: _UDP_PORT_
transforms:
- class: ParseTransform
kwargs:
record_format: '{timestamp:ti},{field_string:os}'
field_patterns: _FIELD_PATTERNS_
writers:
- class: TextFileWriter
# Template for parsing and rebroadcasting via UDP
udp:
name: _SENSOR_ID_->udp
readers:
- class: UDPReader
kwargs:
port: _UDP_PORT_
transforms:
- class: PrefixTransform
kwargs:
prefix: _SENSOR_ID_
- class: ParseTransform
kwargs:
record_format: '{data_id:w} {timestamp:ti},{field_string:os}'
field_patterns: _FIELD_PATTERNS_
writers:
- class: UDPWriter
kwargs:
port: _UDP_WRITE_PORT_
# Template to store raw to logfile, parse and rebroadcast to UDP
file/udp:
name: _SENSOR_ID_->file/udp
readers:
- class: UDPReader
kwargs:
port: _UDP_PORT_
writers:
- class: LogfileWriter
kwargs:
filebase: _FILE_BASE_/_SENSOR_ID_/raw/_SENSOR_ID_
split_char: ','
- class: ComposedWriter
kwargs:
transforms:
- class: PrefixTransform
kwargs:
prefix: _SENSOR_ID_
- class: ParseTransform
kwargs:
record_format: '{data_id:w} {timestamp:ti},{field_string:os}'
field_patterns: _FIELD_PATTERNS_
writers:
- class: UDPWriter
kwargs:
port: _UDP_WRITE_PORT_
# Template to store raw to logfile, parse and rebroadcast to UDP
file/udp/db:
name: _SENSOR_ID_->file/udp/db
readers:
- class: UDPReader
kwargs:
port: _UDP_PORT_
writers:
- class: LogfileWriter
kwargs:
filebase: _FILE_BASE_/_SENSOR_ID_/raw/_SENSOR_ID_
split_char: ','
- class: ComposedWriter
kwargs:
transforms:
- class: PrefixTransform
kwargs:
prefix: _SENSOR_ID_
- class: ParseTransform
kwargs:
record_format: '{data_id:w} {timestamp:ti},{field_string:os}'
field_patterns: _FIELD_PATTERNS_
writers:
- class: UDPWriter
kwargs:
port: _UDP_WRITE_PORT_
- class: CORIOLIXWriter
module: local.rcrv.modules.coriolix_writer
kwargs:
data_table: _DATA_TABLE_