Skip to content

refactor!: top-level script "qtl" for running all timeline code #1171

refactor!: top-level script "qtl" for running all timeline code

refactor!: top-level script "qtl" for running all timeline code #1171

Workflow file for this run

name: ci
on:
pull_request:
push:
branches:
- main
defaults:
run:
shell: bash
env:
dataset: ci_test
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# build
#############################################################################
build_timeline:
runs-on: ubuntu-latest
container:
image: codecr.jlab.org/hallb/clas12/container-forge/base:latest
options: --user root
steps:
- uses: actions/checkout@v4
- name: build
run: ./install.sh
- name: tar # to preserve any permissions
run: |
tar cavf build_timeline.tar.zst target
- uses: actions/upload-artifact@v4
with:
name: build_timeline
retention-days: 1
path: build_timeline.tar.zst
# download test data
#############################################################################
download_test_data:
runs-on: ubuntu-latest
container:
image: codecr.jlab.org/hallb/clas12/container-forge/base:latest
options: --user root
strategy:
fail-fast: true
matrix:
include:
- { type: detectors, schema: mon }
- { type: physics, schema: dst }
env:
xrootd_file: xroot://sci-xrootd.jlab.org//osgpool/hallb/clas12/validation/recon/${{ matrix.schema }}/validation_files.tar.zst
steps:
- uses: actions/cache@v4
id: cache
with:
key: validation_files_${{ matrix.type }}
path: validation_files.tar.zst
lookup-only: true
- name: download
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: xrdcp ${{ env.xrootd_file }} ./
- run: ls -lh .
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
# monitoring
#############################################################################
run_monitoring:
needs:
- build_timeline
- download_test_data
runs-on: ubuntu-latest
container:
image: codecr.jlab.org/hallb/clas12/container-forge/base:latest
options: --user root
strategy:
fail-fast: false
matrix:
type: [ detectors, physics ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
key: validation_files_${{ matrix.type }}
path: validation_files.tar.zst
- name: download timeline build
uses: actions/download-artifact@v4
with:
name: build_timeline
- name: untar
run: ls *.tar.zst | xargs -I{} tar xavf {}
- run: tree
- name: run monitoring
run: bin/qtl histogram -d ${{env.dataset}} --findhipo --series --focus-${{matrix.type}} validation_files
- run: tree slurm
- run: tree outfiles
- uses: actions/upload-artifact@v4
with:
name: slurm_${{ matrix.type }}
retention-days: 1
path: slurm
- uses: actions/upload-artifact@v4
with:
name: outfiles_monitoring_${{ matrix.type }}
retention-days: 14
path: outfiles
test_swifjob:
needs:
- build_timeline
- download_test_data
runs-on: ubuntu-latest
container:
image: codecr.jlab.org/hallb/clas12/container-forge/base:latest
options: --user root
strategy:
fail-fast: false
matrix:
type: [ detectors, physics ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
key: validation_files_${{ matrix.type }}
path: validation_files.tar.zst
- name: download timeline build
uses: actions/download-artifact@v4
with:
name: build_timeline
- name: untar
run: ls *.tar.zst | xargs -I{} tar xavf {}
- run: tree
- name: test monitoring swifjob
run: |
single_rundir=$(find validation_files -mindepth 1 -maxdepth 1 -type d | head -n1)
echo "single_rundir = $single_rundir"
util/test-swifjob.sh $single_rundir runner --focus-${{ matrix.type }}
- run: tree runner
# timeline production
#############################################################################
run_timelines:
needs:
- run_monitoring
runs-on: ubuntu-latest
container:
image: codecr.jlab.org/hallb/clas12/container-forge/base:latest
options: --user root
strategy:
fail-fast: false
matrix:
include:
- { type: detectors, run_script: 'bin/qtl analysis', args: '-n 4 --skip-mya' }
- { type: physics, run_script: 'bin/run-physics-timelines.sh', args: '' }
steps:
- uses: actions/checkout@v4
- name: download outfiles
uses: actions/download-artifact@v4
with:
pattern: outfiles_*
merge-multiple: true
path: outfiles
- name: download timeline build
uses: actions/download-artifact@v4
with:
name: build_timeline
- name: untar
run: ls *.tar.zst | xargs -I{} tar xavf {}
- run: tree
- name: run timelines
run: ${{matrix.run_script}} -d ${{env.dataset}} ${{matrix.args}}
- run: tree outfiles
- uses: actions/upload-artifact@v4
with:
name: outfiles_timelines_${{ matrix.type }}
retention-days: 14
path: outfiles
# timeline deployment
#############################################################################
deploy_timelines:
name: Deployment
needs:
- run_timelines
runs-on: ubuntu-latest
container:
image: codecr.jlab.org/hallb/clas12/container-forge/base:latest
options: --user root
steps:
- uses: actions/checkout@v4
- name: download outfiles
uses: actions/download-artifact@v4
with:
pattern: outfiles_*
merge-multiple: true
path: outfiles
- name: download timeline build
uses: actions/download-artifact@v4
with:
name: build_timeline
- name: untar
run: ls *.tar.zst | xargs -I{} tar xavf {}
- name: tree outfiles
run: |
rm -r outfiles/${{ env.dataset }}/log
echo "# Output File Tree" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
tree outfiles | xargs -0 -I{} echo {} >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: deploy
run: bin/qtl deploy -d ${{env.dataset}} -c -t web
- uses: actions/upload-artifact@v4
with:
name: web
retention-days: 14
path: web