KPI Library - KPI database population
We need to have a bootstrap script that can be called upon deployment in order to examine the different KPI classes present in the library and populate a database with information like ID/Keyword, name, description, dimension or category. Similarly, there must be a table or similar describing the different categories and dimensions.
This database will be consumed by an API offering this information to frontend or other possible consumers.
After a meeting with @emiedesiti and @jabefa to discuss the integration of DB initialization with KPIs across the infrastructure, we have outlined the following goals:
Goals:
Build an Image for KPI Population Script:
Create a Docker image that will execute the script responsible for populating the database with KPIs based on the KPI library. This image will serve as a component of the infrastructure.
Incorporate the Image into the Quality Evaluator Docker Swarm:
The newly created image will be added to the Quality Evaluator Docker Compose file as a service. This service should be configured with the necessary environment variables:
KPI_LIB_VERSION: This will indicate the version of the KPI library used and will help construct the full filename of the Wheel Python library, e.g., kpilibrary-${KPI_LIB_VERSION}.whl.
PostgreSQL Connection Environment Variables: Include the necessary environment variables to connect the service to the general PostgreSQL database. This will ensure that the KPI data can be populated into the correct database.