oktetlabs / test-environment

OKTET Labs Test Environment
Other
5 stars 10 forks source link

Custom modules break the recovery process following TA reboot #38

Open okt-denispr opened 7 months ago

okt-denispr commented 7 months ago

Rebooting the TA doesn't work properly when custom modules are used. Typically, custom modules are built using builder.conf, installed in the agent's lib/modules directory, and loaded via Configurator.

The issue arises because the filename subtree of the module tree has a volatile attribute. This is understandable, as rebooting the TA results in a change to the agent's directory name. However, this makes it impossible to reload the modules properly during recovery.

A possible solution could be to add a new node to the module tree, designed to search for modules in the agent directory. This node would function as an alternative to filename, but without specifying the path to a module. Implementing this solution would require only a minor modification to the code that processes the module tree.

Additionally, it is necessary to ensure that the system module is unloaded before custom ones are inserted, if this step was included in the initial configuration.

ol-arteman commented 7 months ago

In principle, we do already have a solution for this called substitutions (enabled by declaring subtitution: true on an object). See for the example /agent/env. The idea is that Configurator tries to split the current value of a substitutable instance into a fixed part and a variable part and then replace the variable part with the right value upon reboot. The mechanism is, however, a bit fragile, so it may need some tweaking for the particular task.

ol-arteman commented 7 months ago

I am strongly opposed to having a yet another module tree, this will result in nothing but a confusion,