Skip to content

Commit

Permalink
Merge branch 'develop' into feature/interval
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterKolczynski-NOAA authored Oct 17, 2024
2 parents e197638 + 77edb05 commit 2b6c45d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: gw-ci-orion
name: gw-ci-aws-centos

on: [workflow_dispatch]

Expand All @@ -15,72 +15,75 @@ on: [workflow_dispatch]
# └── ${pslot}
env:
TEST_DIR: ${{ github.workspace }}/${{ github.run_id }}
MACHINE_ID: orion
MACHINE_ID: noaacloud

jobs:
checkout-build-link:
runs-on: [self-hosted, orion-ready]
checkout:
runs-on: [self-hosted, aws, parallelworks, centos]
timeout-minutes: 600

steps:

- name: Checkout global-workflow
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ github.run_id }}/HOMEgfs # This path needs to be relative
path: ${{ github.run_id }}/HOMEgfs
submodules: 'recursive'
ref: ${{ github.event.pull_request.head.ref }}

- name: Checkout components
run: |
cd ${{ env.TEST_DIR }}/HOMEgfs/sorc
./checkout.sh -c -g # Options e.g. -u can be added late
build-link:
runs-on: [self-hosted, aws, parallelworks, centos]
needs: checkout

steps:

- name: Build components
run: |
cd ${{ env.TEST_DIR }}/HOMEgfs/sorc
./build_all.sh
./build_all.sh -j 8
- name: Link artifacts
run: |
cd ${{ env.TEST_DIR }}/HOMEgfs/sorc
./link_workflow.sh
create-experiments:
needs: checkout-build-link
runs-on: [self-hosted, orion-ready]
needs: checkout
runs-on: [self-hosted, aws, parallelworks, centos]
strategy:
matrix:
case: ["C48_S2S", "C96_atm3DVar"]
case: ["C48_ATM"]

steps:
- name: Create Experiments ${{ matrix.case }}
env:
HOMEgfs_PR: ${{ env.TEST_DIR }}/HOMEgfs
RUNTESTS: ${{ env.TEST_DIR }}/RUNTESTS
pslot: ${{ matrix.case }}.${{ github.run_id }}
run: |
mkdir -p ${{ env.RUNTESTS }}
cd ${{ env.TEST_DIR }}/HOMEgfs
source workflow/gw_setup.sh
source ci/platforms/orion.sh
./ci/scripts/create_experiment.py --yaml ci/cases/${{ matrix.case }}.yaml --dir ${{ env.HOMEgfs_PR }}
source ci/platforms/config.noaacloud
./workflow/create_experiment.py --yaml ci/cases/pr/${{ matrix.case }}.yaml --overwrite
run-experiments:
needs: create-experiments
runs-on: [self-hosted, orion-ready]
runs-on: [self-hosted, aws, parallelworks, centos]
strategy:
max-parallel: 2
matrix:
case: ["C48_S2S", "C96_atm3DVar"]
case: ["C48_ATM"]
steps:
- name: Run Experiment ${{ matrix.case }}
run: |
cd ${{ env.TEST_DIR }}/HOMEgfs
./ci/scripts/run-check_ci.sh ${{ env.TEST_DIR }} ${{ matrix.case }}.${{ github.run_id }}
./ci/scripts/run-check_ci.sh ${{ env.TEST_DIR }} ${{ matrix.case }}.${{ github.run_id }} HOMEgfs
clean-up:
needs: run-experiments
runs-on: [self-hosted, orion-ready]
runs-on: [self-hosted, aws, parallelworks, centos]
steps:
- name: Clean-up
run: |
cd ${{ github.workspace }}
rm -rf ${{ github.run_id }}
5 changes: 5 additions & 0 deletions ci/scripts/utils/parallel_works/UserBootstrap_centos7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sudo yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
sudo yum -y install git
/contrib/Terry.McGuinness/SETUP/provision_runner.sh
ALLNODES
/contrib/Terry.McGuinness/SETUP/mount-epic-contrib.sh
39 changes: 39 additions & 0 deletions ci/scripts/utils/parallel_works/provision_runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# This script provisions a GitHub Actions runner on a Rocky or CentOS system.
# It performs the following steps:
# 1. Checks the operating system from /etc/os-release.
# 2. Verifies if the operating system is either Rocky or CentOS.
# 3. Checks if an actions-runner process is already running for the current user.
# 4. Copies the actions-runner tar file from a specified directory to the home directory.
# 5. Extracts the tar file and starts the actions-runner in the background.
#
# The actions-runner tar file contains the necessary binaries and scripts to run
# a GitHub Actions runner. It is specific to the operating system and is expected
# to be located in the /contrib/${CI_USER}/SETUP/ directory.

CI_USER="Terry.McGuinness"

# Get the Operating System name from /etc/os-release
OS_NAME=$(grep -E '^ID=' /etc/os-release | sed -E 's/ID="?([^"]*)"?/\1/') || true

# Check if the OS is Rocky or CentOS
if [[ "${OS_NAME}" == "rocky" || "${OS_NAME}" == "centos" ]]; then
echo "Operating System is ${OS_NAME}"
else
echo "Unsupported Operating System: ${OS_NAME}"
exit 1
fi

running=$(pgrep -u "${USER}" run-helper -c) || true
if [[ "${running}" -gt 0 ]]; then
echo "actions-runner is already running"
exit
fi

cp "/contrib/${CI_USER}/SETUP/actions-runner_${OS_NAME}.tar.gz" "${HOME}"
cd "${HOME}" || exit
tar -xf "actions-runner_${OS_NAME}.tar.gz"
cd actions-runner || exit
d=$(date +%Y-%m-%d-%H:%M)
nohup ./run.sh >& "run_nohup${d}.log" &

0 comments on commit 2b6c45d

Please sign in to comment.