From 49e583ee711e79493a07ea493b15fd71741eb142 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Wed, 22 Nov 2023 17:29:35 -0600 Subject: [PATCH] cleanups, first attempt at pages upload --- .github/workflows/autobuild.yml | 61 ++++++++++++++++++++----- .github/workflows/delta-sbatch-slurm.sh | 21 ++++++--- .github/workflows/jobmonitor.sh | 21 ++++++--- 3 files changed, 80 insertions(+), 23 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 93a2e10a27..4887c28c25 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -6,9 +6,10 @@ on: - cron: '15 06 * * *' # UTC 6:15am, corresponds to 00:15 CST or 01:15 CDT push: paths: - # Also run the build when this file gets modified as part of a PR + # Also run the build when these files are modified as part of a PR - '.github/workflows/autobuild.yml' - '.github/workflows/delta-sbatch-slurm.sh' + - '.github/workflows/jobmonitor.sh' # Cancel in progress CI runs when a new run targeting the same PR or branch/tag is triggered. @@ -18,14 +19,20 @@ concurrency: cancel-in-progress: true jobs: - Delta: + delta: timeout-minutes: 60 - runs-on: delta + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + # runs-on: delta + runs-on: ubuntu-latest name: Delta mpi-linux-x86_64 # Could test various builds (e.g., MPI, UCX, ...) via a build matrix steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Host info run: | set -x @@ -36,15 +43,47 @@ jobs: pwd - name: build run: | - set -ex - export target="mpi-linux-x86_64" - .github/workflows/jobmonitor.sh .github/workflows/delta-sbatch-slurm.sh + set -x + # export target="mpi-linux-x86_64" + # .github/workflows/jobmonitor.sh .github/workflows/delta-sbatch-slurm.sh + + echo 0 > result.latest + echo "hello world" > output.latest + + - name: Check out autobuild-logs repo + uses: actions/checkout@v4 + with: + repository: UIUC-PPL/autobuild-logs + token: ${{ secrets.GITHUB_TOKEN }} + path: autobuild-logs + - name: results run: | + set -x + cat result.latest if grep '0' result.latest then - echo "Success" + res="success" else - echo "Failure" - fi - # should also https://github.com/marketplace/actions/send-email \ No newline at end of file + res="failure" + fi + + pwd + echo $res + + cd autobuild-logs + mkdir -p delta/mpi-linux-x86_64 + cd delta/mpi-linux-x86_64 + + cp ../../../output.latest Delta_mpi-linux-x86_64_$(date '+%Y-%m-%dT%H-%M-%S%z')_output_$res.txt + + git config --global user.email "autobuild-logs@charm" + git config --global user.name "Autobuild-logs user" + + git add . + + git commit -m "Autobuild results for delta/mpi-linux-x86_64" + + git push + + # should also https://github.com/marketplace/actions/send-email diff --git a/.github/workflows/delta-sbatch-slurm.sh b/.github/workflows/delta-sbatch-slurm.sh index af954d456e..c2e8974f83 100755 --- a/.github/workflows/delta-sbatch-slurm.sh +++ b/.github/workflows/delta-sbatch-slurm.sh @@ -7,15 +7,24 @@ #SBATCH -J autobuild #SBATCH -p cpu #SBATCH -A mzu-delta-cpu -#cd $indir + set -x + module load libfabric; module load cmake -./build all-test $target --with-production --enable-error-checking -j64 -g -# + +mkdir -p $target + +# ./build all-test $target --with-production --enable-error-checking -j64 -g + cd $target -make -C tests test OPTS="$flags" TESTOPTS="$testopts" $maketestopts -make -C examples test OPTS="$flags" TESTOPTS="$testopts" $maketestopts -make -C benchmarks test OPTS="$flags" TESTOPTS="$testopts" $maketestopts +# make -C tests test OPTS="$flags" TESTOPTS="$testopts" $maketestopts +# make -C examples test OPTS="$flags" TESTOPTS="$testopts" $maketestopts +# make -C benchmarks test OPTS="$flags" TESTOPTS="$testopts" $maketestopts + +# For debugging: +echo "Just 4 debugging" +true + # Save make exit status status=$? echo $status > ../$SLURM_JOBID.result diff --git a/.github/workflows/jobmonitor.sh b/.github/workflows/jobmonitor.sh index f4604a8cae..ce618061f0 100755 --- a/.github/workflows/jobmonitor.sh +++ b/.github/workflows/jobmonitor.sh @@ -10,9 +10,11 @@ End() { $queue_kill $jobid exit $1 } + echo "Submitting batch job for> $target OPTS=$flags" echo " using the command> $queue_qsub $script" chmod 755 $script + while [ -z "$jobid" ] do $queue_qsub $script > .status.$$ 2>&1 @@ -25,12 +27,16 @@ do jobid=`cat .status.$$ | tail -1 | awk '{print $4}'` rm -f .status.$$ done + echo "Job enqueued under job ID $jobid" + export output=$jobid.output export result=$jobid.result + # kill job if interrupted trap 'End 1' 2 3 retry=0 + # Wait for the job to complete, by checking its status while [ true ] do @@ -40,9 +46,9 @@ do #if [[ $exitstatus != 0 || $linecount != 2 ]] if [[ $linecount != 2 ]] then - # The job is done-- print its output + # The job is done-- print its output rm tmp.$$ - # When job hangs, result file does not exist + # When job hangs, result file does not exist test -f $result && status=`cat $result` || status=1 echo "==================================== OUTPUT (STDOUT & STDERR) ========================================" cat $output @@ -57,12 +63,15 @@ do cat $result echo "======================================================================================================" fi - # mv result and output to result.latest - mv $result result.latest - mv $output output.latest + + # mv result and output to result.latest + mv $result result.latest + mv $output output.latest + exit $status fi -# The job is still queued or running-- print status and wait + + # The job is still queued or running-- print status and wait tail -1 tmp.$$ rm tmp.$$ sleep 60