glideinWMS / glideinwms

The glideinWMS Project
http://tinyurl.com/glideinwms
Apache License 2.0
16 stars 45 forks source link

Avoid invocation of cvmfsexec distros building if not necessary #309

Closed mmascher closed 1 year ago

mmascher commented 1 year ago

As identified in #308, this PR brings in a change to the existing use of subprocess module (via the GWMS subprocessSupport module) for efficiency purposes.

Currently, the subprocessSupport module is used to execute /usr/bin/create_cvmfsexec_distros.sh always, regardless of whether cvmfsexec distributions are required to be built or rebuilt. If CVMFS is not needed and the cvmfsexec_distro tag is not defined in the factory configuration (disabled mode), then calling subprocessSupport to execute the script is basically unnecessary. Additionally, since subprocess spawns a new process to execute the script, this might result in a memory-intensive operation in a production setting.

namrathaurs commented 1 year ago

@mmascher Upon reviewing this PR, I realized that the suggestion you made to cgWParamDict.py can be modified such that the invocation of /usr/bin/create_cvmfsexec_distros.sh can be added to the existing if cfgs: condition, which is right after the lines corresponding to the invocation of subprocessSupport.iexe_cmd, instead of adding an extra if condition. I modified accordingly and added a message to inform the user about the building/rebuilding being disabled since that was previously being handled inside the create_cvmfsexec_distros.sh script. I also modified the description you had originally added to the list of Bug Fixes in the CHANGELOG file.

Thanks for catching this as well as sharing your suggestions for improvement!