Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: CI for compilation #37

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b4130f5
initial commit
CollinKa Mar 22, 2024
3426715
allow CI workflow to work
CollinKa Mar 22, 2024
bda8d59
push CI test
CollinKa Mar 22, 2024
991549b
Update pushAction.yml
CollinKa Mar 22, 2024
f65cc77
create main.yml that attempt to access cvmfs
CollinKa Mar 25, 2024
b914c39
remove useless files
CollinKa Apr 1, 2024
371eaea
Create .gitlab-ci.yml
CollinKa Apr 1, 2024
4cab327
Update .gitlab-ci.yml
CollinKa Apr 2, 2024
1d5b94b
add directory to run CI tests
carriganm95 Apr 5, 2024
d1add0f
Update run.sh
carriganm95 Apr 5, 2024
391e4ea
check run.sh
CollinKa Apr 6, 2024
0803dc9
debig
CollinKa Apr 6, 2024
8c1dd18
DisaapTrks checkout CI
CollinKa Apr 6, 2024
3d3c5dd
change the path so It works in CI
CollinKa Apr 6, 2024
3073e2f
create extra stages
CollinKa Apr 7, 2024
36b2420
Update .gitlab-ci.yml
CollinKa Apr 8, 2024
774faa3
Update run.sh
CollinKa Apr 11, 2024
95cbc0b
WIP: Update .gitlab-ci.yml for debug
CollinKa Apr 11, 2024
f849c48
Update .gitlab-ci.yml
CollinKa Apr 11, 2024
f38e28d
Update run.sh
CollinKa Apr 11, 2024
3ac9794
update
CollinKa Apr 11, 2024
5fc86c2
update ci
CollinKa Apr 11, 2024
64a57dd
check crab env
CollinKa Apr 11, 2024
2c4923c
Update .gitlab-ci.yml
CollinKa Apr 11, 2024
760e66a
test with /data/users/mjoyce/Skim/Muon_2022F/7e90e65b-10b7-40f0-8d8e-…
CollinKa Aug 1, 2024
c2c8a76
fix .gitlab-ci.yml
CollinKa Aug 1, 2024
12d0520
comment out all "yum install "
CollinKa Aug 6, 2024
2f4bbbf
change CMSSW_version and SCRAM_ARCH
CollinKa Aug 6, 2024
6f646cc
relax the limit of file descriptors to make yum back to work
CollinKa Aug 7, 2024
11be7e3
ulimit -n 1024
CollinKa Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*_C_ACLiC_dict_rdict.pcm
*~
.*
!.github/
__init__.py
hist.root
crab.log
62 changes: 62 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
image: gitlab-registry.cern.ch/ci-tools/ci-worker:cc7

stages:
- cmssw_setup
- test




variables:
CMSSW_VERSION: "CMSSW_13_3_2" # CMSSW version being used.
SCRAM_ARCH: "el8_amd64_gcc12"
CMS_PATH: "/cvmfs/cms.cern.ch/"

before_script: # Commands run before all stages
# python 3 installation not needed if running on private "runner" computer
# python 3 needed for CMSSW 12 https://hypernews.cern.ch/HyperNews/CMS/get/comp-ops/5318.html
- ulimit -n 1024
- yum install -y python3
- yum install -y libXpm # Just needed to create histograms from ROOT TTree.
- source $CMS_PATH/cmsset_default.sh
- shopt -s expand_aliases # Allows aliases like cmsenv to be used.
#- yum install -y openssl-devel #used to do CMSSW setup


cmssw_setup:
tags:
- cvmfs
variables:
# This is also set on LXPLUS
CMS_PATH: /cvmfs/cms.cern.ch/
script:

# IMPORTANT: Expand aliases in noninteractive bash mode
# Otherwise cmsrel and cmsenv won't work
- shopt -s expand_aliases
# access CVMFS
- set +u && source ${CMS_PATH}/cmsset_default.sh; set -u
- cmsrel CMSSW_13_3_2
- cd CMSSW_13_3_2/src
- cmsenv
- git config --global user.name "Boris Johnson"
- git config --global user.github Boris
- git config --global user.email "[email protected]"
- git-cms-init
- git cms-addpkg IOPool/Input
- sed -i '/assert(readEventSucceeded)/s/^/\/\//' IOPool/Input/src/PoolSource.cc
- git clone https://github.com/OSU-CMS/DisappTrksML.git
- git clone https://github.com/OSU-CMS/DisappTrks.git
- git clone https://github.com/OSU-CMS/OSUT3Analysis.git
- OSUT3Analysis/AnaTools/scripts/setupFramework.py -f MINI_AOD_2022 -c DisappTrks/StandardAnalysis/interface/CustomDataFormat.h
- scramv1 b -j 9

test:
script:
- cd DisappTrks
- git checkout CI
- cd ..
- ls DisappTrks
- ls DisappTrks/CITests/
- bash DisappTrks/CITests/run.sh

54 changes: 54 additions & 0 deletions CITests/condor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash

(>&2 echo "Starting job on " `date`) # Date/time of start of job
(>&2 echo "Running on: `uname -a`") # Condor job is running on this node
(>&2 echo "System software: `cat /etc/redhat-release`") # Operating System on that node

Process=$4
RunStatus=1
CopyStatus=1
RemoveStatus=1

source /cvmfs/cms.cern.ch/cmsset_default.sh
source /cvmfs/cms.cern.ch/crab3/crab.sh
tar -xzf CMSSW_12_4_11_patch3.tar.gz
rm -f CMSSW_12_4_11_patch3.tar.gz
SCRAM_ARCH=slc7_amd64_gcc10
cd CMSSW_12_4_11_patch3/src/
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cvmfs/cms.cern.ch/slc7_amd64_gcc10/cms/cmssw-patch/CMSSW_12_4_11_patch3/external/slc7_amd64_gcc10/lib
echo $LD_LIBRARY_PATH
echo $CMSSW_BASE
echo $PWD
scram b ProjectRename
eval `scramv1 runtime -sh`
echo $CMSSW_BASE
cd -

PYTHONPATH=$PYTHONPATH:./CMSSW_12_4_11_patch3/python:.

python3 /share/scratch0/mcarrigan/disTracksML/CMSSW_12_4_11_patch3/src/OSUT3Analysis/DBTools/python/getSiblings.py -f $6 -s /EGamma/Run2022F-EXODisappTrk-PromptReco-v1/AOD -t $3 -j $4 -m 1000
(>&2 echo "Arguments passed to this script are: $@")
/cvmfs/cms.cern.ch/slc7_amd64_gcc10/cms/cmssw/CMSSW_12_4_11/bin/slc7_amd64_gcc10/cmsRun $@
RunStatus=$?
if [ $RunStatus -ne 0 ]
then
exit $RunStatus
fi

i=0
while [ $CopyStatus -ne 0 ] && [ $i -lt 10 ]
do
ls hist_${Process}.root eventList_${Process}.txt | sed "s/^/\/data\/users\/mcarrigan\/condor\/EGamma_2022\/EGamma_2022F_test3\/EGamma_2022F\//g" | xargs rm -rf
ls VertexCutOnly/* | sed "s/^VertexCutOnly\//\/data\/users\/mcarrigan\/condor\/EGamma_2022\/EGamma_2022F_test3\/EGamma_2022F\/VertexCutOnly\//g" | xargs rm -rf
sleep 10
cp -rf hist_${Process}.root eventList_${Process}.txt /data/users/mcarrigan/condor/EGamma_2022/EGamma_2022F_test3/EGamma_2022F/ &&
cp -rf VertexCutOnly/* /data/users/mcarrigan/condor/EGamma_2022/EGamma_2022F_test3/EGamma_2022F/VertexCutOnly/
CopyStatus=$?
i=`expr $i + 1`
done

rm -rf hist_${Process}.root eventList_${Process}.txt VertexCutOnly CMSSW_12_4_11_patch3
RemoveStatus=$?

[ $i -eq 10 ] && exit 999
exit 0
41 changes: 41 additions & 0 deletions CITests/config_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import FWCore.ParameterSet.Config as cms
import OSUT3Analysis.DBTools.osusub_cfg as osusub
osusub.randomNumberSuffix = 1710338174
import re
import os
import userConfig_EGamma_2022F_cfg as pset
import FWCore.PythonUtilities.LumiList as LumiList
myLumis = LumiList.LumiList(filename = 'Cert_Collisions2022_355100_362760_Golden.json').getCMSSWString().split(',')

fileName = 'hist_' + str (osusub.jobNumber) + '.root'
pset.process.TFileService.fileName = fileName
pset.process.VertexCutOnlyPlotter.weights = cms.VPSet()
pset.process.PUScalingFactorProducer.dataset = cms.string("MuonEG_2015D")

pset.process.source.fileNames = cms.untracked.vstring (osusub.runList)
pset.process.source.secondaryFileNames = cms.untracked.vstring (osusub.secondaryRunList)
pset.process.source.lumisToProcess = cms.untracked.VLuminosityBlockRange()
pset.process.source.lumisToProcess.extend(myLumis)
pset.process.source.skipBadFiles = cms.untracked.bool (True)
pset.process.maxEvents.input = cms.untracked.int32 (1000)

siblings = []
if osusub.batchMode:
try:
if os.path.exists('default.json'):
siblings.extend(osusub.getSiblingList("default.json", osusub.runList, "/EGamma/Run2022F-EXODisappTrk-PromptReco-v1/AOD"))
else:
for fileName in osusub.runList:
siblings.extend (osusub.getRun3SkimSiblings (fileName, "/EGamma/Run2022F-EXODisappTrk-PromptReco-v1/AOD"))
except:
print( "No valid grid proxy. Not adding sibling files.")
pset.process.source.secondaryFileNames.extend(siblings)


if hasattr(osusub, "eventMask"):
try:
eventRange = cms.untracked.VEventRange(osusub.eventMask)
pset.process.source.eventsToProcess = eventRange
except Exception as e:
print("Error", e)
process = pset.process
Loading