From 0e0056ce7622b6eed18ff7a848bdbdb057d9356e Mon Sep 17 00:00:00 2001 From: Ming-Yan Date: Tue, 10 Oct 2023 19:44:51 +0200 Subject: [PATCH] ci test --- .github/workflows/ttbar_SL_workflow.yml | 163 ++++++++++++------------ 1 file changed, 84 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ttbar_SL_workflow.yml b/.github/workflows/ttbar_SL_workflow.yml index 0e63a796..a46d0bae 100644 --- a/.github/workflows/ttbar_SL_workflow.yml +++ b/.github/workflows/ttbar_SL_workflow.yml @@ -8,92 +8,97 @@ on: workflow_dispatch: jobs: - build: - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: ["3.8","3.10"] - - defaults: - run: - shell: "bash -l {0}" + + build: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ["3.8","3.10"] + + defaults: + run: + shell: "bash -l {0}" - steps: - - uses: actions/checkout@v2 - - name: update submodules - env: - SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }} - run: | - mkdir $HOME/.ssh - echo "$SSHKEY" > $HOME/.ssh/id_rsa - chmod 600 $HOME/.ssh/id_rsa - echo "HOST *" > ~/.ssh/config - echo "StrictHostKeyChecking no" >> ~/.ssh/config - git submodule update --init --recursive - - uses: cvmfs-contrib/github-action-cvmfs@v2 - with: - cvmfs_repositories: 'grid.cern.ch' + steps: + - uses: actions/checkout@v2 + - name: update submodules + env: + SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }} + run: | + mkdir $HOME/.ssh + echo "$SSHKEY" > $HOME/.ssh/id_rsa + chmod 600 $HOME/.ssh/id_rsa + echo "HOST *" > ~/.ssh/config + echo "StrictHostKeyChecking no" >> ~/.ssh/config + git submodule update --init --recursive + - uses: cvmfs-contrib/github-action-cvmfs@v2 + 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: 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: 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_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 --vomses ${X509_VOMSES} --debug --pwstdin + + - name: Test xrootd + run: | + xrdcp root://eoscms.cern.ch//eos/cms/store/group/phys_btag/nano-commissioning/test_w_dj.root . - - 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_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 --vomses ${X509_VOMSES} --debug --pwstdin - - - name: Test xrootd - run: | - xrdcp root://eoscms.cern.ch//eos/cms/store/group/phys_btag/nano-commissioning/test_w_dj.root . - - - name: Install Repo - run: | - pip install -e . - - - name: btag semileptonic ttbar workflows with correctionlib - run: | - python runner.py --workflow ttsemilep_sf --json metadata/test_bta_run3.json --limit 1 --executor iterative --campaign Summer22Run3 --isSyst all --isArray --overwrite + - name: Install Repo + run: | + pip install -e . - - name: ctag semileptonic muon ttbar workflows with correctionlib + btag_semileptonic_ttbar: + needs: build + name: btag semileptonic ttbar workflows with correctionlib + run: | + python runner.py --workflow ttsemilep_sf --json metadata/test_bta_run3.json --limit 1 --executor iterative --campaign Summer22Run3 --isSyst all --isArray --overwrite + ctag_semileptonic_mu_ttbar: + needs: build + name: ctag semileptonic muon ttbar workflows with correctionlib run: | python runner.py --workflow ctag_ttsemilep_sf --json metadata/test_bta_run3.json --limit 1 --executor iterative --campaign Summer22Run3 --isSyst all --isArray --overwrite - - - name: ctag semileptonic electron ttbar workflows with correctionlib + ctag_semileptonic_e_ttbar: + needs: build + name: ctag semileptonic electron ttbar workflows with correctionlib run: | python runner.py --workflow ectag_ttsemilep_sf --json metadata/test_bta_run3.json --limit 1 --executor iterative --campaign Summer22Run3 --isSyst all --isArray --overwrite