forked from cms-btv-pog/BTVNanoCommissioning
-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (109 loc) · 4.66 KB
/
ttbar_workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: ttbar bSF semileptonic/dileptonic Workflows
on:
push:
branches: [ master ]
paths:
- 'src/BTVNanoCommissioning/workflows/tt*'
- 'src/BTVNanoCommissioning/helpers/update_branch.py'
- 'src/BTVNanoCommissioning/helpers/func.py'
- 'src/BTVNanoCommissioning/helpers/definitions.py'
- 'src/BTVNanoCommissioning/utils/*'
- '.github/workflows/ttbar_workflow.yml'
pull_request_target:
branches: [ master ]
paths:
- 'src/BTVNanoCommissioning/workflows/tt*'
- 'src/BTVNanoCommissioning/helpers/update_branch.py'
- 'src/BTVNanoCommissioning/helpers/func.py'
- 'src/BTVNanoCommissioning/helpers/definitions.py'
- 'src/BTVNanoCommissioning/utils/*'
- '.github/workflows/ttbar_workflow.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
strategy:
max-parallel: 4
matrix:
python-version: ["3.10"]
defaults:
run:
shell: "bash -l {0}"
steps:
- uses: actions/checkout@v2
- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: 'grid.cern.ch'
- name: Set conda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
channels: conda-forge,defaults
channel-priority: true
activate-environment: btv_coffea
environment-file: test_env.yml
auto-activate-base: false
- name: Verify environment
run: |
conda info
conda env list
conda list
- name: Set up proxy
# https://awesome-workshop.github.io/gitlab-cms/03-vomsproxy/index.html
# continue-on-error: true
env:
# To genereate secrets use (strip all \n)
# base64 -i ~/.globus/usercert.pem | awk NF=NF RS= OFS=
# base64 -i ~/.globus/userkey.pem | awk NF=NF RS= OFS=
# Cross check roundtrip by adding ``| base64 -d `` and see if same as input
GRID_USERKEY: ${{ secrets.GRID_USERKEY }}
GRID_USERCERT: ${{ secrets.GRID_USERCERT }}
# Read automatically by voms-proxy-init
X509_VOMS_DIR: /cvmfs/grid.cern.ch/etc/grid-security/vomsdir/
X509_VOMSES: /cvmfs/grid.cern.ch/etc/grid-security/vomses/
X509_CERT_DIR: /cvmfs/grid.cern.ch/etc/grid-security/certificates/
X509_DEFAULT_USER_CERT: $HOME/.globus/usercert.pem
X509_DEFAULT_USER_KEY: $HOME/.globus/userkey.pem
run: |
mkdir $HOME/.globus
printf $GRID_USERKEY | base64 -d > $HOME/.globus/userkey.pem
printf $GRID_USERCERT | base64 -d > $HOME/.globus/usercert.pem
# DEBUG: dump decoded cert, cert is public, but don't dump key!
# base64 -i $HOME/.globus/usercert.pem
chmod 400 $HOME/.globus/userkey.pem
openssl rand -out $HOME/.rnd -hex 256
printf "${{secrets.GRID_PASSWORD}}" | voms-proxy-init --voms cms --debug --pwstdin -certdir $X509_CERT_DIR -vomses $X509_VOMSES
chmod 755 /usr/share/miniconda3/envs/btv_coffea/etc/grid-security/certificates
- name: Install Repo
run: |
pip install -e .
- name: btag semileptonic ttbar workflows
run: |
string=$(git log -1 --pretty=format:'%s')
if [[ $string == *"ci:skip array"* ]]; then
opts=$(echo "$opts" | sed 's/--isArray //g')
fi
if [[ $string == *"ci:skip syst"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all//g')
elif [[ $string == *"ci:JERC_split"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst JERC_split/g')
elif [[ $string == *"ci:weight_only"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst weight_only/g')
fi
python runner.py --workflow ttsemilep_sf --json metadata/test_bta_run3.json --limit 1 --executor iterative --campaign Summer23 --year 2023 $opts
- name: btag dileptonic ttbar workflows
run: |
string=$(git log -1 --pretty=format:'%s')
if [[ $string == *"ci:skip array"* ]]; then
opts=$(echo "$opts" | sed 's/--isArray //g')
fi
if [[ $string == *"ci:skip syst"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all//g')
elif [[ $string == *"ci:JERC_split"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst JERC_split/g')
elif [[ $string == *"ci:weight_only"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst weight_only/g')
fi
python runner.py --workflow ttdilep_sf --json metadata/test_bta_run3.json --limit 1 --executor iterative --campaign Summer23 --year 2023 $opts