Skip to content

Commit

Permalink
Merge pull request #19 from mlee03/ci_testing
Browse files Browse the repository at this point in the history
Containerized CI and added reusable workflow capability
  • Loading branch information
fmalatino authored Jun 27, 2024
2 parents a9b5fcb + e185997 commit 693014f
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 58 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
uses: actions/[email protected]
with:
submodules: 'recursive'
- name: Step Python 3.8.12
- name: Step Python 3.11.7
uses: actions/[email protected]
with:
python-version: '3.8.12'
python-version: '3.11.7'
- name: Install OpenMPI for gt4py
run: |
sudo apt-get install libopenmpi-dev
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pace_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Pace unit tests"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
pace_unit_tests:
uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop
with:
shield_trigger: true
103 changes: 103 additions & 0 deletions .github/workflows/translate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: "pySHiELD Translate test"
on:
workflow_call:
inputs:
fv3_trigger:
type: boolean
default: false
required: false
ndsl_trigger:
type: boolean
default: false
required: false
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

env:
github_repository: ${{github.event.repository.name}}

jobs:
pyshield_translate_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/miniforge:mpich
steps:

- name: Checkout pyshield for externally triggered workflow
if: ${{inputs.ndsl_trigger || inputs.fv3_trigger}}
uses: actions/checkout@v4
with:
repository: 'noaa-gfdl/PySHiELD'
submodules: 'recursive'
path: PySHiELD

- name: Checkout repository that triggers workflow
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: ${{env.github_repository}}

- name: prep directory for externally triggered workflow
if: ${{inputs.ndsl_trigger || inputs.fv3_trigger}}
run : |
cd ${GITHUB_WORKSPACE}
mv ${{env.github_repository}} PySHiELD/.
- name: Install packages for ndsl_trigger
if : ${{inputs.ndsl_trigger}}
run : |
cd ${GITHUB_WORKSPACE}/PySHiELD/
pip3 install --upgrade pip setuptools wheel
cd NDSL && pip3 install .[test]
cd ../ && pip3 install .[pyFV3,test]
- name: Install packages for pyFV3 trigger
if: ${{inputs.fv3_trigger}}
run: |
cd ${GITHUB_WORKSPACE}/PySHiELD
pip3 install --upgrade pip setuptools wheel
cd PyFV3 && pip3 install .[test]
cd ../ && pip3 install .[ndsl,test]
- name: Install PySHiELD Python packages
if: ${{ !inputs.fv3_trigger && !inputs.ndsl_trigger}}
run: |
cd ${GITHUB_WORKSPACE}/PySHiELD
pip3 install --upgrade pip setuptools wheel
pip3 install .[ndsl,pyFV3,test]
- name: Download data
run: |
cd ${GITHUB_WORKSPACE}/PySHiELD
mkdir -p test_data
cd test_data
wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_baroclinic.physics.tar.gz
tar -xzvf 8.1.3_c12_6ranks_baroclinic.physics.tar.gz
- name: Numpy Translate Test
run: |
cd ${GITHUB_WORKSPACE}/PySHiELD
pytest \
-v -s --data_path=./test_data/8.1.3/c12_6ranks_baroclinic/physics \
--backend=numpy \
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \
./tests/savepoint
- name: Orchestrated dace:cpu Translate Test
run: |
cd ${GITHUB_WORKSPACE}/PySHiELD
export FV3_DACEMODE=BuildAndRun
export PACE_FLOAT_PRECISION=64
export PACE_TEST_N_THRESHOLD_SAMPLES=0
export OMP_NUM_THREADS=10
export PACE_LOGLEVEL=Debug
pytest \
-vvv -x -s --data_path=./test_data/8.1.3/c12_6ranks_baroclinic/physics \
--backend=dace:cpu \
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \
./tests/savepoint
55 changes: 0 additions & 55 deletions .github/workflows/translate.yml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

requirements = [
"f90nml>=1.1.0",
"numpy",
"numpy==1.26.4",
"xarray",
]

Expand Down

0 comments on commit 693014f

Please sign in to comment.