mmecina / CCS

The UVIE Space Central Checkout System (CCS) and Test Specification Tool (TST)
Mozilla Public License 2.0
1 stars 0 forks source link

Make Confignator and Databases #8

Open pasetti opened 3 months ago

pasetti commented 3 months ago

We would like to extend our "ReadMe" with some basic information on how to use the CCS.

As part of the installation we have to run: make confignator and make databases. We have found that it is sometimes necessary to re-run one or both of these commands when we make a change to the configuration file but we would like to have some more specific information on this point. In particular:

The background to our question is that we are using the CCS for two instruments and we now find that have slightly different configuration files (one instrument has a padding byte at the end of its TC Header). One option is to install two CCS's but it would also be possible to use one single installation and change configuration when we change instrument but we need to understand whether the change in configuration requires a re-run of make confignator and/or make databases.

mmecina commented 3 months ago

We believe that make databases clears the entries in the database holding the tmpool and should therefore be done every now and then to keep the database size manageable. Is this correct?

Correct, make databases drops the existing storage schema and creates a new, empty one. This is an effective way to delete old telemetry data. Alternatively, from CCS one can use cfl.DbTools._clear_db() or cfl.DbTools.clear_from_db(pool_name) to delete individual pools. Moreover, cfl.DbTools._purge_db_logs() can be executed to clear associated MySQL binary logs, which can also take up quite some disk space with time. In general make databases must be executed, whenever a new project file (packetconfig*.py) has been created and set in the egse.cfg.

What does the make confignator command do and are there any situations (after installation) when we should run it?

make confignator builds and installs the confignator Python package. It basically handles and provides access to the different cfg files of the CCS modules. During the build process, it defines the CCS root path. Whenever there is a major Python update, e.g. 3.11 to 3.12, make confignator must be run again.

If we run make confignator , should we also run make databases? Or are the two commands independent of each other?

The two are independent of each other and need to be run only under the circumstances mentioned above. Running one does not require executing the other.

Are there situations where running either or both of the two commands is dangerous (because it might break the CCS) or is it always safe to run them? (NB: It is clear that running make databases will delete entries in the tmpool database)

I can't think of any scenario where running either of the commands would break the CCS, but maybe execution should be avoided while a CCS instance is running.