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

github actions utest #169

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b476468
add ci-related files. update utest
MinsukJi-NOAA Jul 10, 2020
489bfc0
Merge remote-tracking branch 'upstream/develop' into feature/ContInteg
MinsukJi-NOAA Jul 16, 2020
dc13d67
modify to auto-run different cases based on ci.test
MinsukJi-NOAA Jul 16, 2020
2e3410e
update to the latest develop and make changes accordingly
MinsukJi-NOAA Aug 5, 2020
d13dd8c
Improve CI workflow
MinsukJi-NOAA Aug 6, 2020
cb8cefa
add clean-up after utest run
MinsukJi-NOAA Aug 6, 2020
27941d7
fix docker container and image delete
MinsukJi-NOAA Aug 6, 2020
4d60345
Merge remote-tracking branch 'upstream/develop' into feature/ContInteg
MinsukJi-NOAA Aug 31, 2020
83a51f2
use ci-test-base v3. modify utest to comply with recent weather changes
MinsukJi-NOAA Aug 31, 2020
cbe85e8
add workflow manage files
MinsukJi-NOAA Aug 31, 2020
499abe1
Add hera RT results
MinsukJi-NOAA Aug 31, 2020
2cf9f90
Add dell RT results. skip-ci
MinsukJi-NOAA Sep 1, 2020
f4c97c5
Add orion RT results. skip-ci
MinsukJi-NOAA Sep 1, 2020
d5d7984
Merge remote-tracking branch 'upstream/develop' into feature/ContInteg
MinsukJi-NOAA Sep 3, 2020
ab73f9f
move parsing in main.yml to a separate script file
MinsukJi-NOAA Sep 3, 2020
6b3b4b7
revert utest mpi test back to original setting. modify usage
MinsukJi-NOAA Sep 4, 2020
fb444d8
In utest change Hera queue, and Orion baseline location. skip-ci
MinsukJi-NOAA Sep 4, 2020
11fb6b5
Temporarily turn off restart test in actions
MinsukJi-NOAA Sep 8, 2020
c700269
Attach logs for Hera Regression tests and Unit tests. skip-ci
MinsukJi-NOAA Sep 8, 2020
c0e281b
Attach logs for Dell Regression tests and Unit tests. skip-ci
Sep 8, 2020
a4ab091
Attach logs for Orion Regression tests and Unit tests. skip-ci
MinsukJi-NOAA Sep 8, 2020
7caa213
Change actions workflow branch name to develop
MinsukJi-NOAA Sep 8, 2020
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dockerfile
.git
.gitignore
tests/*.log
tests/log_ut_linux.gnu
121 changes: 121 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Pull Request Tests

on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
setup:
name: Set up
runs-on: ubuntu-latest

outputs:
tn: ${{ steps.parse.outputs.tn }}
bld: ${{ steps.parse.outputs.bld }}
test: ${{ steps.parse.outputs.test }}
img: ${{ steps.parse.outputs.img }}

steps:
- name: Checkout codes
uses: actions/checkout@v2

- name: Parse cases
id: parse
run: |
cd ${GITHUB_WORKSPACE}/tests/ci
parsed_output=( $(./parse.sh) )
name_=${parsed_output[0]}
bld_=${parsed_output[1]}
test_=${parsed_output[2]}
img_=${parsed_output[3]}

echo "::set-output name=tn::$name_"
echo "::set-output name=bld::$bld_"
echo "::set-output name=test::$test_"
echo "::set-output name=img::$img_"

echo "test name : $name_"
echo "build set : $bld_"
echo "test set : $test_"
echo "image name: $img_"

build:
name: Build (${{ matrix.bld_set }})
needs: setup
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.bld) }}

steps:
- name: Checkout codes
uses: actions/checkout@v2
with:
submodules: recursive

- name: Build
run: |
printf '{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json >/dev/null
sudo systemctl restart docker
sleep 10
cd tests/ci && ./ci.sh -n ${{ needs.setup.outputs.tn }} -b ${{ matrix.bld_set }}

- name: Free up disk space
run: |
sudo docker rmi $(sudo docker image ls | grep -E -m1 '<none>' | awk '{ print $3 }')
sudo docker rmi $(sudo docker image ls | awk '/ci-test-base/ { print $3 }')

- name: Prepare artifacts
run: |
cd tests/ci
sudo docker save ${{ needs.setup.outputs.img }} | gzip >${{ needs.setup.outputs.img }}.tar.gz
tar cvjf artifact.tar.bz2 ${{ needs.setup.outputs.img }}.tar.gz ci.sh ci.test

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.bld_set }}.artifact.tar.bz2
path: tests/ci/artifact.tar.bz2

utest:
name: Unit test (${{ needs.setup.outputs.tn }}, ${{ matrix.test_set }})
needs: [setup,build]
runs-on: ubuntu-latest
#runs-on: self-hosted

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.test) }}

steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ${{ matrix.artifact }}.artifact.tar.bz2

- name: Prepare artifacts
run: |
tar xvjf artifact.tar.bz2 && rm -f artifact.tar.bz2
sudo docker load --input ${{ needs.setup.outputs.img }}.tar.gz && rm -f ${{ needs.setup.outputs.img }}.tar.gz

- name: Run utest
run: ./ci.sh -n ${{ needs.setup.outputs.tn }} -r ${{ matrix.test_set }}

- name: Upload memory usage file
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: memory_stat_${{ matrix.test_set }}
path: memory_stat

- name: Clean up
if: ${{ always() }}
run: |
rm -f ci.sh ci.test
sudo docker rm my-container && sudo docker rmi ${{ needs.setup.outputs.img }}:latest
sudo docker volume rm DataVolume
54 changes: 54 additions & 0 deletions .github/workflows/manage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Manage workflows

on:
workflow_run:
workflows: ["Pull Request Tests"]
types:
- requested

jobs:
job1:
name: Job 1
runs-on: ubuntu-latest

steps:
- name: Checkout codes
uses: actions/checkout@v2

- name: Check if skip-ci is requested
run: |
cd ${GITHUB_WORKSPACE}/tests/ci
repo="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/runs"
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 "skip-ci: ${check}"
if [[ $check == yes ]]; then
echo "skip-ci is requested"
echo '::set-env name=CURR_JOB::cancelled'
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'
fi

- name: Cancel redundant jobs
run: |
echo "CURR_JOB is $CURR_JOB"
echo "TRIGGER_ID is $TRIGGER_ID"
echo "TRIGGER_BR is $TRIGGER_BR"
export GITHUB_ACTOR
export GITHUB_RUN_ID
export TRIGGER_ID
export TRIGGER_BR
cd ${GITHUB_WORKSPACE}/tests/ci
repo="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/runs"
cancel_ids=$(curl -H "Accept: application/vnd.github.v3+json" ${repo} | ./json_helper.py cancel_workflow)
echo "cancel ids: $cancel_ids"
if [[ $cancel_ids != '' ]]; then
for i in $cancel_ids; do
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" ${repo}/$i/cancel
done
fi
if: ${{ env.CURR_JOB == 'running' }}
29 changes: 29 additions & 0 deletions modulefiles/linux.gnu/fv3
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ export F77=${F77:-mpif77}
export F90=${F90:-mpif90}
export FC=${FC:-mpif90}

##
## set up variables for ../cmake/configure_linux.gnu.cmake
##
export CMAKE_Platform=linux.gnu
export CMAKE_C_COMPILER=${CC}
export CMAKE_CXX_COMPILER=${CXX}
export CMAKE_Fortran_COMPILER=${FC}

##
## use own NetCDF library
##
export NETCDF=${NETCDF:-/usr/local}

##
## use SIONlib library if installed and environment variable is set
##
Expand All @@ -24,3 +37,19 @@ if [ ! "x$SIONLIB" == "x" ]; then
export SIONLIB_INC="-I${SIONLIB}/include -I${SIONLIB}/include/mod_64"
export SIONLIB_LIB="-L${SIONLIB}/lib -lsionmpi_f90_64 -lsionser_f90_64 -lsionmpi_64 -lsiongen_64 -lsionser_64 -lsioncom_64 -lsioncom_64_lock_none"
fi

##
## use pre-compiled EMSF library for above compiler / MPI combination
##
export ESMFMKFILE=${ESMFMKFILE:-/usr/local/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 bacio_DIR=${NCEPLIBS_DIR}/bacio-2.4.0
export nemsio_DIR=${NCEPLIBS_DIR}/nemsio-2.5.1
export w3nco_DIR=${NCEPLIBS_DIR}/w3nco-2.4.0
export sp_DIR=${NCEPLIBS_DIR}/sp-2.3.0
export w3emc_DIR=${NCEPLIBS_DIR}/w3emc-2.7.0
export sigio_DIR=${NCEPLIBS_DIR}/sigio-2.3.0
Loading