From 83a948eb058879bc9a24efb9d24d5cd679d61c2b Mon Sep 17 00:00:00 2001 From: MinsukJi-NOAA Date: Mon, 23 Nov 2020 09:43:52 -0500 Subject: [PATCH 1/6] Update ci to use latest hpc-stack container (#240, #277). Update actions deprecated set-env commands --- .github/workflows/manage.yml | 8 ++++---- modulefiles/linux.gnu/fv3 | 6 +++--- tests/ci/Dockerfile | 11 +++++------ tests/ci/ci.sh | 2 +- tests/utest | 6 +++--- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/manage.yml b/.github/workflows/manage.yml index 9f12a8f372..c933b36e64 100644 --- a/.github/workflows/manage.yml +++ b/.github/workflows/manage.yml @@ -22,15 +22,15 @@ jobs: tr_id=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py get_trigger_id) tr_br=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py get_trigger_br) check=$(cat ${GITHUB_EVENT_PATH} | ./json_helper.py check_skip) - echo "::set-env name=TRIGGER_ID::${tr_id}" - echo "::set-env name=TRIGGER_BR::${tr_br}" + echo "TRIGGER_ID=${tr_id}" >> $GITHUB_ENV + echo "TRIGGER_BR=${tr_br}" >> $GITHUB_ENV echo "skip-ci: ${check}" if [[ $check == yes ]]; then echo "skip-ci is requested" - echo '::set-env name=CURR_JOB::cancelled' + echo "CURR_JOB=cancelled" >> $GITHUB_ENV curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" ${repo}/$tr_id/cancel else - echo '::set-env name=CURR_JOB::running' + echo "CURR_JOB=running" >> $GITHUB_ENV fi - name: Cancel redundant jobs diff --git a/modulefiles/linux.gnu/fv3 b/modulefiles/linux.gnu/fv3 index d29365a290..c93e096e2c 100755 --- a/modulefiles/linux.gnu/fv3 +++ b/modulefiles/linux.gnu/fv3 @@ -26,7 +26,7 @@ export CMAKE_Fortran_COMPILER=${FC} ## ## use own NetCDF library ## -export NETCDF=${NETCDF:-/usr/local} +export NETCDF=${NETCDF:-/home/builder/opt} ## ## use SIONlib library if installed and environment variable is set @@ -41,10 +41,10 @@ fi ## ## use pre-compiled EMSF library for above compiler / MPI combination ## -export ESMFMKFILE=${ESMFMKFILE:-/usr/local/lib/esmf.mk} +export ESMFMKFILE=${ESMFMKFILE:-/home/builder/opt/lib/esmf.mk} ## ## NCEP libraries (need to download and build manually, see doc/README_{UBUNTU,CENTOS,...}.txt and https://github.com/NCAR/NCEPlibs) ## -export NCEPLIBS_DIR=${NCEPLIBS_DIR:-/usr/local/NCEPlibs} +export NCEPLIBS_DIR=${NCEPLIBS_DIR:-/home/builder/opt} export CMAKE_PREFIX_PATH=${NCEPLIBS_DIR} diff --git a/tests/ci/Dockerfile b/tests/ci/Dockerfile index bb28d78247..3a8bd8ebf0 100644 --- a/tests/ci/Dockerfile +++ b/tests/ci/Dockerfile @@ -1,11 +1,10 @@ -From minsukjinoaa/ci-test-base:ubuntu20.04-v3.5 -#From minsukjinoaa/ci-test-base:centos7-v3.5 +From noaaemc/ubuntu-hpc:v1 -ENV HOME=/home/tester -COPY --chown=tester:tester . $HOME/ufs-weather-model +ENV HOME=/home/builder +COPY --chown=builder:builder . $HOME/ufs-weather-model -USER tester -ENV USER=tester +USER builder +ENV USER=builder ARG test_name ARG build_case ENV test_name=$test_name diff --git a/tests/ci/ci.sh b/tests/ci/ci.sh index d332078e5f..f37cbde0f8 100755 --- a/tests/ci/ci.sh +++ b/tests/ci/ci.sh @@ -75,7 +75,7 @@ if [ $BUILD = "true" ]; then elif [ $RUN == "true" ]; then sudo docker run -d --rm -v DataVolume:/tmp minsukjinoaa/fv3-input-data:develop-20200713 - sudo docker run -d -e test_case=${TEST_CASE} -v DataVolume:/home/tester/data/NEMSfv3gfs/develop-20200713 --name my-container ${IMG_NAME} + sudo docker run -d -e test_case=${TEST_CASE} -v DataVolume:/home/builder/data/NEMSfv3gfs/develop-20201118 --name my-container ${IMG_NAME} echo 'cache,rss,shmem' >memory_stat sleep 3 diff --git a/tests/utest b/tests/utest index 230ca8c9f9..fb0c4102b1 100755 --- a/tests/utest +++ b/tests/utest @@ -482,7 +482,7 @@ elif [[ $MACHINE_ID = linux.* ]]; then PARTITION= QUEUE= COMPILE_QUEUE= - dprefix=/home/tester + dprefix=/home/builder DISKNM=${dprefix}/data STMP=${dprefix}/stmp4 PTMP=${dprefix}/stmp2 @@ -711,9 +711,9 @@ fi mkdir -p ${STMP}/${USER} NEW_BASELINE=${STMP}/${USER}/FV3_UT/UNIT_TEST if [[ $MACHINE_ID == hera.* || $MACHINE_ID == orion.* ]]; then - baseline_location=$DISKNM/NEMSfv3gfs/develop-20200713/${RT_COMPILER^^} + baseline_location=$DISKNM/NEMSfv3gfs/develop-20201118/${RT_COMPILER^^} else - baseline_location=$DISKNM/NEMSfv3gfs/develop-20200713 + baseline_location=$DISKNM/NEMSfv3gfs/develop-20201118 fi RTPWD=$baseline_location From 2eaea2e184bdebfd07bcce37194339e1720c5035 Mon Sep 17 00:00:00 2001 From: MinsukJi-NOAA Date: Mon, 23 Nov 2020 09:54:12 -0500 Subject: [PATCH 2/6] Modify rt_utils.sh to resolve #296 --- tests/rt_utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/rt_utils.sh b/tests/rt_utils.sh index 7a14e40f49..87fdbe23ec 100755 --- a/tests/rt_utils.sh +++ b/tests/rt_utils.sh @@ -273,7 +273,7 @@ check_results() { if [[ ${MACHINE_ID} =~ orion || ${MACHINE_ID} =~ hera || ${MACHINE_ID} =~ wcoss_dell_p3 || ${MACHINE_ID} =~ wcoss_cray ]]; then printf ".......ALT CHECK.." >> ${REGRESSIONTEST_LOG} printf ".......ALT CHECK.." - d=$( ${PATHRT}/compare_ncfile.py ${RTPWD}/${CNTL_DIR}/$i ${RUNDIR}/$i 2>/dev/null | wc -l ) + d=$( ${PATHRT}/compare_ncfile.py ${RTPWD}/${CNTL_DIR}/$i ${RUNDIR}/$i 2>&1 | wc -l ) fi fi From 465b475bc6a0a29e67b48493155a18f97ebf02f2 Mon Sep 17 00:00:00 2001 From: MinsukJi-NOAA Date: Mon, 23 Nov 2020 09:59:52 -0500 Subject: [PATCH 3/6] Temporary change to ci branch --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5301085819..8302d72ab0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,10 +3,10 @@ name: Pull Request Tests on: push: branches: - - develop + - ci-update pull_request: branches: - - develop + - ci-update jobs: setup: From 159d295e3831ecd75778e8d2b1337773a81bbfe0 Mon Sep 17 00:00:00 2001 From: MinsukJi-NOAA Date: Mon, 23 Nov 2020 18:31:32 -0500 Subject: [PATCH 4/6] Fix base container name in docker rmi command --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8302d72ab0..de92fadca9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: - name: Free up disk space run: | sudo docker rmi $(sudo docker image ls | grep -E -m1 '' | awk '{ print $3 }') - sudo docker rmi $(sudo docker image ls | awk '/ci-test-base/ { print $3 }') + sudo docker rmi $(sudo docker image ls | awk '/ubuntu-hpc/ { print $3 }') - name: Prepare artifacts run: | From 37f88683501098a9221142ab8be1457145819f3e Mon Sep 17 00:00:00 2001 From: MinsukJi-NOAA Date: Mon, 23 Nov 2020 21:13:27 -0500 Subject: [PATCH 5/6] Change actions branch to develop --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de92fadca9..4afd19b6e6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,10 +3,10 @@ name: Pull Request Tests on: push: branches: - - ci-update + - develop pull_request: branches: - - ci-update + - develop jobs: setup: From 03835ae000476280fd1a2023dbda8bb3f66e7af5 Mon Sep 17 00:00:00 2001 From: MinsukJi-NOAA Date: Tue, 24 Nov 2020 07:38:08 -0500 Subject: [PATCH 6/6] A bug fix in compile.sh --- tests/compile.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/compile.sh b/tests/compile.sh index 4300685133..0d0e80fbdc 100755 --- a/tests/compile.sh +++ b/tests/compile.sh @@ -160,7 +160,11 @@ export CMAKE_FLAGS bash -x ${PATHTR}/build.sh mv ${BUILD_DIR}/ufs_model ${PATHTR}/tests/${BUILD_NAME}.exe -cp ${PATHTR}/modulefiles/${MACHINE_ID}/fv3 ${PATHTR}/tests/modules.${BUILD_NAME} +if [[ "${MAKE_OPT}" == "DEBUG=Y" ]]; then + cp ${PATHTR}/modulefiles/${MACHINE_ID}/fv3_debug ${PATHTR}/tests/modules.${BUILD_NAME} +else + cp ${PATHTR}/modulefiles/${MACHINE_ID}/fv3 ${PATHTR}/tests/modules.${BUILD_NAME} +fi if [ $clean_after = YES ] ; then rm -rf ${BUILD_DIR}