test-ufs-bundle-pcluster #233
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: test-ufs-bundle-pcluster | |
# Controls when the workflow will run | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
pull_request: | |
# pull request to develop | |
branches: [develop] | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
env: | |
JEDI_ENV: /home/ubuntu/ufs-bundle/jedi-run | |
jobs: | |
test-ufs-bundle: | |
runs-on: [ubuntu-ci-c6a-x86_64] | |
steps: | |
- name: cleanup | |
if: ${{ github.event_name == 'schedule' }} | |
run: | | |
# Remove and prepare run directory | |
rm -fr ${JEDI_ENV} | |
mkdir -p ${JEDI_ENV} | |
cd ${JEDI_ENV} | |
pwd | |
ls -lart | |
- name: checkout | |
uses: actions/checkout@v3 | |
# DH* Skip all this, since Skylab CI runs on same system and does that already | |
# | |
## Either this worked, or manually running the docker build as user ubuntu from | |
## the ravsamhq/notify-slack-action@v1 action below | |
#- name: ubuntu-docker | |
# run: | | |
# echo "Checking if user ubuntu can run docker" | |
# if id -nG ubuntu | grep -qw docker; then | |
# echo "User ubuntu already belongs to group docker" | |
# else | |
# echo "Adding user ubuntu to group docker" | |
# sudo gpasswd -a ubuntu docker | |
# newgrp docker | |
# docker run hello-world | |
# fi | |
# | |
#- name: set-credentials | |
# env: | |
# GH_USERNAME: ${{ secrets.JCSDABOT_USERNAME }} | |
# GH_TOKEN: ${{ secrets.JCSDABOT_TOKEN }} | |
# run: | | |
# # git config and credentials | |
# git config --global user.name "Luke Skywalker" | |
# git config --global user.email "luke@skywalker.org" | |
# git config --global credential.helper store | |
# touch ~/.git-credentials | |
# chmod 0700 ~/.git-credentials | |
# echo "https://$GH_USERNAME:$GH_TOKEN@github.com" > ~/.git-credentials | |
# *DH | |
- name: create-env-setup-script | |
run: | | |
# In run directory | |
cd ${JEDI_ENV} | |
cat <<EOF > setup.sh | |
#!/bin/bash | |
echo "Loading ufs-bundle environment using spack-stack-1.7.0" | |
ulimit -s unlimited | |
ulimit -c unlimited | |
source /etc/profile.d/modules.sh | |
source /opt/intel/oneapi/compiler/2023.2.3/env/vars.sh | |
source /opt/intel/oneapi/mpi/2021.10.0/env/vars.sh | |
module use /home/ubuntu/spack-stack/modulefiles | |
module load ecflow/5.11.4 | |
module use /home/ubuntu/spack-stack-1.7.0/envs/ue-intel-2021.10.0/install/modulefiles/Core/ | |
module load stack-intel/2021.10.0 | |
module load stack-intel-oneapi-mpi/2021.10.0 | |
module load stack-python/3.10.13 | |
module load sp/2.5.0 | |
module load awscli-v2 | |
module load jedi-ufs-env | |
module load fms/2023.04 | |
module li | |
export KMP_AFFINITY=compact | |
export KMP_STACKSIZE=2048m | |
export OMP_NUM_THREADS=1 | |
export I_MPI_FABRICS=shm | |
export I_MPI_DEBUG=5 | |
EOF | |
- name: clone-bundle | |
env: | |
UFS_BUNDLE_BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
run: | | |
# In run directory | |
cd ${JEDI_ENV} | |
# Set environment | |
source setup.sh | |
echo "Using branch ${UFS_BUNDLE_BRANCH_NAME} for ufs-bundle" | |
if [ -d ufs-bundle ] ; then | |
echo "Update existing copy of ufs-bundle" | |
cd ufs-bundle | |
git remote update | |
git checkout origin/${UFS_BUNDLE_BRANCH_NAME} | |
cd .. | |
else | |
echo "Check out a fresh copy of ufs-bundle" | |
git clone -b ${UFS_BUNDLE_BRANCH_NAME} https://github.com/jcsda/ufs-bundle | |
fi | |
### DO WE REALLY NEED THIS ??? rm -fr build-* | |
- name: build-atm | |
run: | | |
# In run directory | |
cd ${JEDI_ENV} | |
# Set environment | |
source setup.sh | |
mkdir -p build-atm | |
cd build-atm | |
cmake -DUFS_APP=ATM ../ufs-bundle | |
make update | |
make -j8 | |
# Runs mandatory ctests on the head node | |
rm -rf fv3-jedi/test/Data/ModelRunDirs/UFS_warmstart/* | |
rm -rf fv3-jedi/test/Data/ModelRunDirs/UFS_warmstart_2/* | |
ctest -V -R ufs_ | |
- name: build-atmaero | |
run: | | |
# In run directory | |
cd ${JEDI_ENV} | |
# Set environment | |
source setup.sh | |
mkdir -p build-atmaero | |
cd build-atmaero | |
cmake -DUFS_APP=ATMAERO ../ufs-bundle | |
make update | |
make -j8 | |
- name: build-ng-godas | |
run: | | |
# In run directory | |
cd ${JEDI_ENV} | |
# Set environment | |
source setup.sh | |
mkdir -p build-ng-godas | |
cd build-ng-godas | |
cmake -DUFS_APP=NG-GODAS ../ufs-bundle | |
make update | |
make -j8 | |
- name: build-s2s | |
run: | | |
# In run directory | |
cd ${JEDI_ENV} | |
# Set environment | |
source setup.sh | |
mkdir -p build-s2s | |
cd build-s2s | |
cmake -DUFS_APP=S2S ../ufs-bundle | |
make update | |
make -j8 | |
- name: Report Status | |
if: always() | |
uses: ravsamhq/notify-slack-action@v1 | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} | |
with: | |
# https://www.ravsam.in/blog/send-slack-notification-when-github-actions-fails/#getting-a-webhook-url | |
# https://www.ravsam.in/blog/collect-form-responses-using-google-apps-script | |
# https://github.com/marketplace/actions/notify-slack-action | |
status: ${{ job.status }} | |
notify_when: 'success,failure,warnings' | |
notification_title: '{workflow} has {status_message}' | |
message_format: '{emoji} *{workflow}* {status_message} for branch {branch} in <{repo_url}|{repo}>' | |
footer: ${{ github.event.pull_request.number || github.event_name || 'workflow dispatched manually' }} | |
# For testing: only notify user Dom | |
#mention_users: 'U02NLGXF5HV' | |
#mention_users_when: 'failure,warnings' | |
# Default: notify channel | |
mention_groups: '!channel' | |
mention_groups_when: 'failure,warnings' |