Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/workflows/spack-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Spack CI GCC Build

on:
pull_request:
types: [opened, synchronize, reopened]
# Do not run if the only files changed cannot affect the build
paths-ignore:
- "**.md"
- "**.pro"
- "**.sh"
- "**.perl"
- ".github/CODEOWNERS"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build_gcm:
name: Spack CI GCC Build
runs-on: ubuntu-24.04
steps:

- name: Checkout GCM
uses: actions/checkout@v4
with:
fetch-depth: 1
filter: blob:none
repository: GEOS-ESM/GEOSgcm

- name: Set all directories as git safe
run: |
git config --global --add safe.directory '*'

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Pip install mepo
run: |
python -m pip install --upgrade pip
pip install mepo
mepo --version

- name: Mepo clone external repos
run: |
ls
mepo clone --partial blobless
mepo status

- name: Mepo develop usual suspects
run: |
ls
mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared GEOS_Util
mepo status

- name: Debug PR branch
run: echo "PR is coming from ${{ github.event.pull_request.head.ref }}"

- name: Update other branches
if: ${{ github.event.pull_request.head.ref != 'main' && github.event.pull_request.head.ref != 'develop' }}
run: |
mepo checkout-if-exists ${GITHUB_HEAD_REF}
mepo status

- name: Set up Spack
uses: spack/setup-spack@v2
with:
ref: develop # Spack version (examples: develop, releases/v0.21)
color: true # Force color output (SPACK_COLOR=always)
path: spack # Where to clone Spack
buildcache: false # Do not use the spack buildcache

- name: Find compilers
shell: spack-bash {0}
run: |
spack compiler find

- name: Set default compiler and target
shell: spack-bash {0}
run: |
spack config add 'packages:all:compiler:[gcc@14.2.0]'
spack config add 'packages:all:require:target=x86_64_v3'

- name: Create Spack environment
shell: spack-bash {0}
run: |
spack env create spack-env
spack env activate spack-env

- name: Login
shell: spack-bash {0}
run: |
spack -e spack-env mirror add geos-buildcache oci://ghcr.io/GEOS-ESM/geos-buildcache
spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.BUILDCACHE_TOKEN }}" geos-buildcache
spack -e spack-env mirror list
spack -e spack-env buildcache update-index geos-buildcache
spack -e spack-env buildcache list --allarch

- name: Concretize
shell: spack-bash {0}
run: |
spack -e spack-env concretize

- name: Install
shell: spack-bash {0}
run: |
spack -e spack-env install --add --no-check-signature --use-buildcache only \
esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits openblas

- name: Build with Cmake
shell: spack-bash {0}
run: |
spack env activate spack-env
spack load \
esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits openblas
spack find --loaded
FC=gfortran-14 CC=gcc-14 CXX=g++-14
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX}
cmake --build build -j 4
cmake --install build

85 changes: 85 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build Tests

on:
pull_request:
types: [opened, synchronize, reopened]
# Do not run if the only files changed cannot affect the build
paths-ignore:
- "**.md"
- "**.pro"
- "**.sh"
- "**.perl"
- ".github/CODEOWNERS"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build_gcm:
name: Build GEOSgcm
if: "!contains(github.event.pull_request.labels.*.name, '0 diff trivial')"
runs-on: ubuntu-24.04
container:
image: gmao/ubuntu24-geos-env:v7.32.0-intelmpi_2021.13-ifort_2021.13
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
# It seems like we might not need secrets on GitHub Actions which is good for forked
# pull requests
#credentials:
#username: ${{ secrets.DOCKERHUB_USERNAME }}
#password: ${{ secrets.DOCKERHUB_TOKEN }}

env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none

steps:
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Checkout GCM
uses: actions/checkout@v4
with:
fetch-depth: 1
filter: blob:none
repository: GEOS-ESM/GEOSgcm

- name: Set all directories as git safe
run: |
git config --global --add safe.directory '*'

- name: Versions etc.
run: |
ifort --version
mpirun --version
echo $BASEDIR

- name: Mepo clone external repos
run: |
mepo clone --partial blobless
mepo status

- name: Mepo develop usual suspects
run: |
mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared GEOS_Util
mepo status

- name: Debug PR branch
run: echo "PR is coming from ${{ github.event.pull_request.head.ref }}"

- name: Update other branches
if: ${{ github.event.pull_request.head.ref != 'main' && github.event.pull_request.head.ref != 'develop' }}
run: |
mepo checkout-if-exists ${GITHUB_HEAD_REF}
mepo status

- name: CMake
run: |
cmake -B build -S . --install-prefix=${pwd}/install -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_BUILD_TYPE=Debug -DMPIEXEC_PREFLAGS='--oversubscribe' -DUSE_F2PY=OFF

- name: Build
run: |
cmake --build build -j 4
cmake --install build
62 changes: 31 additions & 31 deletions HISTORY.DATAATM.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COLLECTIONS: 'geosgcm_surf'
# 'geosgcm_ocn2d'
'geosgcm_ocn2dT'
'geosgcm_seaice'
>>>HIST_CICE4<<< 'geosgcm_icethm'
@HIST_CICE4 'geosgcm_icethm'
# 'geosgcm_aoflux'
# 'geosgcm_icecat'
# 'geosgcm_icesig'
Expand Down Expand Up @@ -76,41 +76,41 @@ PC@HIST_IMx@HIST_JM-DC.LM: @AGCM_LM
# geosgcm_seaice.frequency: 240000,
geosgcm_seaice.fields: 'UI' , 'SEAICE',
'VI' , 'SEAICE',
>>>HIST_CICE4<<< 'VEL' , 'SEAICE',
>>>HIST_CICE4<<< 'STRENGTH' , 'SEAICE',
>>>HIST_CICE4<<< 'SHEAR' , 'SEAICE',
>>>HIST_CICE4<<< 'DIVU' , 'SEAICE',
@HIST_CICE4 'VEL' , 'SEAICE',
@HIST_CICE4 'STRENGTH' , 'SEAICE',
@HIST_CICE4 'SHEAR' , 'SEAICE',
@HIST_CICE4 'DIVU' , 'SEAICE',
'HICE' , 'SEAICE',
>>>HIST_CICE4<<< 'HICE0' , 'SEAICE',
@HIST_CICE4 'HICE0' , 'SEAICE',
'HSNO' , 'SEAICE',
>>>HIST_CICE4<<< 'HSNO0' , 'SEAICE',
>>>HIST_CICE4<<< 'DRAFT' , 'SEAICE',
>>>HIST_CICE4<<< 'DRAFT0' , 'SEAICE',
@HIST_CICE4 'HSNO0' , 'SEAICE',
@HIST_CICE4 'DRAFT' , 'SEAICE',
@HIST_CICE4 'DRAFT0' , 'SEAICE',
'AICE' , 'SEAICE',
>>>HIST_CICE4<<< 'DVIDTD' , 'SEAICE',
>>>HIST_CICE4<<< 'DAIDTD' , 'SEAICE',
>>>HIST_CICE4<<< 'DVIRDGDT' , 'SEAICE',
>>>HIST_CICE4<<< 'STRCORX' , 'SEAICE',
>>>HIST_CICE4<<< 'STRCORY' , 'SEAICE',
>>>HIST_CICE4<<< 'STRTLTX' , 'SEAICE',
>>>HIST_CICE4<<< 'STRTLTY' , 'SEAICE',
>>>HIST_CICE4<<< 'STRINTX' , 'SEAICE',
>>>HIST_CICE4<<< 'STRINTY' , 'SEAICE',
>>>HIST_CICE4<<< 'TAUXOCNB' , 'SEAICE',
>>>HIST_CICE4<<< 'TAUYOCNB' , 'SEAICE',
>>>HIST_CICE4<<< 'TAUXI' , 'SEAICE',
>>>HIST_CICE4<<< 'TAUYI' , 'SEAICE',
>>>HIST_CICE4<<< 'TAUXIB' , 'SEAICE',
>>>HIST_CICE4<<< 'TAUYIB' , 'SEAICE',
@HIST_CICE4 'DVIDTD' , 'SEAICE',
@HIST_CICE4 'DAIDTD' , 'SEAICE',
@HIST_CICE4 'DVIRDGDT' , 'SEAICE',
@HIST_CICE4 'STRCORX' , 'SEAICE',
@HIST_CICE4 'STRCORY' , 'SEAICE',
@HIST_CICE4 'STRTLTX' , 'SEAICE',
@HIST_CICE4 'STRTLTY' , 'SEAICE',
@HIST_CICE4 'STRINTX' , 'SEAICE',
@HIST_CICE4 'STRINTY' , 'SEAICE',
@HIST_CICE4 'TAUXOCNB' , 'SEAICE',
@HIST_CICE4 'TAUYOCNB' , 'SEAICE',
@HIST_CICE4 'TAUXI' , 'SEAICE',
@HIST_CICE4 'TAUYI' , 'SEAICE',
@HIST_CICE4 'TAUXIB' , 'SEAICE',
@HIST_CICE4 'TAUYIB' , 'SEAICE',
'TAUXBOT' , 'SEAICE',
'TAUYBOT' , 'SEAICE',
>>>HIST_CICE4<<< 'UOCN' , 'SEAICE',
>>>HIST_CICE4<<< 'VOCN' , 'SEAICE',
>>>HIST_CICE4<<< 'SSH' , 'SEAICE',
>>>HIST_CICE4<<< 'SLV' , 'SEAICE',
>>>HIST_CICE4<<< 'AREA' , 'SEAICE',
>>>HIST_CICE4<<< 'FROCEAN' , 'SEAICE',
>>>HIST_CICE4<<< 'TMASK' , 'SEAICE',
@HIST_CICE4 'UOCN' , 'SEAICE',
@HIST_CICE4 'VOCN' , 'SEAICE',
@HIST_CICE4 'SSH' , 'SEAICE',
@HIST_CICE4 'SLV' , 'SEAICE',
@HIST_CICE4 'AREA' , 'SEAICE',
@HIST_CICE4 'FROCEAN' , 'SEAICE',
@HIST_CICE4 'TMASK' , 'SEAICE',
::

geosgcm_icethm.template: '%y4%m2%d2_%h2%n2z.nc4',
Expand Down
Loading