From 3d99bcd9b2d062c90d02770df352c4fb6eb26ef1 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 | 43 ++++++++++++++++++++++--- .github/workflows/delta-sbatch-slurm.sh | 21 ++++++++---- .github/workflows/jobmonitor.sh | 21 ++++++++---- 3 files changed, 68 insertions(+), 17 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 93a2e10a27..a38725f2c7 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,7 +19,7 @@ concurrency: cancel-in-progress: true jobs: - Delta: + delta: timeout-minutes: 60 runs-on: delta @@ -36,15 +37,47 @@ jobs: pwd - name: build run: | - set -ex + set -x export target="mpi-linux-x86_64" .github/workflows/jobmonitor.sh .github/workflows/delta-sbatch-slurm.sh - name: results run: | + set -x + cat result.latest if grep '0' result.latest then echo "Success" else echo "Failure" - fi - # should also https://github.com/marketplace/actions/send-email \ No newline at end of file + fi + + mkdir -p output_html + cp output.latest output_html/Delta_mpi-linux-x86_64_$(date '+%Y-%m-%dT%H-%M-%S%z')_output.txt + ls -l output_html + # should also https://github.com/marketplace/actions/send-email + + - name: Fix permissions + run: | + set -x + ls -l + chmod -vv -c -R +rX output_html/ + ls -l output_html + + - name: Upload artifacts + uses: actions/upload-pages-artifact@v2 + with: + path: 'output_html' + + deploy-pages: + runs-on: ubuntu-latest + needs: delta + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 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