Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L LHCb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 193
    • Issues 193
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Jira
    • Jira
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • LHCbLHCb
  • LHCb
  • Merge requests
  • !3470

Add LbExec implementation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Chris Burr requested to merge cburr/add-lbexec into master Mar 22, 2022
  • Overview 48
  • Commits 3
  • Pipelines 12
  • Changes 21

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 May 18, 2022 by Eduardo Rodrigues
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cburr/add-lbexec