Skip to content

Add LbExec implementation

Chris Burr requested to merge cburr/add-lbexec into master

This merge request is adds the lbexec command proposed in #198 (closed) and the associated Options class. After Moore and DaVinci are adapted I'll make a follow-up merge request to remove the ApplicationOptions class and start cleaning up/adapating the tests.

This turned into quite a lot of code when compared to the prototype to however the majority of it is test code and error handling. In particular it tries to give people a more helpful message when the application is already doomed to fail (expand below for examples).

lbexec --help

usage: lbexec [-h] [--dry-run] [--export EXPORT] function options [extra_args ...]

positional arguments:
  function         Function to call with the options that will return the configuration. Given in the form 'my_module:function_name'.
  options          YAML data to populate the Application.Options object with. Multiple files can merged using 'file1.yaml+file2.yaml'.
  extra_args

optional arguments:
  -h, --help       show this help message and exit
  --dry-run        Do not run the application, just generate the configuration.
  --export EXPORT  Write a file containing the full options (use "-" for stdout)

Error handling examples

Wrong specification of the function to run

Click to view

Screenshot_2022-03-22_at_16.30.40

Bad contents of the options.yaml file(s)

Click to view

Screenshot_2022-03-22_at_16.43.54

Tracebacks don't include lbexec's implementation details

Click to view

Screenshot_2022-03-22_at_16.34.10

Related to DPA tasks lhcb-dpa/analysis-productions/LbAnalysisProductions#69 (closed) and lhcb-dpa/analysis-productions/LbAnalysisProductions#68 (closed).

Edited by Eduardo Rodrigues

Merge request reports