maestrowf
maestrowf copied to clipboard
Introduction of user defined post steps
This PR relates to issue #98 -- the addition of pre and post steps. Some initial exploration has revealed that the addition of post steps will be a non-trivial effort so I'm making this PR the base PR for other branches that will iteratively refactor and add the necessary functionality to build this up. So far here's what's holding up the feature:
- The
ScriptAdapterandSchedulerScriptAdapterabstract interfaces are cumbersome. Theget_scheduler_commandmethod, for example, takes in a step as its only argument and returns a Boolean with a path to the script that executes the command and a path to the restart script (if the step specifies a restart). There is no general way to simply generate a script currently other than refactoring or adding more returns to theget_scheduler_commandmethod. - Script generation is too coupled with higher level information. The
LocalScriptAdapterhas the same underlying structure as any otherSchedulerScriptAdapterand because of this requires things like a header. A little more generalization is needed so that an adapter's functionality should get more specific information passed to it instead of a whole step. - The
SchedulerScriptAdapterreally should be split up into a batch interface and a script interface and would help with the first bullet. The division of responsibility would open up the ability to generate simple scripts without the need of extra information and could be used to generate scripts as needed without having monolithic generation methods.
The split of responsibilities is already being started in a new branch post_steps/adapter_refactor, which will lead to tweaks to all the adapters and then the addition of general script generation to support post steps.