forked from ufs-community/ufs-srweather-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github actions workflow to test SRWA build (ufs-community#152)
Currently, there are no Continuous Integration (C.I.) tests for this repository. C.I. tests are considered a software engineering best practice, with numerous benefits to developers as well as the code-base. This PR implements building the ufs-srweather-app as a form of C.I.
- Loading branch information
Rob Gonzalez-Pita
authored
Jun 27, 2022
1 parent
3915859
commit 4be97a4
Showing
9 changed files
with
186 additions
and
23 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters