Tevatron inclusive DY #655
Workflow file for this run
This file contains 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
# A single CI script with github workflow. | |
name: Automatic Fit | |
# start job only for PRs when a label is added. | |
on: | |
pull_request: | |
types: [labeled] | |
# some general variables | |
env: | |
N3FIT_MAXNREP: 20 # total number of replicas to fit | |
POSTFIT_NREP: 16 # requested replicas for postfit | |
REFERENCE_SET: NNBOT-06f20cf6a-2024-07-26 # reference set for exact results | |
STABLE_REFERENCE_SET: NNBOT-c0f99b7b3-2024-02-28 # reference set for last tag | |
CONDA_PY: 312 | |
PYTHONHASHSEED: "0" | |
jobs: | |
build: | |
# perform build only if PR has run-fit-bot label | |
if: contains(github.event.pull_request.labels.*.name, 'run-fit-bot') | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.12"] | |
runs-on: ${{ matrix.os }} | |
env: | |
NETRC_FILE: ${{ secrets.NETRC_FILE }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
fetch-depth: 0 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
use-mamba: true | |
channels: https://packages.nnpdf.science/public,conda-forge | |
show-channel-urls: true | |
auto-update-conda: true | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.NNPDF_SSA }} | |
name: id_rsa | |
known_hosts: ${{ secrets.NNPDF_HOSTS_KEY }} | |
- name: Setup conda and install conda-build | |
shell: bash -l {0} | |
run: | | |
echo "$NETRC_FILE" | base64 --decode > ~/.netrc | |
conda install conda-build --yes | |
- name: Build recipe | |
shell: bash -l {0} | |
run: | | |
CONDA_PY=$CONDA_PY conda build --no-test -q conda-recipe | |
# install local build | |
- name: Installing NNPDF conda package | |
shell: bash -l {0} | |
run: | | |
conda update -n base conda | |
conda install -n base conda-libmamba-solver | |
conda config --set solver libmamba | |
conda create -n nnpdfenv -c file:///usr/share/miniconda/envs/test/conda-bld/linux-64/ nnpdf | |
# create fancy runcards | |
- name: Preparing fit runcard | |
run: | | |
# set runcard name | |
export COMMIT=`git rev-parse --short HEAD` | |
export TIMESTAMP=`date --iso-8601` | |
echo "RUNCARD=NNBOT-$COMMIT-$TIMESTAMP" >> $GITHUB_ENV | |
echo "RUNFOLDER=n3fit/runcards/examples" >> $GITHUB_ENV | |
# downloading theory and t0 | |
- name: Downloading requirements | |
shell: bash -l {0} | |
run: | | |
conda activate nnpdfenv | |
cd $RUNFOLDER | |
cp developing.yml $RUNCARD.yml | |
vp-setupfit $RUNCARD.yml | |
# running n3fit replicas | |
- name: Running n3fit | |
shell: bash -l {0} | |
run: | | |
conda activate nnpdfenv | |
cd $RUNFOLDER | |
for ((i=1; i<=$N3FIT_MAXNREP; i+=1)); do n3fit $RUNCARD.yml $i ; done | |
# performing DGLAP | |
- name: Running dglap | |
shell: bash -l {0} | |
run: | | |
conda activate nnpdfenv | |
cd $RUNFOLDER | |
evolven3fit evolve $RUNCARD | |
# running postfit | |
- name: Postfit and upload fit | |
shell: bash -l {0} | |
run: | | |
conda activate nnpdfenv | |
cd $RUNFOLDER | |
postfit $POSTFIT_NREP $RUNCARD | |
res=$(vp-upload $RUNCARD 2>&1) | |
echo ${res} | |
while echo ${res} | grep ERROR >/dev/null | |
do | |
sleep 30s | |
res=$(vp-upload $RUNCARD 2>&1) | |
done | |
url=$( echo "${res}" | grep https ) | |
echo "FIT_URL=$url" >> $GITHUB_ENV | |
# running validphys report | |
- name: Building and upload report | |
shell: bash -l {0} | |
run: | | |
conda activate nnpdfenv | |
vp-comparefits $RUNCARD $REFERENCE_SET \ | |
--title "Automatic check fit $RUNCARD" \ | |
--author bot \ | |
--keywords run-fit-bot \ | |
--thcovmat_if_present | |
url=$(vp-upload output/ 2>&1 | grep https) | |
echo "REPORT_URL=$url" >> $GITHUB_ENV | |
vp-comparefits $RUNCARD $STABLE_REFERENCE_SET \ | |
--title "Automatic check fit $RUNCARD with respect to latest tag" \ | |
--author bot \ | |
--keywords run-fit-bot \ | |
--thcovmat_if_present \ | |
-o tagged_output | |
url=$(vp-upload tagged_output/ 2>&1 | grep https) | |
echo "REPORT_URL_STABLE=$url" >> $GITHUB_ENV | |
# write reminder | |
- name: Write summary on PR | |
uses: unsplash/comment-on-pr@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
msg: | | |
Greetings from your nice fit :robot: ! | |
I have good news for you, I just finished my tasks: | |
- Fit Name: ${{ env.RUNCARD }} | |
- Fit Report wrt master: ${{ env.REPORT_URL }} | |
- Fit Report wrt latest stable reference: ${{ env.REPORT_URL_STABLE }} | |
- Fit Data: ${{ env.FIT_URL }} | |
Check the report **carefully**, and please buy me a :coffee: , or better, a GPU :wink:! |