Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions Pipeline Updates for Self-Hosted Runners on PW #3018

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
db07596
added dynamicaly creating branches from PRs
TerryMcGuinness-NOAA Oct 17, 2024
54a6a5f
clean up needed steps
TerryMcGuinness-NOAA Oct 17, 2024
538eaad
missed indentation on clean up for script bit
TerryMcGuinness-NOAA Oct 17, 2024
f70c3e9
here we print and pass the list of PRs
TerryMcGuinness-NOAA Oct 17, 2024
724538c
adding second runner dev rocky
TerryMcGuinness-NOAA Oct 18, 2024
50e98da
updated pipeline to use PR number as input
TerryMcGuinness-NOAA Oct 18, 2024
a831f1a
added authentication token for gh for getting branch names from PR nu…
TerryMcGuinness-NOAA Oct 18, 2024
2b815d7
added repo switch to gh command to get branch name from PR number
TerryMcGuinness-NOAA Oct 18, 2024
f6165df
try making operating system choice selectable too
TerryMcGuinness-NOAA Oct 18, 2024
10eb145
try making operating system choice selectable 2
TerryMcGuinness-NOAA Oct 18, 2024
5d3bc34
try making operating system choice selectable 3
TerryMcGuinness-NOAA Oct 18, 2024
e59fa2f
try using a list for runs-on:
TerryMcGuinness-NOAA Oct 18, 2024
3cc97d9
removed reference yaml cases
TerryMcGuinness-NOAA Oct 18, 2024
9923de0
renamed rocky to generic beause it is now selectable
TerryMcGuinness-NOAA Oct 18, 2024
2904e5c
renamed aws ci pipeline
TerryMcGuinness-NOAA Oct 18, 2024
43e41c2
cleaned up name of wf
TerryMcGuinness-NOAA Oct 18, 2024
3323fb4
new line at enc of file
TerryMcGuinness-NOAA Oct 18, 2024
88cee99
dropped off matrix case and missed it in testing from previous assump…
TerryMcGuinness-NOAA Oct 21, 2024
41ba8f0
had to two steps typo
TerryMcGuinness-NOAA Oct 21, 2024
ab5c7e8
added some logic to use input.ref from the default branch list from d…
TerryMcGuinness-NOAA Oct 21, 2024
8fdace7
Merge branch 'NOAA-EMC:develop' into ci_pw_updates
TerrenceMcGuinness-NOAA Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
name: gw-ci-aws-centos

on: [workflow_dispatch]

name: gw-ci-aws
# TEST_DIR contains 2 directories;
# 1. HOMEgfs: clone of the global-workflow
# 2. RUNTESTS: A directory containing EXPDIR and COMROT for experiments
Expand All @@ -10,33 +7,73 @@ on: [workflow_dispatch]
# ├── HOMEgfs
# └── RUNTESTS
# ├── COMROT
# │   └── ${pslot}
# │ └── ${pslot}
# └── EXPDIR
# └── ${pslot}

on:
workflow_dispatch:
inputs:
pr_number:
description: 'Pull Request Number'
required: true
default: ''
os:
description: 'Operating System'
required: true
type: choice
options:
- rocky
- centos

env:
TEST_DIR: ${{ github.workspace }}/${{ github.run_id }}
MACHINE_ID: noaacloud

jobs:
fetch-branch:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUBTOKEN }}
outputs:
branch: ${{ steps.get-branch.outputs.branch }}
steps:
- name: Fetch branch name for PR
id: get-branch
run: |
pr_number=${{ github.event.inputs.pr_number }}
repo=${{ github.repository }}
if [ "$pr_number" -eq "0" ]; then
branch=${{ github.event.inputs.ref }}
else
branch=$(gh pr view $pr_number --repo $repo --json headRefName --jq '.headRefName')
fi
echo "::set-output name=branch::$branch"

checkout:
runs-on: [self-hosted, aws, parallelworks, centos]
needs: fetch-branch
runs-on:
- self-hosted
- aws
- parallelworks
- ${{ github.event.inputs.os }}
timeout-minutes: 600

steps:

- name: Checkout global-workflow
uses: actions/checkout@v4
with:
path: ${{ github.run_id }}/HOMEgfs
submodules: 'recursive'
ref: ${{ github.event.pull_request.head.ref }}
ref: ${{ needs.fetch-branch.outputs.branch }}

build-link:
runs-on: [self-hosted, aws, parallelworks, centos]
needs: checkout

runs-on:
- self-hosted
- aws
- parallelworks
- ${{ github.event.inputs.os }}
steps:

- name: Build components
run: |
cd ${{ env.TEST_DIR }}/HOMEgfs/sorc
Expand All @@ -48,12 +85,15 @@ jobs:
./link_workflow.sh

create-experiments:
needs: checkout
runs-on: [self-hosted, aws, parallelworks, centos]
needs: build-link
runs-on:
- self-hosted
- aws
- parallelworks
- ${{ github.event.inputs.os }}
strategy:
matrix:
case: ["C48_ATM"]

steps:
- name: Create Experiments ${{ matrix.case }}
env:
Expand All @@ -68,9 +108,12 @@ jobs:

run-experiments:
needs: create-experiments
runs-on: [self-hosted, aws, parallelworks, centos]
runs-on:
- self-hosted
- aws
- parallelworks
- ${{ github.event.inputs.os }}
strategy:
max-parallel: 2
matrix:
case: ["C48_ATM"]
steps:
Expand All @@ -81,9 +124,13 @@ jobs:

clean-up:
needs: run-experiments
runs-on: [self-hosted, aws, parallelworks, centos]
runs-on:
- self-hosted
- aws
- parallelworks
- ${{ github.event.inputs.os }}
steps:
- name: Clean-up
- name: Clean up workspace
run: |
cd ${{ github.workspace }}
rm -rf ${{ github.run_id }}
echo "Cleaning up workspace"
rm -rf ${{ env.TEST_DIR }}
Loading