Netrics repository to generate and maintain configuration for Netrics FLOTO containers.
![image](https://private-user-images.githubusercontent.com/2147779/244775680-df3a1b95-1107-471c-967d-dc81796c5f51.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzOTA2MzcsIm5iZiI6MTczOTM5MDMzNywicGF0aCI6Ii8yMTQ3Nzc5LzI0NDc3NTY4MC1kZjNhMWI5NS0xMTA3LTQ3MWMtOTY3ZC1kYzgxNzk2YzVmNTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTk1ODU3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGQzOWM2NmQwNDYzZTgwMjYyYjc2MWIwYTkyMjk2OGY4YmNmYTY4YzA5MDAyZTYxM2JhNGYxNjRkOGQ4ZGQ0NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Px4nTNvh1OH67TtsCqjboHJCa1LaUBD9kq6onhV6jcA)
This module turns balena_devices_output.json
into a directory structure full of configuration files for each one of the FLOTO devices.
It takes a jinja template to serve as a base for generating the final configuration files.
TBD: plugins can be implemented to provide a logic for paramenter generation (right now, the function gen_config is responsible for a default configuration).
- netrics-config can be operated through the scripts available in the
scripts
folder, mainly throughmanage.py
- netrics-config will use and write to
$HOME/.netrics-config/
in order to operate. - No sensitive data is shared along with these configuration.
A typical config template file (Jinja) can be found here.
- Establish the AWS bucket credentials through AWS configure;
- Make sure you have write permissions and puclic read permissions to the bucket;
- Copy
database.yaml
anddata/s3
from either netrics-config-data-v1 or netrics-config-data-v2 private repos; - Any changes to
database.yaml
and/ordata/s3
should be ideally updated on the private data repos - You can overwrite the parameters generated by
gen_config
with the parameters listed indatabase.yaml
by selectingoverwrite: true
and changing the parameters in thedatabase.yaml
file - From
scripts
runmanage.py -i balena_devices_output.json
to generate new data on localdata/s3
- Run
sync.sh
to update to the cloud.
The file structure should look like:
.
├── data
│ ├── backup
│ ├── database-blacklist.yaml
│ ├── database.yaml
│ ├── database.yaml.new
│ └── s3
│ ├── 051a9184995bdd161e4a031ec8b38fc1
│ │ └── nm-exp-active-netrics.toml
│ ├── 1e01471bc0bc7884ecb711af3f78e9f3
│ │ └── nm-exp-active-netrics.toml
│ ├── 24d4783ea4639e88bc39115ae9d2e082
│ │ └── nm-exp-active-netrics.toml
│ ├── 2560db8b79608a6d6bdc450e4709d3db
│ │ └── nm-exp-active-netrics.toml
│ ├── 4582cc4fb0054aeac5445460f664dc12
│ │ └── nm-exp-active-netrics.toml
│ ├── 743c94e868c86ff18685a03b74ef3ab4
│ │ └── nm-exp-active-netrics.toml
│ ├── 8e9f994db1c34b7933388804f4adf5c6
│ │ └── nm-exp-active-netrics.toml
│ ├── ba444188a8b7364ce5a36182e9477b62
│ │ └── nm-exp-active-netrics.toml
│ ├── cdef0f835fdc82be19b834a20ac5e315
│ │ └── nm-exp-active-netrics.toml
│ ├── d20906c3e10d0b20c6a3540c3e3188e0
│ │ └── nm-exp-active-netrics.toml
│ └── eb559c17b1bf466296ed8ed6f1172e1c
│ └── nm-exp-active-netrics.toml
└── templates
└── default
└── nm-exp-active-netrics.template.toml.jinja
TBD