WMCore icon indicating copy to clipboard operation
WMCore copied to clipboard

WMAgent - Add a generic script for running components standalone

Open todor-ivanov opened this issue 8 months ago • 0 comments

Impact of the new feature WMAgent + debugging

Is your feature request related to a problem? Please describe. This Feature request is an auxiliary one, in order to facilitate the debugging of https://github.com/dmwm/WMCore/issues/12007, and not only.

It would be good to have a generic script for running any WMagent component in a standalone mode. inside the already defined environment - docker or virtual env.

Describe the solution you'd like The envisioned solution should allow the usage of the following command and let the python shell in interactive mode:

ipython -i $WMA_ROOT_DIR/srv/WMCore/bin/wmagent-component-standalone -- --component JobAccountant

Describe alternatives you've considered Do nothing

Additional context Here is a printout of the interactive session from a first draft version of the so suggested script:

$ ipython -i $WMA_ROOT_DIR/srv/WMCore/bin/wmagent-component-standalone -- --component JobAccountant
Python 3.9.18 (main, Jan 24 2024, 00:00:00) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.18.1 -- An enhanced Interactive Python. Type '?' for help.
%reload_ext autoreload
%autoreload 2
2024-06-21 16:04:38,164:INFO:wmagent-component-standalone:main(): wmaConfigPath: /data/WMAgent.venv3/srv/wmagent/2.3.4rc7/config/config.py
2024-06-21 16:04:38,164:INFO:wmagent-component-standalone:main(): wmaComponent: JobAccountant
2024-06-21 16:04:38,164:INFO:wmagent-component-standalone:main(): logLevel: INFO
2024-06-21 16:04:38,164:INFO:wmagent-component-standalone:main(): daemon: False
2024-06-21 16:04:38,172:INFO:DBCore:__init__(): Instantiating base WM DBInterface

In [1]: dir()
Out[1]: 
['ArgumentParser',
 'CRIC',
 'In',
 'Out',
 'ResourceControl',
 '_',
 '__',
 '___',
 '__builtin__',
 '__builtins__',
 '__doc__',
 '__loader__',
 '__name__',
 '__package__',
 '__spec__',
 '_dh',
 '_i',
 '_i1',
 '_ih',
 '_ii',
 '_iii',
 '_oh',
 'connectToDB',
 'createOptionParser',
 'exit',
 'get_ipython',
 'importlib',
 'loadConfigurationFile',
 'logging',
 'main',
 'open',
 'os',
 'quit',
 'sys']

todor-ivanov avatar Jun 21 '24 14:06 todor-ivanov