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

Split CI workflows into gfortran and containerized #88

Merged
merged 41 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
782d1a6
Update continuous_integration.yml
alejandrobodas Mar 13, 2024
d0d86f0
Update CI to Ubuntu 22.04
RobertPincus Mar 13, 2024
9ed8f03
YML syntax
RobertPincus Mar 13, 2024
e35007a
Use Ubuntu netcdf Fortran library for gfortran
RobertPincus Mar 13, 2024
82d0a76
YML syntax
RobertPincus Mar 13, 2024
2ef935a
netcdf fortran homes
RobertPincus Mar 13, 2024
4c46666
Add dependabot
RobertPincus Mar 13, 2024
9ee097f
Not understanding this...
RobertPincus Mar 13, 2024
a2d85e2
Another place
RobertPincus Mar 13, 2024
587dea2
Iteration
RobertPincus Mar 13, 2024
e039ab5
Containerized CI
RobertPincus Mar 13, 2024
d38c1fe
YML syntax
RobertPincus Mar 13, 2024
b9d4352
Don't source a file
RobertPincus Mar 13, 2024
1a1657f
Gotta check out the code...
RobertPincus Mar 13, 2024
16c045f
Can we install aot-get in a container?
RobertPincus Mar 13, 2024
3912acd
Remove Intel compiler and related complications from default CI
RobertPincus Mar 14, 2024
4e22632
Test curl
alejandrobodas Mar 14, 2024
29c3ec8
Update containerized-ci.yml
alejandrobodas Mar 14, 2024
44ead0e
No nvfortran (temporarily)
alejandrobodas Mar 14, 2024
3216b27
No nvfortran flags.
alejandrobodas Mar 14, 2024
23aa969
Only ifort
alejandrobodas Mar 14, 2024
0944617
Update containerized-ci.yml
alejandrobodas Mar 14, 2024
8a16cd2
Update containerized-ci.yml
alejandrobodas Mar 14, 2024
68a8b6b
Update containerized-ci.yml
alejandrobodas Mar 15, 2024
0657cd8
ifort v002 md5 files
alejandrobodas Mar 15, 2024
fa810cd
Update containerized-ci.yml
alejandrobodas Mar 15, 2024
f21e3cb
Update containerized-ci.yml
alejandrobodas Mar 15, 2024
18bf659
Produce ifx KGOs
alejandrobodas Mar 15, 2024
dc1d0aa
Produce ifx KGOs
alejandrobodas Mar 15, 2024
462433e
ifx v002 KGOs md5 files
alejandrobodas Mar 15, 2024
219766b
ifx KGOs urls
alejandrobodas Mar 15, 2024
43a0c29
Update actions versions in gfortran CI tests
alejandrobodas Mar 15, 2024
5dafead
Download files using same logic in both CI workflows.
alejandrobodas Mar 15, 2024
2960f60
Same short name for all gfortran compilers
alejandrobodas Mar 15, 2024
a89bd46
Fix typo.
alejandrobodas Mar 15, 2024
235d548
Update actions versions.
alejandrobodas Mar 15, 2024
b876e61
Use conda-incubator/setup-miniconda
alejandrobodas Mar 15, 2024
be9fa4d
Fix typo.
alejandrobodas Mar 15, 2024
9645735
Create environment.yml
alejandrobodas Mar 15, 2024
b897ded
Use conda-incubator/setup-miniconda
alejandrobodas Mar 15, 2024
6b55443
Activate both tests
alejandrobodas Mar 15, 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
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
target-branch: "master"
138 changes: 138 additions & 0 deletions .github/workflows/containerized-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Continuous integration in containers
on: [push, pull_request, workflow_dispatch]

jobs:
Containerized-CI:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [ifort, ifx]
include:
# Flags and KGOs for Intel Fortran Compiler Classic
- compiler: ifort
fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08
gdkgo1: https://docs.google.com/uc?export=download&id=1TpXY-vXkwAnym9nNjzUxt1q_8c8T7X8T
gdkgo2: https://docs.google.com/uc?export=download&id=1ic-2B3dIx1kIoi-Nd1ndLbLAe_LIWDGP
# Flags and KGOs for Intel Fortran Compiler
- compiler: ifx
fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08
gdkgo1: https://docs.google.com/uc?export=download&id=19N7wXou-2Zv0oVAnwn4Ucs8Ghr-C0SMt
gdkgo2: https://docs.google.com/uc?export=download&id=1EUO6C_v0rq0NMXkLGqZDKX99kknnMRQN
# Set container images
- compiler: ifort
image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi
- compiler: ifx
image: ghcr.io/earth-system-radiation/rte-rrtmgp-ci:oneapi
container:
image: ${{ matrix.image }}
env:
F90: ${{ matrix.compiler }}
FC: ${{ matrix.compiler }}
F90FLAGS: ${{ matrix.fcflags }}
# Make variables:
NFHOME: /opt/netcdf-fortran
# KGO tests variables
ATOL: 0.0
RTOL: 0.0
KGO_VERSION: v002
GDKGO1: ${{ matrix.gdkgo1 }}
GDKGO2: ${{ matrix.gdkgo2 }}
steps:
#
# Checks-out repository under $GITHUB_WORKSPACE
#
- uses: actions/checkout@v4

###############################################################################
# Build COSP and retrieve input and test files
###############################################################################
# Build COSP2 driver. Intel Fortran stores automatic arrays in the stack
# by default, whereas GNU Fortran stores them in the heap. This can cause
# segmentation faults with ifort, especially in memory-intensive applications
# like COSP. We tell ifort to use heap arrays.
- name: Build driver
run: |
${F90} --version
cd build
make -j driver
# Retrieve and expand large data files
- name: Retrieve input files
run: |
GDFILE='https://docs.google.com/uc?export=download&id=17eK4_DVEvFOE9Uf6siXJDpWZJKT1aqkU'
OUTPATH=driver/data/inputs/UKMO/cosp_input.um_global.nc.gz
curl -sSfL -o $OUTPATH $GDFILE
gunzip ${OUTPATH}
cd driver/data/inputs/UKMO
md5sum -c cosp_input.um_global.nc.md5
- name: Retrieve KGOs for basic test
run: |
cd ${GITHUB_WORKSPACE}
OUTPATH=driver/data/outputs/UKMO/cosp2_output_um.$F90.kgo.$KGO_VERSION.nc.gz
curl -sSfL -o $OUTPATH $GDKGO1
gunzip ${OUTPATH}
cd driver/data/outputs/UKMO
# md5sum -c cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc.md5
- name: Retrieve KGOs for global test
run: |
cd ${GITHUB_WORKSPACE}
OUTPATH=driver/data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.gz
curl -sSfL -o $OUTPATH $GDKGO2
gunzip ${OUTPATH}
cd driver/data/outputs/UKMO
# md5sum -c cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc.md5
###############################################################################
# Run COSP2 tests. Basic test and UM global snapshot
###############################################################################
- name: Basic test and UM global snapshot
run: |
cd driver/run
./cosp2_test cosp2_input_nl.txt
./cosp2_test cosp2_input_nl.um_global.txt
###############################################################################
# Compare results against known good outputs. As above,
# we split it in as many steps as tests.
###############################################################################
# 1. Basic test
- name: Basic against known good output (KGO)
run: |
cd driver
KGO=data/outputs/UKMO/cosp2_output_um.${F90}.kgo.$KGO_VERSION.nc
TST=data/outputs/UKMO/cosp2_output_um.nc
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL}
# 2. UM global snapshot.
- name: UM global against known good output (KGO)
run: |
cd driver
KGO=data/outputs/UKMO/cosp2_output.um_global.${F90}.kgo.$KGO_VERSION.nc
TST=data/outputs/UKMO/cosp2_output.um_global.nc
python compare_to_kgo.py ${KGO} ${TST} --atol=${ATOL} --rtol=${RTOL}
###############################################################################
# Produce plots when it fails during global snapshot tests,
# and create a tarball with outputs.
###############################################################################
- name: Produce plots and create tarball
if: failure()
run: |
TST_MLEV=data/outputs/UKMO/cosp2_output.um_global_model_levels.nc
cd driver
if [[ -e data/outputs/UKMO/cosp2_output.um_global.nc ]]; then
python plot_test_outputs.py
fi
if [[ -e data/outputs/UKMO/cosp2_output.um_global_model_levels.nc ]]; then
python plot_test_outputs.py --tst_file=$TST_MLEV
fi
cd data/outputs/UKMO
tar --ignore-failed-read -czf outputs.UKMO.tgz cosp2_output.um_global.nc \
cosp2_output_um.nc cosp2_output.um_global_model_levels.nc *.png \
cosp2_output.um_global.out
ls -lh
###############################################################################
# Make output files available if any test fails
###############################################################################
- name: Upload output file if test fails
if: failure()
uses: actions/[email protected]
with:
name: outputs.UKMO.tgz
path: driver/data/outputs/UKMO/outputs.UKMO.tgz
Loading