Add support for containers in lb-run
A new command line option in lb-run
allow the command to execute to be wrapped in a container (for the moment only singularity is supported).
Minimal requirements are:
- an accessible installation of the software (e.g.
/cvmfs
) - a usable installation of
LbEnv
- singularity
- (optional) a working
cmt
command for the host (for CMT based projects)
For example, on my Ubuntu 18.10 laptop:
- setup
~$ pip install ... LbEnv
~$ export CMAKE_PREFIX_PATH=/cvmfs/lhcb.cern.ch/lib/lhcb:/cvmfs/lhcb.cern.ch/lib/lcg/releases:/cvmfs/lhcb.cern.ch/lib/lcg/app/releases
~$ export PATH=/cvmfs/lhcb.cern.ch/lib/bin/Linux-x86_64:$PATH
- centos7
~$ lb-run --platform x86_64+avx2+fma-centos7-gcc7-opt LHCb/latest gaudirun.py --option "from DetDescChecks.Options import LoadDDDBTest; LoadDDDBTest('2018')"
ERROR:lb-run:current host does not support platform x86_64+avx2+fma-centos7-gcc7-opt (dirac_platform: x86_64-unknown.avx2+fma, os_id: ubuntu1810)
WARNING:lb-run:you may try adding to the options:
WARNING:lb-run: --container singularity
~$ lb-run --container singularity --platform x86_64+avx2+fma-centos7-gcc7-opt LHCb/latest gaudirun.py --option "from DetDescChecks.Options import LoadDDDBTest; LoadDDDBTest('2018')"
WARNING: Container does not have an exec helper script, calling 'env' directly
# setting LC_ALL to "C"
# applying configuration of DDDBConf
...
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
- slc5
~$ lb-run --container singularity --platform x86_64-slc5-gcc46-opt LHCb/v35r1p3 gaudirun.py --option "from DetDescChecks.Options import LoadDDDBTest; LoadDDDBTest('2012', sim=True)"
WARNING:lb-run:trying old SetupProject (cannot find /cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v23r3/InstallArea/x86_64-slc5-gcc46-opt/manifest.xml)
ALWAYS:SetupProject:Configuring LHCb v35r1p3 from /cvmfs/lhcb.cern.ch/lib/lhcb/LHCB/LHCB_v35r1p3
WARNING: Container does not have an exec helper script, calling 'env' directly
# applying configuration of DDDBConf
...
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
Closes LBCORE-1654
Edited by Marco Clemencic