Skip to content

Commit cd7ce8d

Browse files
committed
Update GitLab CI configuration for CMSSW setup and improve proxy handling
1 parent fda8721 commit cd7ce8d

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

episodes/03-gitlabci-setenv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The default user in the runner container is not your username, and the container
120120

121121
#### Steps to Set Up CMSSW
122122

123-
In a typical workflow on LXPLUS, you would run:
123+
In a typical workflow on LXPLUS, you would run (do not run this, this is an example):
124124

125125
```bash
126126
cmssw-el7

episodes/05-gitlabci-vomsproxy.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ cmssw_compile:
292292
- cmsenv
293293
- mkdir -p AnalysisCode
294294
- cp -r $CI_PROJECT_DIR/ZPeakAnalysis AnalysisCode/
295-
- cd ${CMSSW_RELEASE}/src
295+
- cd ${CMSSW_BASE}/src
296296
- scram b -j 4
297297
artifacts:
298298
untracked: true
@@ -301,21 +301,23 @@ cmssw_compile:
301301
- ${CMSSW_RELEASE}
302302
303303
voms_proxy_test:
304-
image:
305-
name: gitlab-registry.cern.ch/cms-cloud/cmssw-docker/cc7-cms:latest
306-
entrypoint: [""]
304+
stage: compile
305+
image: gitlab-registry.cern.ch/cms-cloud/cmssw-docker/al9-cms:latest
307306
tags:
308-
- k8-cvmfs
307+
- k8s-cvmfs
309308
script:
310309
- mkdir -p ${HOME}/.globus
311310
- printf "${GRID_USERCERT}" | base64 -d > ${HOME}/.globus/usercert.pem
312311
- printf "${GRID_USERKEY}" | base64 -d > ${HOME}/.globus/userkey.pem
313312
- chmod 400 ${HOME}/.globus/userkey.pem
314313
- printf "${GRID_PASSWORD}" | base64 -d | voms-proxy-init --voms cms --pwstdin
315314
- voms-proxy-info --all
315+
- export VOMSPROXY=$(voms-proxy-info -path)
316+
- mkdir proxy
317+
- cp ${VOMSPROXY} proxy/x509_proxy
316318
artifacts:
317319
paths:
318-
- /tmp/x509up_u$(id -u)
320+
- proxy
319321
320322
cmssw_run:
321323
needs:
@@ -328,17 +330,22 @@ cmssw_run:
328330
script:
329331
- set +u && source ${CMS_PATH}/cmsset_default.sh; set -u
330332
- export SCRAM_ARCH=${SCRAM_ARCH}
331-
- cd ${CMSSW_RELEASE}/src
333+
- export X509_USER_PROXY=${PWD}/proxy/x509_proxy
334+
- mkdir run
335+
- cp -r ${CMSSW_RELEASE} run/
336+
- chmod -R +w run/${CMSSW_RELEASE}/
337+
- cd run/${CMSSW_RELEASE}/src
332338
- cmsenv
333339
- voms-proxy-info --all
334340
- cd AnalysisCode/ZPeakAnalysis/
335341
- cmsRun test/MyZPeak_cfg.py
342+
#- cmsRun test/MyZPeak_cfg.py inputFiles=root://cms-xrd-global.cern.ch//store/user/cmsdas/2026/short_exercises/cat/datasets/MINIAODSIM/RunIISummer20UL17MiniAODv2-106X_mc2017_realistic_v9-v2/DYJetsToLL_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8/2C5565D7-ADE5-2C40-A0E5-BDFCCF40640E.root #### in case the previous does not work
336343
- ls -l myZPeak.root
337344
artifacts:
338345
untracked: true
339346
expire_in: 1 hour
340347
paths:
341-
- ${CMSSW_RELEASE}/src/AnalysisCode/ZPeakAnalysis/myZPeak.root
348+
- run/${CMSSW_RELEASE}/src/AnalysisCode/ZPeakAnalysis/myZPeak.root
342349
343350
check_events:
344351
needs:
@@ -351,11 +358,14 @@ check_events:
351358
script:
352359
- set +u && source ${CMS_PATH}/cmsset_default.sh; set -u
353360
- export SCRAM_ARCH=${SCRAM_ARCH}
354-
- cd ${CMSSW_RELEASE}/src
361+
- cp -r ${CMSSW_RELEASE} run/
362+
- chmod -R +w run/${CMSSW_RELEASE}/
363+
- cd run/${CMSSW_RELEASE}/src
355364
- cmsenv
356365
- cd AnalysisCode/ZPeakAnalysis/
357-
- python3 test/check_number_events.py --input ${CMSSW_RELEASE}/src/AnalysisCode/ZPeakAnalysis/myZPeak.root
358-
- python3 test/check_cutflows.py number_of_events.txt test/number_of_expected_events.txt
366+
- python test/check_number_events.py --input ${CMSSW_BASE}/src/AnalysisCode/ZPeakAnalysis/myZPeak.root
367+
- python test/check_cutflows.py number_of_events.txt test/number_of_expected_events.txt
368+
359369
```
360370

361371
:::::::::::::

0 commit comments

Comments
 (0)