Skip to content

Containerized CI and reusable workflow implementation #97

Containerized CI and reusable workflow implementation

Containerized CI and reusable workflow implementation #97

Workflow file for this run

name: "Translate pyFV3 test (subset)"
on:
workflow_call:
inputs:
ndsl_hash:
type: string
default: ''
required: true
ndsl_trigger:
type: boolean
default: false
required: true
push:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
# cancel running jobs if theres a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
all_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/miniforge:mpich
steps:
- name: Checkout pyFV3 to test NDSL in pyFV3
if: ${{inputs.ndsl_trigger}}
uses: actions/checkout@v4
with:
submodules: 'recursive'
repository: noaa-gfdl/pyFV3
path: pyFV3
- name: Checkout either pyFV3 (!workflow_call) or NDSL (workflow_call)
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: ${{github.event.repository.name}}
- name: Checkout pyFV3 if part of NDSL workflow
if: ${{inputs.ndsl_trigger}}
run: |
cd ${GITHUB_WORKSPACE}
mv NDSL pyFV3/NDSL
- name: install packages to test NDSL in pyFV3
if: ${{inputs.ndsl_trigger}}
run: |
cd ${GITHUB_WORKSPACE}/pyFV3
cd NDSL && pip3 install . && cd ..
pip3 install .[test]
- name: Install packages to test only pyFV3
if: ${{ ! inputs.ndsl_trigger }}
run : |
mv ${GITHUB_WORKSPACE}/${{github.event.repository.name}} ${GITHUB_WORKSPACE}/pyFV3
cd pyFV3
pip install .[ndsl,test]
- name: Prepare test_data
run: |
cd ${GITHUB_WORKSPACE}/pyFV3
mkdir -p test_data && cd test_data
wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.tar.gz
tar -xzvf 8.1.3_c12_6ranks_standard.tar.gz --no-same-owner
cd ..
- name: Numpy FvTp2d
run: |
cd ${GITHUB_WORKSPACE}/pyFV3
pytest \
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \
--backend=numpy \
--which_modules=FvTp2d \
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \
./tests/savepoint
- name: Numpy D_SW
run: |
cd ${GITHUB_WORKSPACE}/pyFV3
pytest \
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \
--backend=numpy \
--which_modules=D_SW \
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \
./tests/savepoint
- name: Numpy Remapping
run: |
cd ${GITHUB_WORKSPACE}/pyFV3
pytest \
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \
--backend=numpy \
--which_modules=Remapping \
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \
./tests/savepoint
- name: Orchestrated dace-cpu Acoustics
run: |
cd ${GITHUB_WORKSPACE}/pyFV3
export FV3_DACEMODE=BuildAndRun
export PACE_FLOAT_PRECISION=64
export PACE_TEST_N_THRESHOLD_SAMPLES=0
export OMP_NUM_THREADS=1
export PACE_LOGLEVEL=Debug
mpiexec -mca orte_abort_on_non_zero_status 1 -np 6 --oversubscribe pytest \
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \
--backend=dace:cpu \
-m parallel \
--which_rank=0 \
--which_modules=DynCore \
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \
./tests/savepoint