From 9a4a5386af78b61cea876400521d64eac82cf1c9 Mon Sep 17 00:00:00 2001 From: Lauren Chilutti <60401591+laurenchilutti@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:30:28 -0500 Subject: [PATCH] New CI cloud cluster and support multiple commits on same PR (#304) * Update SHiELD_parallelworks_intel.yml * Update and rename daily_cleanup_parallelworks.yaml to daily_cleanup_parallelworks.yml * Update to cancel in process ci * Update to only run on main repo and not forks --- .../workflows/SHiELD_parallelworks_intel.yml | 35 ++++++++++++------- ...s.yaml => daily_cleanup_parallelworks.yml} | 5 +-- 2 files changed, 25 insertions(+), 15 deletions(-) rename .github/workflows/{daily_cleanup_parallelworks.yaml => daily_cleanup_parallelworks.yml} (70%) diff --git a/.github/workflows/SHiELD_parallelworks_intel.yml b/.github/workflows/SHiELD_parallelworks_intel.yml index d4685a0d0..df1c603c6 100644 --- a/.github/workflows/SHiELD_parallelworks_intel.yml +++ b/.github/workflows/SHiELD_parallelworks_intel.yml @@ -16,21 +16,29 @@ on: # run weekly on Sunday schedule: - cron: '0 0 * * 0' + +#this should cancel in progress ci runs for the same PR +#(e.g. a second commit on the same PR comes in while CI is still running) +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: checkout: - runs-on: [self-hosted, devcimultiintel] + if: github.repository == 'NOAA-GFDL/GFDL_atmos_cubed_sphere' + runs-on: [gfdlacsciintel] name: Checkout Code steps: # It can take a long time (5-15 minutes) to spinup nodes # so this salloc will prompt 46 nodes to startup and stay active for 20 min # this is enough nodes for the first 17 tests to run in parallel, and we # have 17 runners configured. - - run: salloc --partition=p2 -N 46 -J $GITHUB_REF sleep 20m & - - run: /contrib/fv3/GFDL_atmos_cubed_sphere_CI/checkout.sh $GITHUB_REF + - run: salloc --partition=p2 -N 46 -J $GITHUB_SHA sleep 20m & + - run: /contrib/fv3/GFDL_atmos_cubed_sphere_CI/checkout.sh $GITHUB_REF $GITHUB_SHA build: - runs-on: [self-hosted,devcimultiintel] + if: github.repository == 'NOAA-GFDL/GFDL_atmos_cubed_sphere' + runs-on: [gfdlacsciintel] name: SOLO SHiELD build needs: [checkout] strategy: @@ -43,10 +51,11 @@ jobs: - env: RUNPATH: ${{ matrix.runpath }} RUNSCRIPT: ${{ matrix.runscript }} - run: $RUNPATH/$RUNSCRIPT $GITHUB_REF + run: $RUNPATH/$RUNSCRIPT $GITHUB_REF $GITHUB_SHA test: - runs-on: [self-hosted, devcimultiintel] + if: github.repository == 'NOAA-GFDL/GFDL_atmos_cubed_sphere' + runs-on: [gfdlacsciintel] name: SOLO SHiELD test suite needs: [checkout, build] strategy: @@ -97,15 +106,15 @@ jobs: - d96_500m.solo.mtn_schar.sh steps: # This will end the slurm job started in the checkout job - - run: scancel -n $GITHUB_REF + - run: scancel -n $GITHUB_SHA - env: RUNPATH: ${{ matrix.runpath }} RUNSCRIPT: ${{ matrix.runscript }} - run: $RUNPATH/$RUNSCRIPT $GITHUB_REF + run: $RUNPATH/$RUNSCRIPT $GITHUB_REF $GITHUB_SHA shutdown: - runs-on: [self-hosted, devcimultiintel] + if: always() && github.repository == 'NOAA-GFDL/GFDL_atmos_cubed_sphere' + runs-on: [gfdlacsciintel] name: Shutdown Processes - if: always() needs: [checkout, build, test] strategy: fail-fast: false @@ -148,7 +157,7 @@ jobs: - d96_2k.solo.bubble - d96_500m.solo.mtn_schar steps: - - run: scancel -n $GITHUB_REF + - run: scancel -n $GITHUB_SHA - env: - TEST: ${{ matrix.test }} - run: scancel -n $TEST + JOB: ${{ github.sha }}_${{ matrix.test }} + run: scancel -n $JOB diff --git a/.github/workflows/daily_cleanup_parallelworks.yaml b/.github/workflows/daily_cleanup_parallelworks.yml similarity index 70% rename from .github/workflows/daily_cleanup_parallelworks.yaml rename to .github/workflows/daily_cleanup_parallelworks.yml index 33078a97a..7a5dd43ec 100644 --- a/.github/workflows/daily_cleanup_parallelworks.yaml +++ b/.github/workflows/daily_cleanup_parallelworks.yml @@ -1,6 +1,6 @@ name: Old Build Cleanup -# This GitHub Action Workflow is runing on the devcimultiintel cluster +# This GitHub Action Workflow is runing on the GFDL_ACS_CIINTEL cluster # This will delete all build directories older than 30 days # Build directories are on the cloud at /contrib/fv3/2023.2.0 @@ -11,7 +11,8 @@ on: jobs: delete: - runs-on: [self-hosted, devcimultiintel] + if: github.repository == 'NOAA-GFDL/GFDL_atmos_cubed_sphere' + runs-on: [gfdlacsciintel] name: Delete Builds steps: - run: find /contrib/fv3/2023.2.0/GFDL_atmos_cubed_sphere/refs/pull -maxdepth 1 -mindepth 1 -mtime +30 -type d -print -delete