Back to home page

EIC code displayed by LXR

 
 

    


Warning, /detector_benchmarks/benchmarks/lowq2_reconstruction/config.yml is written in an unsupported language. File is not indexed.

0001 sim:lowq2_reconstruction:
0002   extends: .det_benchmark
0003   stage: simulate
0004   script:
0005     - |
0006       snakemake $SNAKEMAKE_FLAGS --cores $MAX_CORES_PER_JOB \
0007         sim_output/lowq2_reconstruction/Low-Q2_Training_SimEvents_local.edm4hep.root \
0008 
0009 bench:lowq2_reconstruction:
0010   extends: .det_benchmark
0011   stage: benchmarks
0012   needs:
0013     - ["sim:lowq2_reconstruction","bench:beamline"]
0014   script:
0015     - snakemake $SNAKEMAKE_FLAGS --cores $MAX_CORES_PER_JOB lowq2_reconstruction_local
0016 
0017 check:lowq2_reconstruction:
0018   needs: ["bench:lowq2_reconstruction"]
0019   stage: benchmarks
0020   script: |
0021     if grep '"fail": 1' results/lowq2_reconstruction/test_local/Low-Q2_test_Resolution_Results_local.json; then
0022       exit 1
0023     fi
0024 
0025 bench:lowq2_reconstruction_retrained:
0026   extends: .det_benchmark
0027   stage: benchmarks
0028   needs:
0029     - ["bench:lowq2_reconstruction","check:lowq2_reconstruction"]    
0030   rules:
0031     - if: '$BENCHMARKS_TAG =~ /nightly/'
0032       when: on_failure
0033     - when: never
0034   script:
0035     - export PYTHONUSERBASE=$LOCAL_DATA_PATH/deps
0036     - pip install -r benchmarks/lowq2_reconstruction/requirements.txt
0037     - snakemake $SNAKEMAKE_FLAGS --cores $MAX_CORES_PER_JOB lowq2_reconstruction_retrained
0038 
0039 check:lowq2_reconstruction_retrained:
0040   needs: ["bench:lowq2_reconstruction_retrained"]
0041   stage: benchmarks
0042   rules:
0043     - if: '$BENCHMARKS_TAG =~ /nightly/'
0044       when: on_success
0045     - when: never  
0046   script: |
0047     if grep '"fail": 1' results/lowq2_reconstruction/retrained_local/Low-Q2_retrained_Resolution_Results_local.json; then
0048       exit 1
0049     fi
0050 
0051 collect_results:lowq2_reconstruction:
0052   extends: .det_benchmark
0053   stage: collect
0054   needs:
0055     - "bench:lowq2_reconstruction"
0056   script:
0057     - ls -lrht
0058     - mv results{,_save}/ # move results directory out of the way to preserve it
0059     - snakemake $SNAKEMAKE_FLAGS --cores 1 --delete-all-output lowq2_reconstruction_local
0060     - mv results{_save,}/
0061 
0062 collect_results:lowq2_reconstruction_retrained:
0063   extends: .det_benchmark
0064   stage: collect
0065   needs:
0066     - "bench:lowq2_reconstruction_retrained"
0067   rules:
0068     - if: '$BENCHMARKS_TAG =~ /nightly/'
0069       when: on_success
0070     - when: never
0071   script:
0072     - ls -lrht
0073     - mv results{,_save}/ # move results directory out of the way to preserve it
0074     - snakemake $SNAKEMAKE_FLAGS --cores 1 --delete-all-output lowq2_reconstruction_retrained
0075     - mv results{_save,}/
0076 
0077 upload_onnx:lowq2_reconstruction:
0078   extends: .det_benchmark
0079   stage: deploy
0080   needs:
0081     - "check:lowq2_reconstruction_retrained"
0082   rules:
0083     - if: '$BENCHMARKS_TAG =~ /nightly/ && $GITHUB_PR != "" && $GITHUB_REPOSITORY == "eic/epic"'
0084       when: on_success
0085     - if: '$GITHUB_REPOSITORY != "eic/epic"'
0086       when: never
0087   script:
0088     - echo "Deploying lowq2_onnx file to xrootd server"
0089     - LOWQ2_ONNX_FILE=results/lowq2_reconstruction/retrained_local/Low-Q2_Steering_Reconstruction_Test_local.onnx
0090     - if [ -f $LOWQ2_ONNX_FILE ]; then
0091         echo "File $LOWQ2_ONNX_FILE exists, calculating hash";
0092         ONNX_HASH=$(sha256sum $LOWQ2_ONNX_FILE | cut -d' ' -f1);
0093         echo "ONNX file hash = $ONNX_HASH";
0094       else
0095         echo "File $LOWQ2_ONNX_FILE does not exist, deployment failed";
0096         exit 1;
0097       fi
0098     - XROOTD_ENDPOINT="root://dtn-eic.jlab.org/"
0099     - XROOTD_CALIB_PREFIX="/volatile/eic/EPIC/xrdtest/CALIB/"
0100     - ONNX_UPLOAD_URL="$OSDF_ENDPOINT$OSDF_CALIB_OUTPUT_PREFIX/$ONNX_HASH/Low-Q2_Steering_Reconstruction.onnx"
0101     - ONNX_DOWNLOAD_URL="$XROOTD_ENDPOINT$XROOTD_CALIB_PREFIX/$ONNX_HASH/Low-Q2_Steering_Reconstruction.onnx"
0102     - echo "Deploying to xrootd server using pelican"
0103     - echo "ONNX file will be available at $ONNX_UPLOAD_URL"
0104     - wget https://dl.pelicanplatform.org/7.13.0/pelican_Linux_x86_64.tar.gz
0105     - sha256sum -c <(echo '38ac8548c67302299e50a1b81c159ed418e90d84a6606ddd377fd2c8b164d114  pelican_Linux_x86_64.tar.gz')
0106     - tar zxf pelican_Linux_x86_64.tar.gz
0107     - ./pelican-*/pelican object copy $LOWQ2_ONNX_FILE $ONNX_UPLOAD_URL
0108     - xrdfs $XROOTD_ENDPOINT stat $XROOTD_CALIB_PREFIX/$ONNX_HASH/Low-Q2_Steering_Reconstruction.onnx
0109     - |
0110       # Build artifact folder URL for review
0111       ARTIFACTS_URL="${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/browse/results/lowq2_reconstruction/"
0112       echo "Artifacts URL: $ARTIFACTS_URL"
0113     - echo "Updating PR with lowq2 reconstruction results"
0114     - |
0115       python benchmarks/lowq2_reconstruction/makePRSuggestion.py \
0116       --pr $GITHUB_PR \
0117       --newURL "$ONNX_DOWNLOAD_URL" \
0118       --githubToken $GITHUB_REPO_POST_COMMENT \
0119       --calibrationFile calibrations/onnx/Low-Q2_Steering_Reconstruction.onnx \
0120       --xml compact/calibrations.xml \
0121       --repository $GITHUB_REPOSITORY \
0122       --artifactsURL "$ARTIFACTS_URL"
0123     - echo "Updating GitHub status for lowq2 reconstruction"
0124