The fix in /opt/cms/entrypoint.sh not working/enough in cmssw_10_6_30 to make mkedanlzr work
What happens:
After seeing some runtime problems with the PF Nano example in cmssw_10_6_30-slc7_amd64_gcc700:latest
, I wanted to test the container with something simple, e.g. mkedanlzr
.
Just to report what I see: mkedanlzr
does not work (even with the fix in /opt/cms/entrypoint.sh) in cmssw_10_6_30-slc7_amd64_gcc700:latest
. It an import error: ImportError: No module named FWCore.Skeletons.cms
I can confirm that with cmsenv
, it behaves as on lxplus, i.e. builds the structure but does not give the configuration file (which I believe should be created). I do not know if this is intended but it looks to me that an example without the config file is pretty useless. It may be the whole mkedanlzr
script has been abandoned. It would be a pity.
In any case, for the record, just reporting what I see in the container:
Setting up CMSSW_10_6_30
WARNING: There already exists /code/CMSSW_10_6_30 area for SCRAM_ARCH slc7_amd64_gcc700.
CMSSW should now be available.
This is a standalone image for CMSSW_10_6_30 slc7_amd64_gcc700.
(/code/CMSSW_10_6_30/src) mkdir Test
(/code/CMSSW_10_6_30/src) cd Test
(/code/CMSSW_10_6_30/src/Test) mkedanlzr MiniAnalyzer
Traceback (most recent call last):
File "/cvmfs/cms.cern.ch/slc7_amd64_gcc700/cms/cmssw/CMSSW_10_6_30/bin/slc7_amd64_gcc700/mkedanlzr", line 17, in <module>
from FWCore.Skeletons.cms import generate, config
ImportError: No module named FWCore.Skeletons.cms
(/code/CMSSW_10_6_30/src/Test) cmsenv
(/code/CMSSW_10_6_30/src/Test) mkedanlzr MiniAnalyzer
New package "MiniAnalyzer" of EDAnalyzer type is successfully generated
MiniAnalyzer/
| test/
| |-- BuildFile.xml
| |-- test_catch2_main.cc
| |-- test_catch2_MiniAnalyzer.cc
| plugins/
| |-- BuildFile.xml
| |-- MiniAnalyzer.cc
| python/
Total: 3 directories, 5 files
Background
See cmssw-docker#49 (closed) and https://github.com/cernopendata/data-curation/issues/114
/opt/cms/entrypoint.sh
has a fix for the earlier CMSSW to make mkedanlzr
work. And it indeed made it work for CMSSW_7_2_X.
(/code/CMSSW_10_6_30/src/Test) cat /opt/cms/entrypoint.sh
#!/bin/bash
set -e
cd /code
echo "Setting up ${CMSSW_VERSION}"
source ${CMS_INSTALL_DIR}/cmsset_default.sh
scramv1 project CMSSW ${CMSSW_VERSION}
cd ${CMSSW_VERSION}/src
eval `scramv1 runtime -sh`
echo "CMSSW should now be available."
echo "This is a standalone image for ${CMSSW_VERSION} ${SCRAM_ARCH}."
export LD_LIBRARY_PATH=${UPDATE_PATH}/lib:${UPDATE_PATH}/lib64:${LD_LIBRARY_PATH}
export PATH=${UPDATE_PATH}/bin:${PATH}
export GIT_EXEC_PATH=${UPDATE_PATH}/libexec/git-core
# After CMSSW_6_2_X these steps are needed in order to ensure that
# mkedanlzr works
ver=( $(echo ${CMSSW_VERSION} | tr '_', '\n') )
if [[ ${ver[1]}${ver[2]} -ge 62 ]]
then
if [[ ${CMSSW_VERSION} = *"patch"* ]]
then
BASE_VERSION=$(echo "${CMSSW_VERSION}"| cut -d '_' -f -4);
CMSSW_VERSION=${BASE_VERSION}
fi
sudo sed -i '/import os/a import pwd' ${CMS_INSTALL_DIR}/${SCRAM_ARCH}/cms/cmssw/${CMSSW_VERSION}/python/FWCore/Skeletons/pkg.py
sudo sed -i 's/os.getlogin()/pwd.getpwuid(os.geteuid())[0]/g' ${CMS_INSTALL_DIR}/${SCRAM_ARCH}/cms/cmssw/${CMSSW_VERSION}/python/FWCore/Skeletons/pkg.py
sudo sed -i 's/os.getlogin()/pwd.getpwuid(os.geteuid())[0]/g' ${CMS_INSTALL_DIR}/${SCRAM_ARCH}/cms/cmssw/${CMSSW_VERSION}/python/FWCore/Skeletons/utils.py
fi
exec "$@"
Further checks
Checking in later versions on lxplus e.g. CMSSW_12_0_0, and it behaves as CMSSW_10 i.e. does not create the config file...