maestrowf icon indicating copy to clipboard operation
maestrowf copied to clipboard

Clean, central record of all job step scripts' commands

Open tadesautels opened this issue 7 years ago • 1 comments

The proposed feature is a logging mechanism for what commands are actually issued to the system.

In its simplest form, this could be imagined as a single bash script that shows what steps are actually executed (or would be executed, if we imagine that this could be obtained before the study is launched).

This would be valuable for two reasons:

  1. It records what was actually executed; this contrasts with the yaml specification, which programmatically describes what is intended to be executed.
  2. It provides a means for a user to understand the translation of a Maestro specification to the actual execution; everything unpacked and put in a centralized location.

Frank's suggestions as to where this might be implemented are:

  1. In start_process
  2. Logging into the metadata via each adapter.

Either of these would provide the opportunity to catch and record the commands.

An alternate idea, as mentioned above, would be to composite the whole specification and its scattered job scripts into one large script before launching the study; say, via a special "dry-run" adapter, which would pass through the study structure, pulling out all of the scripts and effectively pasting them together.

tadesautels avatar Oct 08 '18 16:10 tadesautels

As @tadesautels mentions in the first comment, I see there are two options (there may be more). At first thought there are the two options mentioned:

  1. In start_process
  2. Logging into the metadata via each adapter.

There are issues with both:

  1. Using start_process is the most sensible place to put the logging, but the downside is that it is a utility function. Logging the command line would require that the utility method know about the study's global workspace which defeats the purpose of it being a utility function.
  2. Placing the logging into each adapter is another sensible avenue, but that would currently require each adapter to implement logging. This route can be taken if the adapters are refactored to use wrapper methods that then call logging.

One other thought came to mind, and I need to look up the style and proper use of them, is property tagging. One thing that could be added is the ability to specify something like @tracked that would implement some special logic to log. This solution may or may not be valid, as I've never actually explored implementing tags before, but it might be worth exploring.

For now, I'd have to say refactoring the adapters is probably the way to go, since their API is the closest we can get to start_process without yanking the function out of utils.

FrankD412 avatar Oct 09 '18 19:10 FrankD412