diff --git a/.github/workflows/Dockerfile.gnu b/.github/workflows/Dockerfile.gnu new file mode 100644 index 0000000000..3506c2b9ee --- /dev/null +++ b/.github/workflows/Dockerfile.gnu @@ -0,0 +1,68 @@ +#*********************************************************************** +#* GNU Lesser General Public License +#* +#* This file is part of the GFDL Flexible Modeling System (FMS). +#* +#* FMS is free software: you can redistribute it and/or modify it under +#* the terms of the GNU Lesser General Public License as published by +#* the Free Software Foundation, either version 3 of the License, or (at +#* your option) any later version. +#* +#* FMS is distributed in the hope that it will be useful, but WITHOUT +#* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +#* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +#* for more details. +#* +#* You should have received a copy of the GNU Lesser General Public +#* License along with FMS. If not, see . +#*********************************************************************** +# FMS CI image recipefile for GNU +# Runs on centos stream (builder has same base from redhat registry) +# +# arguments to specify versions to build can be given to docker or changed here (--build-arg name=val) +FROM spack/rockylinux9:latest as builder + +ARG gcc_version=12.3.0 +ARG netcdfc_version=4.9.0 +ARG netcdff_version=4.6.0 +ARG libyaml_version=0.2.5 +ARG mpich_version=4.0.2 + +COPY spack.env /opt/deps/spack.env + +# perl's download kept timing out +RUN sed -i 's/connect_timeout: 10/connect_timeout: 600/' /opt/spack/etc/spack/defaults/config.yaml && \ + spack install gcc@${gcc_version} && \ + source /opt/spack/share/spack/setup-env.sh && \ + spack load gcc@${gcc_version} && \ + spack compiler find && \ + sed "s/COMPILER/gcc@$gcc_version/" /opt/deps/spack.env > spack.yaml && \ + sed -i "s/NETCDF_C_VERSION/$netcdfc_version/" spack.yaml && \ + sed -i "s/NETCDF_F_VERSION/$netcdff_version/" spack.yaml && \ + sed -i "s/LIBYAML_VERSION/$libyaml_version/" spack.yaml && \ + sed -i "s/MPI_LIB/mpich@$mpich_version/" spack.yaml && \ + spack env activate -d . && \ + spack -e . concretize -f > /opt/deps/deps.log && \ + spack install --fail-fast + +# copy built software to base from first image +FROM rockylinux:9 + +COPY --from=builder /opt/view/ /opt/view/ +COPY --from=builder /opt/deps/ /opt/deps/ + +# input files used with --enable-input-tests +# need to be on the dev boxes if building +COPY ./fms_test_input /home/unit_tests_input + +RUN dnf install -y autoconf make automake m4 libtool pkg-config zip + +ENV FC="mpifort" +ENV CC="mpicc" +ENV MPICH_FC="/opt/view/bin/gfortran" +ENV MPICH_CC="/opt/view/bin/gcc" +ENV FCFLAGS="-I/opt/view/include" +ENV CFLAGS="-I/opt/view/include" +ENV LDFLAGS="-L/opt/view/lib" +ENV LD_LIBRARY_PATH="/opt/view/lib:/opt/view/lib64:/usr/local/lib:/usr/local/lib64" +ENV PATH="/opt/view/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin" diff --git a/.github/workflows/build_ubuntu_gnu.yml b/.github/workflows/build_ubuntu_gnu.yml deleted file mode 100644 index 7c53895b15..0000000000 --- a/.github/workflows/build_ubuntu_gnu.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build libFMS test with autotools - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - strategy: - matrix: - conf-flags: [--disable-openmp, --enable-mixed-mode, --disable-setting-flags, --with-mpi=no] - input-flag: [--with-yaml, --enable-test-input=/home/unit_tests_input] - io-flag: [ --enable-deprecated-io, --disable-deprecated-io] - container: - image: noaagfdl/hpc-me.ubuntu-minimal:gnu-input - env: - TEST_VERBOSE: 1 - DISTCHECK_CONFIGURE_FLAGS: "${{ matrix.conf-flags }} ${{ matrix.input-flag }} ${{ matrix.io-flag }}" - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Prepare GNU autoconf for build - run: autoreconf -if - - name: Configure the build - if: ${{ matrix.conf-flags != '--disable-setting-flags' }} - run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} || cat config.log - - name: Configure the build with compiler flags - if: ${{ matrix.conf-flags == '--disable-setting-flags' }} - run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} FCFLAGS="-fdefault-real-8 -fdefault-double-8 -fcray-pointer -ffree-line-length-none -I/usr/include $FCFLAGS" || cat config.log - - name: Build the library - run: make distcheck - if: ${{ matrix.conf-flags != '--with-mpi=no' }} - - name: Build the library (without test suite for serial build) - run: make - if: ${{ matrix.conf-flags == '--with-mpi=no' }} diff --git a/.github/workflows/github_autotools_gnu.yml b/.github/workflows/github_autotools_gnu.yml new file mode 100644 index 0000000000..d25f440959 --- /dev/null +++ b/.github/workflows/github_autotools_gnu.yml @@ -0,0 +1,39 @@ +# 'main' required ci, does a distcheck (builds, tests, check install) +# image created off dockerfile in repo, compile/link flags are set there +name: Build libFMS test with autotools + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + conf-flag: [ --disable-openmp, --enable-mixed-mode, --disable-setting-flags, --with-mpi=no] + input-flag: [--with-yaml, --enable-test-input=/home/unit_tests_input] + exclude: + - conf-flag: --with-mpi=no + input-flag: --enable-test-input=/home/unit_tests_input + container: + image: noaagfdl/fms-ci-rocky-gnu:12.3.0 + env: + TEST_VERBOSE: 1 + DISTCHECK_CONFIGURE_FLAGS: "${{ matrix.conf-flag }} ${{ matrix.input-flag }} ${{ matrix.io-flag }}" + SKIP_TESTS: "test_mpp_domains2.14 test_horiz_interp2.9 test_horiz_interp2.10 test_yaml_parser.5" # temporary till fixes are in + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Prepare GNU autoconf for build + run: autoreconf -if + - name: Configure the build + if: ${{ matrix.conf-flag != '--disable-setting-flags' }} + run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} || cat config.log + - name: Configure the build with compiler flags + if: ${{ matrix.conf-flag == '--disable-setting-flags' }} + run: ./configure ${DISTCHECK_CONFIGURE_FLAGS} FCFLAGS="-fdefault-real-8 -fdefault-double-8 -fcray-pointer -ffree-line-length-none -I/usr/include $FCFLAGS" || cat config.log + - name: Build the library + run: make distcheck + if: ${{ matrix.conf-flag != '--with-mpi=no' }} + - name: Build the library (without test suite for serial build) + run: make + if: ${{ matrix.conf-flag == '--with-mpi=no' }} diff --git a/.github/workflows/intel_pr.yml b/.github/workflows/github_autotools_intel.yml similarity index 100% rename from .github/workflows/intel_pr.yml rename to .github/workflows/github_autotools_intel.yml diff --git a/.github/workflows/build_cmake_gnu.yml b/.github/workflows/github_cmake_gnu.yml similarity index 100% rename from .github/workflows/build_cmake_gnu.yml rename to .github/workflows/github_cmake_gnu.yml diff --git a/.github/workflows/coupler.yml b/.github/workflows/github_coupler_gnu.yml similarity index 100% rename from .github/workflows/coupler.yml rename to .github/workflows/github_coupler_gnu.yml diff --git a/.github/workflows/update_docs.yml b/.github/workflows/github_doc_site.yml similarity index 100% rename from .github/workflows/update_docs.yml rename to .github/workflows/github_doc_site.yml diff --git a/.github/workflows/lint_fms.yml b/.github/workflows/github_linter.yml similarity index 100% rename from .github/workflows/lint_fms.yml rename to .github/workflows/github_linter.yml diff --git a/.github/workflows/am4_regression_parallelWorks_intel_tag.yml b/.github/workflows/parallelworks_am4_intel.yml similarity index 100% rename from .github/workflows/am4_regression_parallelWorks_intel_tag.yml rename to .github/workflows/parallelworks_am4_intel.yml diff --git a/.github/workflows/spack.env b/.github/workflows/spack.env new file mode 100644 index 0000000000..69a3bdcbd0 --- /dev/null +++ b/.github/workflows/spack.env @@ -0,0 +1,17 @@ +# template for spack environment yaml +# uppercase words get replaced before activating +spack: + specs: + - COMPILER + - MPI_LIB + - netcdf-c@NETCDF_C_VERSION ^MPI_LIB + - netcdf-fortran@NETCDF_F_VERSION + - libyaml@LIBYAML_VERSION + concretizer: + unify: true + packages: + all: + compiler: [ COMPILER ] + config: + install_tree: /opt/deps + view: /opt/view diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 1e71236386..31641aea69 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -1,3 +1,5 @@ +# appends -dev to the version upon release and opens pr +# CI won't run on generated PR, easiest workaround is to close + reopen on: release: types: [published] @@ -16,4 +18,4 @@ jobs: branch-suffix: timestamp # add a timestamp to branch name delete-branch: true # delete afer merge title: Append dev to version number post-release - body: automated change, adds '-dev' to the version number upon releases + body: automated change, adds '-dev' to the version number upon releases. This PR will need to be closed and reopened to run CI testing. diff --git a/CI.md b/CI.md index 225b25129b..89b4db256e 100644 --- a/CI.md +++ b/CI.md @@ -8,24 +8,30 @@ Required CI for pull requests are listed first. ## Pull Request CI and checks ### Build libFMS with autotools + Required GNU build test for all pull requests/pushes. Runs `make distcheck` after configuring via GNU autotools. +Runs on a container image with spack installed dependencies, on top a rocky linux base. + +Dockerfile for image is stored at .github/workflows/Dockerfile.gnu for more specific information on the CI environment. + Container environment: -gcc v7.3.0 -mpich v3.3a2 -netcdf v4.6.0 -netcdf-fortran v4.4.4 +gcc v12.3.0 +mpich v4.0.2 +netcdf v4.9.0 +netcdf-fortran v4.6.0 autoconf v2.69 +libyaml v0.2.5 -container hosted at [noaagfdl/ubuntu_libfms_gnu:latest](https://hub.docker.com/r/noaagfdl/ubuntu_libfms_gnu) - -`./configure` flags: -- `--enable-openmp` +`./configure` flags tested: - `--disable-openmp` - `--enable-mixed-mode` +- `--with-mpi=no` (disables unit testing) - `--disable-setting-flags` - `--with-yaml` +- `--enable-test-input=/home/unit_tests_input` + ### Build libfms with cmake Required GNU build test for all pull requests/pushes.