Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JEDI hashes to include Model Variable Renaming Sprint #1355

Merged
merged 19 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4dffe3a
add set -x to ci/driver.sh (#1313)
RussTreadon-NOAA Oct 30, 2024
00c49cd
add authorized user check to ci testing; use staged crtm fix in build…
RussTreadon-NOAA Nov 1, 2024
37d8cb1
Merge branch 'develop' into feature/resume_nightly
RussTreadon-NOAA Nov 1, 2024
04aac53
Merge branch 'develop' into feature/resume_nightly
RussTreadon-NOAA Nov 3, 2024
aef7bcc
Merge branch 'develop' into feature/resume_nightly
RussTreadon-NOAA Nov 11, 2024
bbb07ab
update jedi hashes in sorc/ using ush/submodules/update_develop.sh (#…
RussTreadon-NOAA Nov 11, 2024
dc4359b
update yamls to be consistent with model variable renaming sprint (#1…
RussTreadon-NOAA Nov 11, 2024
4561ead
update jcb-gdas hash to bring in changes from Model Variable Renaming…
RussTreadon-NOAA Nov 11, 2024
68bc5e2
Merge branch 'develop' into feature/resume_nightly
RussTreadon-NOAA Nov 13, 2024
beeee4c
update variable names in marine yamls, jcb-gdas, and gdas_soca_diag.h…
RussTreadon-NOAA Nov 13, 2024
937c3be
shorten lines to conform with c++ coding norms (#1362)
RussTreadon-NOAA Nov 13, 2024
d908c1f
replace tabs with whitespace to confirm with c++ coding norms (#1362)
RussTreadon-NOAA Nov 13, 2024
1747c0a
Merge branch 'develop' into feature/resume_nightly
RussTreadon-NOAA Nov 13, 2024
bab9f8b
Merge branch 'develop' into feature/resume_nightly
RussTreadon-NOAA Nov 14, 2024
5b8e1dd
update fv3-jedi hash (#1362)
RussTreadon-NOAA Nov 14, 2024
05d592d
update state variable names for soca letkf, add missing obs localizat…
RussTreadon-NOAA Nov 14, 2024
716dcdb
revert soca/obs/obs_list.yaml to previous version (turn off assimlati…
RussTreadon-NOAA Nov 14, 2024
13a5dc6
update jcb-gdas hash (#1362)
RussTreadon-NOAA Nov 15, 2024
4354873
update parm/jcb-gdas to point at develop (#1362)
RussTreadon-NOAA Nov 15, 2024
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
139 changes: 82 additions & 57 deletions ci/driver.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash --login

echo "Start at $(date)"

my_dir="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
echo "Set my_dir ${my_dir}"

# ==============================================================================
usage() {
Expand Down Expand Up @@ -51,79 +54,101 @@ esac
cd $GDAS_CI_ROOT/repo
CI_LABEL="${GDAS_CI_HOST}-RT"
gh pr list --label "$CI_LABEL" --state "open" | awk '{print $1;}' > $GDAS_CI_ROOT/open_pr_list

open_pr=`cat $GDAS_CI_ROOT/open_pr_list | wc -l`
if (( $open_pr == 0 )); then
echo "No open PRs with ${CI_LABEL}, exit."
echo "Finish at $(date)"
exit
fi

open_pr_list=$(cat $GDAS_CI_ROOT/open_pr_list)

# ==============================================================================
# clone, checkout, build, test, etc.
repo_url="https://github.com/NOAA-EMC/GDASApp.git"
# loop through all open PRs
for pr in $open_pr_list; do
gh pr edit $pr --remove-label $CI_LABEL --add-label ${CI_LABEL}-Running
echo "Processing Pull Request #${pr}"
echo " "
echo "Start processing Pull Request #${pr} at $(date)"

# get the branch name used for the PR
gdasapp_branch=$(gh pr view $pr --json headRefName -q ".headRefName")

# get the fork information
pr_details=$(gh pr view $pr --repo ${repo_url} --json headRepository,headRepositoryOwner,headRefName)

# extract the necessary info
fork_owner=$(gh pr view $pr --repo ${repo_url} --json headRepositoryOwner --jq '.headRepositoryOwner.login')
fork_name=$(gh pr view $pr --repo ${repo_url} --json headRepository --jq '.headRepository.name')

# construct the fork URL
gdasapp_url="https://github.com/$fork_owner/${fork_name}.git"
# get additional branch information
branch_owner=$(gh pr view $pr --repo ${repo_url} --json headRepositoryOwner --jq '.headRepositoryOwner.login')
branch_name=$(gh pr view $pr --repo ${repo_url} --json headRepository --jq '.headRepository.name')
pr_assignees=$(gh pr view $pr --repo ${repo_url} --json assignees --jq '.assignees[].login')

# check if any assignee is authorized to run CI
authorized_by=""
for str in ${pr_assignees[@]}; do
grep $str /scratch1/NCEPDEV/da/role.jedipara/CI/GDASApp/authorized_users
rc=$?
if (( rc == 0 )); then
authorized_by=${str}
echo "FOUND MATCH $str, rc $rc"
break
fi
done

# Authorized to run CI
if (( rc == 0 )); then
echo "Run CI"

# update PR label
gh pr edit $pr --remove-label $CI_LABEL --add-label ${CI_LABEL}-Running

# construct the fork URL
gdasapp_url="https://github.com/$branch_owner/${branch_name}.git"

echo "Fork URL: $gdasapp_url"
echo "Branch Name: $gdasapp_branch"

# create PR specific directory
if [ -d $GDAS_CI_ROOT/PR/$pr ]; then
rm -rf $GDAS_CI_ROOT/PR/$pr
fi
mkdir -p $GDAS_CI_ROOT/PR/$pr
cd $GDAS_CI_ROOT/PR/$pr

# clone copy of repo
git clone --recursive --jobs 8 --branch $gdasapp_branch $gdasapp_url
cd GDASApp

# checkout pull request
git pull
gh pr checkout $pr
git submodule update --init --recursive

# get commit hash
commit=$(git log --pretty=format:'%h' -n 1)
echo "$commit" > $GDAS_CI_ROOT/PR/$pr/commit

# load modules
case ${TARGET} in
hera | orion)
echo "Loading modules on $TARGET"
module purge
module use $GDAS_CI_ROOT/PR/$pr/GDASApp/modulefiles
module load GDAS/$TARGET
module list
;;
*)
echo "Unsupported platform. Exiting with error."
exit 1
;;
esac

# run build and testing command
$my_dir/run_ci.sh -d $GDAS_CI_ROOT/PR/$pr/GDASApp -o $GDAS_CI_ROOT/PR/$pr/output_${commit}
ci_status=$?
gh pr comment $pr --repo ${repo_url} --body-file $GDAS_CI_ROOT/PR/$pr/output_${commit}
if [ $ci_status -eq 0 ]; then
gh pr edit $pr --repo ${repo_url} --remove-label ${CI_LABEL}-Running --add-label ${CI_LABEL}-Passed
echo "GDASApp URL: $gdasapp_url"
echo "GDASApp branch Name: $gdasapp_branch"
echo "CI authorized by $authorized_by at $(date)"

# create PR specific directory
if [ -d $GDAS_CI_ROOT/PR/$pr ]; then
rm -rf $GDAS_CI_ROOT/PR/$pr
fi
mkdir -p $GDAS_CI_ROOT/PR/$pr
cd $GDAS_CI_ROOT/PR/$pr
pwd

# clone copy of repo
git clone --recursive --jobs 8 --branch $gdasapp_branch $gdasapp_url
cd GDASApp
pwd

# checkout GDASApp pull request
git pull
gh pr checkout $pr
git submodule update --init --recursive

# get commit hash
commit=$(git log --pretty=format:'%h' -n 1)
echo "$commit" > $GDAS_CI_ROOT/PR/$pr/commit

# run build and testing command
echo "Execute $my_dir/run_ci.sh for $GDAS_CI_ROOT/PR/$pr/GDASApp at $(date)"
$my_dir/run_ci.sh -d $GDAS_CI_ROOT/PR/$pr/GDASApp -o $GDAS_CI_ROOT/PR/$pr/output_${commit}
ci_status=$?
echo "After run_ci.sh with ci_status ${ci_status} at $(date)"
gh pr comment $pr --repo ${repo_url} --body-file $GDAS_CI_ROOT/PR/$pr/output_${commit}
if [ $ci_status -eq 0 ]; then
gh pr edit $pr --repo ${repo_url} --remove-label ${CI_LABEL}-Running --add-label ${CI_LABEL}-Passed
else
gh pr edit $pr --repo ${repo_url} --remove-label ${CI_LABEL}-Running --add-label ${CI_LABEL}-Failed
fi

# Not authorized to run CI
else
gh pr edit $pr --repo ${repo_url} --remove-label ${CI_LABEL}-Running --add-label ${CI_LABEL}-Failed
echo "Do NOT run CI"
fi

echo "Finish processing Pull Request #{pr} at $(date)"
done

# ==============================================================================
# scrub working directory for older files
find $GDAS_CI_ROOT/PR/* -maxdepth 1 -mtime +3 -exec rm -rf {} \;

echo "Finish at $(date)"
144 changes: 97 additions & 47 deletions ci/gw_driver.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash --login

echo "Start at $(date)"

my_dir="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
echo "Set my_dir ${my_dir}"

# ==============================================================================
usage() {
Expand Down Expand Up @@ -32,7 +35,7 @@ done

case ${TARGET} in
hera | orion)
echo "Running automated testing with workflow on $TARGET"
echo "Running Automated GW Testing on $TARGET"
source $MODULESHOME/init/sh
source $my_dir/${TARGET}.sh
module purge
Expand All @@ -51,69 +54,116 @@ esac
cd $GDAS_CI_ROOT/repo
CI_LABEL="${GDAS_CI_HOST}-GW-RT"
gh pr list --label "$CI_LABEL" --state "open" | awk '{print $1;}' > $GDAS_CI_ROOT/open_pr_list_gw

open_pr=`cat $GDAS_CI_ROOT/open_pr_list_gw | wc -l`
if (( $open_pr == 0 )); then
echo "No open PRs with ${CI_LABEL}, exit."
echo "Finish at $(date)"
exit
fi

open_pr_list=$(cat $GDAS_CI_ROOT/open_pr_list_gw)

# ==============================================================================
# clone, checkout, build, test, etc.
repo_url="https://github.com/NOAA-EMC/GDASApp.git"
workflow_url="https://github.com/NOAA-EMC/global-workflow.git"
workflow_branch="develop"
# loop through all open PRs
for pr in $open_pr_list; do
gh pr edit $pr --remove-label $CI_LABEL --add-label ${CI_LABEL}-Running
echo "Processing Pull Request #${pr}"
echo " "
echo "Start processing Pull Request #${pr} at $(date)"

# get the branch name used for the PR
gdasapp_branch=$(gh pr view $pr --json headRefName -q ".headRefName")

# check for a companion PR in the global-workflow
companion_pr_exists=$(gh pr list --repo ${workflow_url} --head ${gdasapp_branch} --state open)
if [ -n "$companion_pr_exists" ]; then
# get the PR number
companion_pr=$(echo "$companion_pr_exists" | awk '{print $1;}')

# extract the necessary info
fork_owner=$(gh pr view $companion_pr --repo $workflow_url --json headRepositoryOwner --jq '.headRepositoryOwner.login')
fork_name=$(gh pr view $companion_pr --repo $workflow_url --json headRepository --jq '.headRepository.name')

# Construct the fork URL
workflow_url="https://github.com/$fork_owner/$fork_name.git"

echo "Fork URL: $workflow_url"
echo "Branch Name: $gdasapp_branch"
fi

# create PR specific directory
if [ -d $GDAS_CI_ROOT/workflow/PR/$pr ]; then
rm -rf $GDAS_CI_ROOT/workflow/PR/$pr
fi
mkdir -p $GDAS_CI_ROOT/workflow/PR/$pr
cd $GDAS_CI_ROOT/workflow/PR/$pr
# get additional branch information
branch_owner=$(gh pr view $pr --repo ${repo_url} --json headRepositoryOwner --jq '.headRepositoryOwner.login')
branch_name=$(gh pr view $pr --repo ${repo_url} --json headRepository --jq '.headRepository.name')
pr_assignees=$(gh pr view $pr --repo ${repo_url} --json assignees --jq '.assignees[].login')

# check if any assignee is authorized to run CI
authorized_by=""
for str in ${pr_assignees[@]}; do
grep $str /scratch1/NCEPDEV/da/role.jedipara/CI/GDASApp/authorized_users
rc=$?
if (( rc == 0 )); then
authorized_by=${str}
echo "FOUND MATCH $str, rc $rc"
break
fi
done

# Authorized to run CI
if (( rc == 0 )); then
echo "Run CI"

# update PR label
gh pr edit $pr --remove-label $CI_LABEL --add-label ${CI_LABEL}-Running

# check for a companion PR in the global-workflow
companion_pr_exists=$(gh pr list --repo ${workflow_url} --head ${gdasapp_branch} --state open)
if [ -n "$companion_pr_exists" ]; then
# get the PR number
companion_pr=$(echo "$companion_pr_exists" | awk '{print $1;}')

# extract the necessary info
branch_owner=$(gh pr view $companion_pr --repo $workflow_url --json headRepositoryOwner --jq '.headRepositoryOwner.login')
branch_name=$(gh pr view $companion_pr --repo $workflow_url --json headRepository --jq '.headRepository.name')

# Construct fork URL. Update workflow branch name
workflow_url="https://github.com/$branch_owner/$branch_name.git"
workflow_branch=$gdasapp_branch

fi

echo "Workflow URL: $workflow_url"
echo "Workflow branch name: $workflow_branch"
echo "GDASApp branch name: $gdasapp_branch"
echo "CI authorized by $authorized_by at $(date)"

# create PR specific directory
if [ -d $GDAS_CI_ROOT/workflow/PR/$pr ]; then
rm -rf $GDAS_CI_ROOT/workflow/PR/$pr
fi
mkdir -p $GDAS_CI_ROOT/workflow/PR/$pr
cd $GDAS_CI_ROOT/workflow/PR/$pr
pwd

# clone global workflow develop branch
git clone --recursive --jobs 8 --branch dev/gdasapp $workflow_url

# checkout pull request
cd $GDAS_CI_ROOT/workflow/PR/$pr/global-workflow/sorc/gdas.cd
git checkout develop
git pull
gh pr checkout $pr
git submodule update --init --recursive

# get commit hash
commit=$(git log --pretty=format:'%h' -n 1)
echo "$commit" > $GDAS_CI_ROOT/workflow/PR/$pr/commit

$my_dir/run_gw_ci.sh -d $GDAS_CI_ROOT/workflow/PR/$pr/global-workflow -o $GDAS_CI_ROOT/workflow/PR/$pr/output_${commit}
ci_status=$?
gh pr comment $pr --body-file $GDAS_CI_ROOT/workflow/PR/$pr/output_${commit}
if [ $ci_status -eq 0 ]; then
gh pr edit $pr --remove-label ${CI_LABEL}-Running --add-label ${CI_LABEL}-Passed
# clone global workflow develop branch
git clone --recursive --jobs 8 --branch $workflow_branch $workflow_url

# checkout GDASApp pull request
cd $GDAS_CI_ROOT/workflow/PR/$pr/global-workflow/sorc/gdas.cd
git pull
gh pr checkout $pr
git submodule update --init --recursive

# get commit hash
commit=$(git log --pretty=format:'%h' -n 1)
echo "$commit" > $GDAS_CI_ROOT/workflow/PR/$pr/commit

# run build and testing command
echo "Execute $my_dir/run_gw_ci.sh for $GDAS_CI_ROOT/PR/workflow/PR/$pr/global-workflow at $(date)"
$my_dir/run_gw_ci.sh -d $GDAS_CI_ROOT/workflow/PR/$pr/global-workflow -o $GDAS_CI_ROOT/workflow/PR/$pr/output_${commit}
ci_status=$?
echo "After run_gw_ci.sh with ci_status ${ci_status} at $(date)"
gh pr comment $pr --body-file $GDAS_CI_ROOT/workflow/PR/$pr/output_${commit}
if [ $ci_status -eq 0 ]; then
gh pr edit $pr --remove-label ${CI_LABEL}-Running --add-label ${CI_LABEL}-Passed
else
gh pr edit $pr --remove-label ${CI_LABEL}-Running --add-label ${CI_LABEL}-Failed
fi

# Not authorized to run CI
else
gh pr edit $pr --remove-label ${CI_LABEL}-Running --add-label ${CI_LABEL}-Failed
echo "Do NOT run CI"
fi

echo "Finish processing Pull Request #{pr} at $(date)"
done

# ==============================================================================
# scrub working directory for older files
find $GDAS_CI_ROOT/workflow/PR/* -maxdepth 1 -mtime +3 -exec rm -rf {} \;

echo "Finish at $(date)"
4 changes: 2 additions & 2 deletions ci/run_ci.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#set -eu
set -u

# ==============================================================================
usage() {
Expand Down Expand Up @@ -61,7 +61,7 @@ module use $GDAS_MODULE_USE
module load GDAS/$TARGET
echo "---------------------------------------------------" >> $outfile
rm -rf log.ctest
ctest -E "manual" -R gdasapp --output-on-failure &>> log.ctest
ctest -R gdasapp --output-on-failure &>> log.ctest
ctest_status=$?
npassed=$(cat log.ctest | grep "tests passed")
if [ $ctest_status -eq 0 ]; then
Expand Down
4 changes: 2 additions & 2 deletions ci/run_gw_ci.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
#set -eu
set -u

# ==============================================================================
usage() {
Expand Down Expand Up @@ -31,7 +31,7 @@ done

# ==============================================================================
# start output file
echo "Automated Global-Workflow GDASApp Testing Results:" > $outfile
echo "Automated GW GDASApp Testing Results:" > $outfile
echo "Machine: ${TARGET}" >> $outfile
echo '```' >> $outfile
echo "Start: $(date) on $(hostname)" >> $outfile
Expand Down
2 changes: 1 addition & 1 deletion parm/io/fv3jedi_fieldmetadata_fv3inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ field metadata:
- long name: air_temperature
io name: T_inc

- long name: specific_humidity
- long name: water_vapor_mixing_ratio_wrt_moist_air
io name: sphum_inc

- long name: cloud_liquid_water
Expand Down
Loading
Loading