[CI] Cache test_data for translate tests #48
Workflow file for this run
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
name: "pyFV3 translate tests (subset)" | ||
on: | ||
workflow_call: | ||
inputs: | ||
component_trigger: | ||
type: boolean | ||
default: false | ||
required: false | ||
component_name: | ||
type: string | ||
default: '' | ||
required: false | ||
pull_request: | ||
# cancel running jobs if theres a newer push | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
pyFV3_translate_tests: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/noaa-gfdl/miniforge:mpich | ||
env: | ||
DATA_PATH: ./test_data/8.1.3/c12_6ranks_standard/dycore | ||
DATA_URL: "https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.tar.gz" | ||
steps: | ||
- name: External trigger Checkout pyFV3 | ||
if: ${{inputs.component_trigger}} | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
repository: noaa-gfdl/pyFV3 | ||
path: pyFV3 | ||
- name: Checkout hash that triggered CI | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
path: pyFV3/${{inputs.component_name}} | ||
- name: External trigger install NDSL packages | ||
if: False # ${{inputs.component_trigger}} | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/pyFV3 | ||
cd NDSL && pip3 install .[test] && cd ../ | ||
pip3 install .[test] | ||
- name: Install pyFV3 packages | ||
if: False # ${{ ! inputs.component_trigger }} | ||
run : | | ||
cd ${GITHUB_WORKSPACE}/pyFV3 | ||
pip install .[ndsl,test] | ||
- name: Restore test_data (if cached) | ||
id: cache-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
key: ${{ env.DATA_PATH }} | ||
path: ${{ GITHUB_WORKSPACE }}/pyFV3/test_data | ||
Check failure on line 62 in .github/workflows/translate.yaml
|
||
- name: Download test_data (if not cached) | ||
if: steps.cache-restore.outputs.cache-hit != 'true' | ||
run: | | ||
cd ${{ GITHUB_WORKSPACE }}/pyFV3 | ||
mkdir -p test_data && cd test_data | ||
wget ${{ env.DATA_URL }} | ||
tar -xzvf 8.1.3_c12_6ranks_standard.tar.gz --no-same-owner | ||
ls -l | ||
cd .. | ||
ls -l | ||
- name: NumPy FvTp2d | ||
if: False | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/pyFV3 | ||
coverage run --rcfile=setup.cfg -m pytest \ | ||
-v -s --data_path=${{ env.DATA_PATH }} \ | ||
--backend=numpy \ | ||
--which_modules=FvTp2d \ | ||
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | ||
./tests/savepoint | ||
- name: Numpy D_SW | ||
if: False | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/pyFV3 | ||
coverage run --rcfile=setup.cfg -m pytest \ | ||
-v -s --data_path=${{ env.DATA_PATH }} \ | ||
--backend=numpy \ | ||
--which_modules=D_SW \ | ||
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | ||
./tests/savepoint | ||
- name: Numpy Remapping | ||
if: False | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/pyFV3 | ||
coverage run --rcfile=setup.cfg -m pytest \ | ||
-v -s --data_path=${{ env.DATA_PATH }} \ | ||
--backend=numpy \ | ||
--which_modules=Remapping \ | ||
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | ||
./tests/savepoint | ||
- name: Orchestrated dace-cpu Acoustics | ||
if: False | ||
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 coverage run --rcfile=setup.cfg -m mpi4py -m pytest \ | ||
-v -s --data_path=${{ env.DATA_PATH }} \ | ||
--backend=dace:cpu \ | ||
-m parallel \ | ||
--which_rank=0 \ | ||
--which_modules=DynCore \ | ||
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | ||
./tests/savepoint | ||
- name: Cache test_data | ||
id: cache-save | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ${{ GITHUB_WORKSPACE }}/pyFV3/test_data/test_data | ||
key: ${{ steps.cache-restore.outputs.cache-primary-key }} |