From ee5a6dfe695f329c3882105b087f3563a0c80b81 Mon Sep 17 00:00:00 2001 From: Florian Deconinck Date: Thu, 9 May 2024 17:07:10 -0400 Subject: [PATCH] NOAA/NASA pyFV3 CI on every commit (#1478) Follow up of #1460 - [x] Fixed the `ci` script (including `git checkout issues` around selecting the correct `dace`) - [x] Move `D_SW` to execute only on rank 0 to avoid rebuild - [x] Swapped Rieman Solver on C-grid for D-grid for better coverage ~~WARNING: this PR is blocked by #1477~~ ~~WARNING: this PR is blocked by #1568~~ --------- Co-authored-by: Tal Ben-Nun --- .github/workflows/pace-build-ci.yml | 75 ----------------------- .github/workflows/pyFV3-ci.yml | 94 +++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/pace-build-ci.yml create mode 100644 .github/workflows/pyFV3-ci.yml diff --git a/.github/workflows/pace-build-ci.yml b/.github/workflows/pace-build-ci.yml deleted file mode 100644 index 672c891a55..0000000000 --- a/.github/workflows/pace-build-ci.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: NASA/NOAA Pace repository build test - -on: - workflow_dispatch: - -defaults: - run: - shell: bash - -jobs: - build_pace: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.8.10] - - steps: - - uses: actions/checkout@v2 - with: - repository: 'git@github.com:GEOS-ESM/pace.git' - ref: 'ci/DaCe' - submodules: 'recursive' - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies & pull correct DaCe - run: | - cd pace - python -m pip install --upgrade pip wheel setuptools - cd external/dace - git checkout ${{ github.sha }} - cd ../.. - pip install -e external/gt4py - pip install -e external/dace - pip install -r requirements_dev.txt - - name: Download data - run: | - cd pace - mkdir -p test_data - cd test_data - wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6_ranks_standard.D_SW.tar.gz - tar -xzvf 8.1.3_c12_6_ranks_standard.D_SW.tar.gz - wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6_ranks_standard.RiemSolverC.tar.gz - tar -xzvf 8.1.3_c12_6_ranks_standard.RiemSolverC.tar.gz - wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6_ranks_standard.Remapping.tar.gz - tar -xzvf 8.1.3_c12_6_ranks_standard.Remapping.tar.gz - cd ../.. - - name: "Regression test: Riemman Solver on C-grid" - run: | - export FV3_DACEMODE=BuildAndRun - export PACE_CONSTANTS=GFS - cd pace - pytest -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ - --backend=dace:cpu --which_modules=Riem_Solver_C \ - --threshold_overrides_file=./fv3core/tests/savepoint/translate/overrides/standard.yaml \ - ./fv3core/tests/savepoint - - name: "Regression test: D-grid shallow water lagrangian dynamics (D_SW)" - run: | - export FV3_DACEMODE=BuildAndRun - export PACE_CONSTANTS=GFS - cd pace - pytest -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ - --backend=dace:cpu --which_modules=D_SW \ - --threshold_overrides_file=./fv3core/tests/savepoint/translate/overrides/standard.yaml \ - ./fv3core/tests/savepoint - - name: "Regression test: Remapping (on rank 0 only)" - run: | - export FV3_DACEMODE=BuildAndRun - export PACE_CONSTANTS=GFS - cd pace - pytest -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ - --backend=dace:cpu --which_modules=Remapping --which_rank=0 \ - --threshold_overrides_file=./fv3core/tests/savepoint/translate/overrides/standard.yaml \ - ./fv3core/tests/savepoint diff --git a/.github/workflows/pyFV3-ci.yml b/.github/workflows/pyFV3-ci.yml new file mode 100644 index 0000000000..f50f424bb8 --- /dev/null +++ b/.github/workflows/pyFV3-ci.yml @@ -0,0 +1,94 @@ +name: NASA/NOAA pyFV3 repository build test + +on: + push: + branches: [ master, ci-fix ] + pull_request: + branches: [ master, ci-fix ] + +defaults: + run: + shell: bash + +jobs: + build_and_validate_pyFV3: + if: "!contains(github.event.pull_request.labels.*.name, 'no-ci')" + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.11.7] + + steps: + - uses: actions/checkout@v2 + with: + repository: 'NOAA-GFDL/PyFV3' + ref: 'ci/DaCe' + submodules: 'recursive' + path: 'pyFV3' + - uses: actions/checkout@v2 + with: + path: 'dace' + submodules: 'recursive' + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install library dependencies + run: | + sudo apt-get install libopenmpi-dev libboost-all-dev gcc-13 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 + gcc --version + # Because Github doesn't allow us to do a git checkout in code + # we use a trick to checkout DaCe first (not using the external submodule) + # install the full suite via requirements_dev, then re-install the correct DaCe + - name: Install Python packages + run: | + python -m pip install --upgrade pip wheel setuptools + pip install -e ./pyFV3[develop] + pip install -e ./dace + - name: Download data + run: | + cd 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.D_SW.tar.gz + tar -xzvf 8.1.3_c12_6ranks_standard.D_SW.tar.gz + wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.RiemSolver3.tar.gz + tar -xzvf 8.1.3_c12_6ranks_standard.RiemSolver3.tar.gz + wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.Remapping.tar.gz + tar -xzvf 8.1.3_c12_6ranks_standard.Remapping.tar.gz + cd ../.. + # Clean up caches between run for stale un-expanded SDFG to trip the build system (NDSL side issue) + - name: "Regression test: Riemman Solver on D-grid (RiemSolver3)" + env: + FV3_DACEMODE: BuildAndRun + PACE_CONSTANTS: GFS + PACE_LOGLEVEL: Debug + run: | + pytest -v -s --data_path=./pyFV3/test_data/8.1.3/c12_6ranks_standard/dycore \ + --backend=dace:cpu --which_modules=Riem_Solver3 \ + --threshold_overrides_file=./pyFV3/tests/savepoint/translate/overrides/standard.yaml \ + ./pyFV3/tests/savepoint + rm -r ./.gt_cache_FV3_A + - name: "Regression test: Shallow water lagrangian dynamics on D-grid (D_SW) (on rank 0 only)" + env: + FV3_DACEMODE: BuildAndRun + PACE_CONSTANTS: GFS + PACE_LOGLEVEL: Debug + run: | + pytest -v -s --data_path=./pyFV3/test_data/8.1.3/c12_6ranks_standard/dycore \ + --backend=dace:cpu --which_modules=D_SW --which_rank=0 \ + --threshold_overrides_file=./pyFV3/tests/savepoint/translate/overrides/standard.yaml \ + ./pyFV3/tests/savepoint + rm -r ./.gt_cache_FV3_A + - name: "Regression test: Remapping (on rank 0 only)" + env: + FV3_DACEMODE: BuildAndRun + PACE_CONSTANTS: GFS + PACE_LOGLEVEL: Debug + run: | + pytest -v -s --data_path=./pyFV3/test_data/8.1.3/c12_6ranks_standard/dycore \ + --backend=dace:cpu --which_modules=Remapping --which_rank=0 \ + --threshold_overrides_file=./pyFV3/tests/savepoint/translate/overrides/standard.yaml \ + ./pyFV3/tests/savepoint + rm -r ./.gt_cache_FV3_A