Skip to content

How to find logArchive logCollect location for given LFN

Valentin Kuznetsov edited this page Feb 18, 2019 · 4 revisions

Searching for the logArchive or logCollect tar-balls

For setting up environment on CERN analytix node please see this page or scroll down for instructions on lxplus7.

Here is the procedure to find where are the logs for a specific job/LFN. The initial use case is, for instance, give me the logArchive for the job that produced this file /store/unmerged/RunIISummer15wmLHEGS/ST_FCNC-TLL_Tleptonic_kappa_zut-MadGraph5-pythia8/LHE/MCRUN2_71_V1-v1/130000/A685DDD8-5CA1-E611-9020-A0000420FE80.root

  • Then you have to first log in into CERN analytix node or WMArchive node (vocms0182)
  • cd to your working area, e.g.:

/data/user/amaltaro/

  • create a CERN kerberos token with kinit
  • setup the spark/WMArchive environment, see this page for CERN analytix node. On vocms0182 you can do:

source /data/srv/current/apps/wmarchive/etc/profile.d/init.sh

  • construct a json spec file with your query. This query must have the LFN that you are looking for and a time range to be searched. In this case it would be (e.g. lfn.json):

{"spec":{"lfn":"/store/mc/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/9096A6B2-08AD-E611-8969-001E675A5244.root","timerange":[20161101,20161122]}, "fields":[]}

  • finally, run your spark job with the myspark script. Depending on the time range, it can take > 10min.

myspark --script=LogFinder --spec=lfn.json --yarn

In the end, you get an output like

{"logCollect": ["root://castorcms.cern.ch//castor/cern.ch/cms/store/logs/prod/2016/11/WMAgent/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105-LogCollect-cabinet-5-5-6-2-logs.tar"],
"queries": ["/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/EEDD6A05-01AD-E611-B4C7-001E675A6AA9.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/58098F3B-8FAC-E611-BC87-001E67DFF7CB.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/46B86B27-01AD-E611-9A98-001E67E69E32.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/DCFBE0FB-00AD-E611-BD13-001E67DFFF5F.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/689521FA-00AD-E611-A6AB-001E67A404B5.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/549A3202-01AD-E611-A745-001E67A3FE66.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/3CB5DEF8-00AD-E611-A256-001E67A3FC1D.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/969189F9-00AD-E611-82B1-001E67A3F8A8.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/F63804FA-00AD-E611-95A3-001E67A3AEB8.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/C84C5B0D-01AD-E611-877B-001E67A42161.root", 
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/52C56AFB-00AD-E611-ACEC-001E67DFFB4F.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/8C5F11F9-00AD-E611-B3C5-001E675A6653.root",
 "/store/unmerged/RunIISummer16MiniAODv2/DMV_NNPDF30_Vector_Mphi-500_Mchi-200_gSM-0p25_gDM-1p0_v2_13TeV-powheg/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/130000/6CD954F7-00AD-E611-83C6-001E67DDCC81.root",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/40227668-ac52-11e6-9b63-02163e017c3c-0-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/931d89dc-ac4f-11e6-9b63-02163e017c3c-4-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/40227668-ac52-11e6-9b63-02163e017c3c-3-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/1fc3af04-ac52-11e6-9b63-02163e017c3c-5-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/931d89dc-ac4f-11e6-9b63-02163e017c3c-2-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/40227668-ac52-11e6-9b63-02163e017c3c-2-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/931d89dc-ac4f-11e6-9b63-02163e017c3c-0-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/931d89dc-ac4f-11e6-9b63-02163e017c3c-1-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/931d89dc-ac4f-11e6-9b63-02163e017c3c-3-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/40227668-ac52-11e6-9b63-02163e017c3c-1-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/1fc3af04-ac52-11e6-9b63-02163e017c3c-0-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/1fc3af04-ac52-11e6-9b63-02163e017c3c-1-0-logArchive.tar.gz",
 "/store/unmerged/logs/prod/2016/11/17/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/StepOneProc/0000/0/1fc3af04-ac52-11e6-9b63-02163e017c3c-4-0-logArchive.tar.gz"]}

which contains both the logArchive and logCollect tar-balls. To fetch the logCollect or any other logArchive tar-ball we can use xrdcp command, eg.:

xrdcp root://castorcms.cern.ch//castor/cern.ch/cms/store/logs/prod/2016/11/WMAgent/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105/pdmvserv_EXO-RunIISummer16MiniAODv2-00065_00033_v0__161115_160653_2105-LogCollect-cabinet-5-5-6-2-logs.tar .

Instructions how to find LFN log archives on lxplus7

Login to lxplus7 (not to lxplus) and perform the following setup:

ssh lxplus7
# setup environment to access analytix cluster
source /cvmfs/sft.cern.ch/lcg/views/LCG_93/x86_64-centos7-gcc62-opt/setup.sh # this is for centos7 machines
source /cvmfs/sft.cern.ch/lcg/etc/hadoop-confext/hadoop-setconf.sh analytix
# get local copy of WMArchvie code
git clone [email protected]:dmwm/WMArchive.git
# setup WMArchive environment
export PATH=$PWD/WMArchive/bin:$PATH
export PYTHONPATH=$PWD/WMArchive/src/python:$PYTHONPATH

Then create your JSON query with your favorite LFN and time frame to look-up its data on HDFS, then save it in lfn.json file:

{"spec":{"lfn":"/store/mc/RunIIAutumn18DRPremix/ZZTo4L_TuneCP5_13TeV_powheg_pythia8/AODSIM/102X_upgrade2018_realistic_v15_ext2-v2/20002/0C5EC553-7089-1F42-A99E-2B2D935ABF52.root","timerange":[20181001,20181210]},
"fields":[]}

Run spark job:

# always get new kerberos token
kinit [email protected]
# run myspark script with LogFiner workflow and your lfn.json spec
myspark --script=LogFinder --spec=lfn.json --yarn

After job finished (approximately 20-30 min because of wide time-range) you should see the following result:

{"fields": [], "spec": {"query":
["/store/unmerged/logs/prod/2018/12/7/sagarwal_task_HIG-RunIIFall18wmLHEGS-00373__v1_T_181105_193901_1638/HIG-RunIIFall18wmLHEGS-00373_0/HIG-RunIIAutumn18DRPremix-00213_0/HIG-RunIIAutumn18DRPremix-00213_1/0002/0/da05e1c9-b686-43b6-bca3-8a55c3298fc9-4-0-logArchive.tar.gz"],
"timerange": [20181001, 20181210]}, "queries":
["/store/unmerged/logs/prod/2018/12/7/sagarwal_task_HIG-RunIIFall18wmLHEGS-00373__v1_T_181105_193901_1638/HIG-RunIIFall18wmLHEGS-00373_0/HIG-RunIIAutumn18DRPremix-00213_0/HIG-RunIIAutumn18DRPremix-00213_1/0002/0/da05e1c9-b686-43b6-bca3-8a55c3298fc9-4-0-logArchive.tar.gz"]}