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

Add github actions workflow to test SRWA build #152

Merged
merged 31 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0c95b44
Add support on NSSL/Odin (#227)
ywangwof Mar 23, 2022
5c17b2c
Add python module to cheyenne build environments (#232)
willmayfield Mar 30, 2022
31dab61
Update SRW Documentation (#212)
gspetro-NOAA Mar 30, 2022
2b09220
Update hashes of all components to latest versions (#233)
mkavulich Apr 5, 2022
57dc966
Add a Contributor's Guide feature to the docs (#228)
gspetro-NOAA Apr 5, 2022
bc34ed7
Updates to parameters in config_defaults .rst files (#237)
gspetro-NOAA Apr 26, 2022
ebe5f38
Add github actions workflow to test build, & add env files to match d…
Apr 27, 2022
baab609
Add newline, change branch name
Apr 27, 2022
0ced837
Added functionality for MacOS X (#242)
natalie-perlin Apr 27, 2022
c1fbe4a
Add brief Continous Integration doc
Apr 27, 2022
e42b47b
Fix typo
Apr 27, 2022
3e2b634
Add gaea to supported platforms (#236)
mark-a-potts Apr 28, 2022
d8340a7
Bug fix with singularity env files (#245)
danielabdi-noaa Apr 29, 2022
74d9249
Replace bash env files with modules (#238)
danielabdi-noaa May 1, 2022
d0532b5
update hash of regional workflow (#247)
chan-hoo May 2, 2022
8f41175
Update WE2E documentation (#241)
gsketefian May 3, 2022
6b022cd
fixes for gaea modules (#248)
mark-a-potts May 3, 2022
bc7c4af
Merge in develop from ufs-community
May 4, 2022
4cdeeac
Add modulefiles, and update CI to test all branches on opened PR
Jun 8, 2022
b1b5fe7
Merge rrfs_ci, remove .env files, udpate aws modulefiles
Jun 8, 2022
3064eb4
Add back in hpc-stack submodule
Jun 8, 2022
d87100c
Fix errors from faulty merge commit
Jun 8, 2022
977ab8b
Add aws as a machine to etc/lmod-setup files, add on push: event for …
Jun 9, 2022
5f31456
Update GHA build_test.yml- remove modification to detect_machine.sh, …
Jun 9, 2022
36188ff
Remove build.yml file from auth repo, add on push event for rrfs_ci b…
Jun 9, 2022
bca1cf7
Add workflow dispatch and run CI on label
Jun 9, 2022
a15ef29
Change the branch (ref) that is checked out to the github.ref which t…
Jun 9, 2022
7890f43
Change github.ref to github.base_ref
Jun 9, 2022
3315222
Do not check out a specific branch, as PR might be submitted from ano…
Jun 9, 2022
70375ed
Only run GHA Workflow on rrfs_ci branch
Jun 13, 2022
b6e2567
Add github.run_id to path of cloned repo to avoid multiple PR conflic…
Jun 24, 2022
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
21 changes: 0 additions & 21 deletions .github/workflows/build.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This workflow Builds the UFS Short Range Weather APP
name: Build SRWA

on:
workflow_dispatch:
pull_request:
branches:
- rrfs_ci
types:
- labeled

# Use a default login shell which loads intel/oneapi/setvars.sh, and lmod path
defaults:
run:
shell: bash -l {0}

jobs:

Clone_SRWA:
name: Clone Repo
if: ${{ github.event.label.name == 'ci-aws-intel-build' }}
runs-on: self-hosted
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
path: ufs-srweather-app-${{ github.run_id }}

- name: Verify Branch
run: |
git branch -a

Build_SRWA:
name: Build SRWA
if: ${{ github.event.label.name == 'ci-aws-intel-build' }}
runs-on: self-hosted
needs: Clone_SRWA

steps:
- name: Build Short Range Weather App using test/build.sh
run: |
cd ufs-srweather-app-${{ github.run_id }}
./manage_externals/checkout_externals
cd test/
./build.sh aws 2>&1 | tee build_test.out

Build_Status:
name: Check Build Sucess or Failure
runs-on: self-hosted
if: ${{ github.event.label.name == 'ci-aws-intel-build' }}
needs: [ Clone_SRWA, Build_SRWA ]

steps:
- name: Get build status
run: |
cd ufs-srweather-app-${{ github.run_id }}/test/
status=`tail -1 build_test.out |cut -d ' ' -f 3-`
if [ $status == PASS ]; then
exit 0
else
exit 1
fi

28 changes: 28 additions & 0 deletions docs/UsersGuide/source/ContinuousIntegration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _ContinuousIntegration:

======================
Continuous Integration
======================
The Continuous Integration pipeline uses `GitHub Actions Self-Hosted Runners <https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners>`_.
Currently, an `AWS Parallel Cluster <https://aws.amazon.com/hpc/parallelcluster>`_ is configured with all of the dependencies required of the ufs-srweather-app, emulating a NOAA RDHPCS machine.


The following dependencies are currently requirements on the self-hosted runner to build and run automated workflows:

* Python v3.8
* Ruby
* IntelOne API
* Lua
* Lmod
* `hpc-stack <https://github.com/NOAA-EMC/hpc-stack>`_ with all of necessary libraries in ``ufs-srweather-app/env/srw_common``
* Rocoto
* Miniconda3

After creating an AWS ParallelCluster, a ``post-install`` `script <https://github.com/robgonzalezpita/rrfs-ci-pcluster/blob/main/rrfs_ci_post_install.sh>`_
can be executed to automate the installation of these dependencies.

One must then configure this ParallelCluster to be a self-hosted runner as well (which can be done via the `GitHub interface <https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners>`_), in order to pick up the jobs listed in
the GitHub Actions workflow files.

As of now, only a build test has been implemented to verify that the ``ufs-srweather-app`` builds on the self-hosted runner. A test suite consisting of Workflow End to End tests will be added at a later date.

1 change: 0 additions & 1 deletion docs/UsersGuide/source/WE2Etests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -386,4 +386,3 @@ Note the following:
one or more alternate test names are listed, then ``run_WE2E_tests.sh`` will exit
with a warning message without running any tests.


6 changes: 6 additions & 0 deletions etc/lmod-setup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ else if ( "$L_MACHINE" == odin ) then
module --initial_load --no_redirect restore
setenv MODULEPATH "/oldscratch/ywang/external/hpc-stack/modulefiles/mpi/intel/2020/cray-mpich/7.7.16:/oldscratch/ywang/external/hpc-stack/modulefiles/compiler/intel/2020:/oldscratch/ywang/external/hpc-stack/modulefiles/core:/oldscratch/ywang/external/hpc-stack/modulefiles/stack:/opt/cray/pe/perftools/21.02.0/modulefiles:/opt/cray/ari/modulefiles:/opt/cray/pe/craype-targets/default/modulefiles:/opt/cray/pe/modulefiles:/opt/cray/modulefiles:/opt/modulefiles"

else if [ "$L_MACHINE" = aws ]; then
set ENV="/scratch1/apps/lmod/lmod/init/csh"
source $ENV

module purge

else
module purge
endif
Expand Down
6 changes: 6 additions & 0 deletions etc/lmod-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ elif [ "$L_MACHINE" = odin ]; then
module --initial_load --no_redirect restore
export MODULEPATH="/oldscratch/ywang/external/hpc-stack/modulefiles/mpi/intel/2020/cray-mpich/7.7.16:/oldscratch/ywang/external/hpc-stack/modulefiles/compiler/intel/2020:/oldscratch/ywang/external/hpc-stack/modulefiles/core:/oldscratch/ywang/external/hpc-stack/modulefiles/stack:/opt/cray/pe/perftools/21.02.0/modulefiles:/opt/cray/ari/modulefiles:/opt/cray/pe/craype-targets/default/modulefiles:/opt/cray/pe/modulefiles:/opt/cray/modulefiles:/opt/modulefiles"

elif [ "$L_MACHINE" = aws ]; then
export BASH_ENV="/scratch1/apps/lmod/lmod/init/bash"
source $BASH_ENV

module purge

else
module purge
fi
Expand Down
63 changes: 63 additions & 0 deletions modulefiles/build_aws_intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#%Module

proc ModulesHelp { } {
puts stderr "This module loads libraries for building SRW on"
puts stderr "AWS ParallelCluster using Intel oneAPI -2021.5.0"
}

module-whatis "Loads libraries needed for building SRW on AWS ParallelCluster"

# Dependant on the install location of hpc-stack modulefiles
module use /scratch1/hpc-stack/modulefiles/stack

module load hpc/1.2.0
module load hpc-intel/2021
# IntelOne API MPI (below)
# module load hpc-impi/2021
# PCluster native intel mpi (version specified when hpc-stack is built)
module load hpc-impi/2019.8.254
module load intelmpi
module load cmake/3.20.1

module load jasper/2.0.25
module load zlib/1.2.11
module load-any png/1.6.35 libpng/1.6.35

module load hdf5/1.10.6
module load netcdf/4.7.4
module load pio/2.5.2
module load esmf/8.2.0
module load fms/2021.03

module load bacio/2.4.1
module load crtm/2.3.0
module load g2/3.4.3
module load g2tmpl/1.10.0
module load ip/3.3.3
module load sp/2.3.3
module load w3nco/2.4.1
module load upp/10.0.10

module load gftl-shared/v1.3.3
module load yafyaml/v0.5.1
module load mapl/2.11.0-esmf-8.2.0

module load gfsio/1.4.1
module load landsfcutil/2.4.1
module load nemsio/2.5.2
module load nemsiogfs/2.5.3
module load sfcio/1.4.1
module load sigio/2.3.2
module load w3emc/2.9.2
module load wgrib2/2.0.8

module load intelmpi
module load libfabric-aws

setenv CMAKE_C_COMPILER mpiicc
setenv CMAKE_CXX_COMPILER mpiicpc
setenv CMAKE_Fortran_COMPILER mpiifort
setenv CMAKE_Platform linux.intel

setenv I_MPI_ROOT /opt/intel/compilers_and_libraries_2020.2.254/linux/mpi
setenv I_MPI_Platform shm:ofa
19 changes: 19 additions & 0 deletions modulefiles/wflow_aws
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#%Module

proc ModulesHelp { } {
put stderr "This module loads python environement for running SRW on"
put stderr "AWS ParallelCluster"
}

module-whatis "Loads libraries needed for running SRW on AWS ParallelCluster"

module load rocoto

module use -a /home/ubuntu/miniconda3/contrib_miniconda3/modulefiles
module load miniconda3

if { [module-info mode load] } {
puts stderr "Please do the following to activate conda:
> conda activate regional_workflow"
}

2 changes: 1 addition & 1 deletion test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function usage() {
exit 1
}

machines=( hera jet cheyenne orion wcoss_cray wcoss_dell_p3 gaea odin singularity )
machines=( hera jet cheyenne orion wcoss_cray wcoss_dell_p3 gaea odin singularity aws )

[[ $# -eq 2 ]] && usage

Expand Down