WIP: QG scale factor workflows #612
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ctag W+c Workflow | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - 'src/BTVNanoCommissioning/workflows/ctag_*Wc*' | |
| - 'src/BTVNanoCommissioning/helpers/update_branch.py' | |
| - 'src/BTVNanoCommissioning/helpers/func.py' | |
| - 'src/BTVNanoCommissioning/helpers/definitions.py' | |
| - 'src/BTVNanoCommissioning/utils/*' | |
| - '.github/workflows/ctag_Wc_workflow.yml' | |
| - 'runner.py' | |
| pull_request_target: | |
| branches: [ master ] | |
| paths: | |
| - 'src/BTVNanoCommissioning/workflows/ctag_*Wc*' | |
| - 'src/BTVNanoCommissioning/helpers/update_branch.py' | |
| - 'src/BTVNanoCommissioning/helpers/func.py' | |
| - 'src/BTVNanoCommissioning/helpers/definitions.py' | |
| - 'src/BTVNanoCommissioning/utils/*' | |
| - '.github/workflows/ctag_Wc_workflow.yml' | |
| - 'runner.py' | |
| 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@v4 | |
| - name: Merge PR locally | |
| if: github.event_name == 'pull_request_target' | |
| id: merge | |
| continue-on-error: true | |
| run: | | |
| git fetch origin pull/${{ github.event.pull_request.number }}/head:MR | |
| git checkout -b ATTEMPT_MERGE | |
| git merge MR | |
| git branch -vv | |
| git remote -v | |
| git diff master | |
| - uses: cvmfs-contrib/github-action-cvmfs@v4 | |
| with: | |
| cvmfs_repositories: 'grid.cern.ch' | |
| - name: Set conda environment | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| 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: | | |
| sudo apt-get update | |
| sudo apt-get install fetch-crl ca-certificates | |
| # Set up user certificates | |
| mkdir -p $HOME/.globus | |
| printf "$GRID_USERKEY" | base64 -d > $HOME/.globus/userkey.pem | |
| printf "$GRID_USERCERT" | base64 -d > $HOME/.globus/usercert.pem | |
| # Set proper permissions | |
| chmod 400 $HOME/.globus/userkey.pem | |
| chmod 644 $HOME/.globus/usercert.pem | |
| # Generate random seed | |
| openssl rand -out $HOME/.rnd -hex 256 | |
| # Create VOMS proxy with --ignorewarn to handle CRL issues | |
| printf "${{secrets.GRID_PASSWORD}}" | voms-proxy-init \ | |
| --voms cms \ | |
| --pwstdin \ | |
| -certdir /cvmfs/grid.cern.ch/etc/grid-security/certificates/ \ | |
| -vomses $X509_VOMSES \ | |
| --valid 12:00 \ | |
| --ignorewarn | |
| # Verify proxy was created | |
| voms-proxy-info -all | |
| - name: Install Repo | |
| run: | | |
| pip install -e . | |
| - name: ctag muon W+c 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 ctag_Wc_sf --json metadata/test_bta_run3.json --executor iterative --campaign Summer23 --year 2023 $opts --isSyst all --isArray | |
| - name: ctag electron W+c workflows | |
| run: | | |
| message=$(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 ectag_Wc_sf --json metadata/test_bta_run3.json --executor iterative --overwrite --campaign Summer23 --year 2023 $opts --isSyst all --isArray | |
| - name: ctag muon W+c fixed WP workflows with correctionlib | |
| 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 ctag_Wc_WP_sf --json metadata/test_bta_run3.json --executor iterative --overwrite --campaign Summer23 --year 2023 $opts --isSyst all | |
| - name: ctag electron W+c fixed WP workflows with correctionlib | |
| run: | | |
| message=$(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 ectag_Wc_WP_sf --json metadata/test_bta_run3.json --executor iterative --overwrite --campaign Summer23 --year 2023 $opts --isSyst all |