Skip to content

Commit

Permalink
Merge pull request #640 from JCSDA-internal/release/mpas-1.0
Browse files Browse the repository at this point in the history
Release/mpas 1.0
  • Loading branch information
byoung-joo authored Sep 21, 2021
2 parents 2649499 + 41b94c8 commit e0780d1
Show file tree
Hide file tree
Showing 355 changed files with 48,292 additions and 3,758 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.nc filter=lfs diff=lfs merge=lfs -text
*.graph.info* filter=lfs diff=lfs merge=lfs -text
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Use this template to give a detailed message describing the change you want to make to the code.
If you are unclear on what should be written here, see https://github.com/wrf-model/WRF/wiki/Making-a-good-pull-request-message for more guidance

The title of this pull request should be a brief "purpose" for this change.

--- Delete this line and those above before hitting "Create pull request" ---

TYPE: choose one of [bug fix, maintenance, enhancement, new feature, feature removed, no impact, text only]

DESCRIPTION OF CHANGES: One or more paragraphs describing problem, solution, and required changes.

ISSUE: For use when this PR closes a Zenhub issue. E.g., for issue number 123,

Fixes #123


LIST OF MODIFIED FILES: list of changed files (use `git diff --name-status develop` to get formatted list)

TESTS CONDUCTED: Explicitly state what testing was performed.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore these files anywhere in the tree
*.pyc
83 changes: 83 additions & 0 deletions CI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# (C) Copyright 2017-2020 UCAR
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.

#
# MPAS/JEDI bundle
#

cmake_minimum_required( VERSION 3.12 )
project( mpas-bundle VERSION 1.0.0 LANGUAGES C CXX Fortran )

## ECBuild integration
include(GNUInstallDirs)
set( INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING "Library installation directory" FORCE ) #Force ecbuild to use the default platform lib install location
set( ECBUILD_DEFAULT_BUILD_TYPE Release CACHE STRING "ECBuild default build type" FORCE)
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
find_package(ecbuild)
include( ecbuild_bundle )
ecbuild_bundle_initialize()

ecbuild_bundle( PROJECT jedicmake GIT "https://github.com/jcsda-internal/jedi-cmake.git" )

# ecmwf repos are already available in CI containers. Disabled here
#option(BUNDLE_SKIP_ECKIT "Don't build eckit" "OFF" ) # Build eckit unless user passes -DBUNDLE_SKIP_ECKIT=ON
#ecbuild_bundle( PROJECT eckit GIT "https://github.com/ecmwf/eckit.git" )
#ecbuild_bundle( PROJECT fckit GIT "https://github.com/ecmwf/fckit.git" )
#ecbuild_bundle( PROJECT atlas GIT "https://github.com/ecmwf/atlas.git" )

#TODO: When mpas-bundle becomes a public repo, consider changing the default value of BUNDLE_SKIP_ROPP-UFO to "ON"

option(BUNDLE_SKIP_ROPP-UFO "Don't build ROPP-UFO" "OFF") # Skip ropp-ufo build unless user passes -DBUNDLE_SKIP_ROPP-UFO=ON
ecbuild_bundle( PROJECT ropp-ufo GIT "https://github.com/jcsda-internal/ropp-test.git" )
option(BUNDLE_SKIP_GSW "Don't build GSW" "ON") # Skip gsw build unless user passes -DBUNDLE_SKIP_GSW=OFF
ecbuild_bundle( PROJECT gsw GIT "https://github.com/jcsda-internal/GSW-Fortran.git" )
ecbuild_bundle( PROJECT crtm GIT "https://github.com/jcsda-internal/crtm.git" )
ecbuild_bundle( PROJECT rttov GIT "https://github.com/jcsda-internal/rttov.git" )
ecbuild_bundle( PROJECT oops GIT "https://github.com/jcsda-internal/oops.git" )
ecbuild_bundle( PROJECT saber GIT "https://github.com/jcsda-internal/saber.git" )
ecbuild_bundle( PROJECT ioda GIT "https://github.com/jcsda-internal/ioda.git" )
ecbuild_bundle( PROJECT ufo GIT "https://github.com/jcsda-internal/ufo.git" )

# ioda and ufo test data
#---------------------------------

# If IODA branch is being built set GIT_BRANCH_FUNC to IODA's current branch.
# If a tagged version of IODA is being built set GIT_TAG_FUNC to ioda's current tag. In this case,
# IODA test files will be download from UCAR DASH and ioda-data repo will not be cloned.
# When LOCAL_PATH_JEDI_TESTFILES is set to the directory of IODA test files stored
# in a local directory, ioda-data repo will not be cloned

#find_branch_name(REPO_DIR_NAME ioda)
# When LOCAL_PATH_JEDI_TESTFILES is set to the directory of IODA test files stored
# in a local directory, ioda-data repo will not be cloned
#if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} )
# ecbuild_bundle( PROJECT ioda-data GIT "https://github.com/JCSDA-internal/ioda-data.git" BRANCH develop UPDATE )
#endif()

# same procedure for ufo-data
find_branch_name(REPO_DIR_NAME ufo)
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} )
ecbuild_bundle( PROJECT ufo-data GIT "https://github.com/JCSDA-internal/ufo-data.git" BRANCH develop UPDATE )
endif()

# same procedure for mpas-jedi-data
find_branch_name(REPO_DIR_NAME mpas-jedi)
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} )
ecbuild_bundle( PROJECT mpas-jedi-data GIT "https://github.com/JCSDA-internal/mpas-jedi-data.git" )
endif()


set(MPAS_CORES atmosphere init_atmosphere CACHE STRING "MPAS-Model: cores to build.")
set(MPAS_DOUBLE_PRECISION "ON" CACHE STRING "MPAS-Model: Use double precision 64-bit Floating point.")

ecbuild_bundle( PROJECT MPAS GIT "https://github.com/jcsda-internal/MPAS-Model.git" )
ecbuild_bundle( PROJECT mpas-jedi GIT "https://github.com/jcsda-internal/mpas-jedi")

ecbuild_bundle_finalize()

include(cmake/cdash-integration.cmake)
include(CTest)
160 changes: 160 additions & 0 deletions CI/buildspec_clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
version: 0.2

env:
parameter-store:
GIT_USER: "/CodeBuild/Git_USER"
GIT_PASS: "/CodeBuild/Git_PASS"

phases:
install:
commands:
- echo Executing install phase
- echo $CODEBUILD_RESOLVED_SOURCE_VERSION
- echo $CODEBUILD_SOURCE_REPO_URL
- echo $CODEBUILD_SOURCE_VERSION

- echo $CODEBUILD_WEBHOOK_MERGE_COMMIT
- echo $CODEBUILD_WEBHOOK_PREV_COMMIT
- echo $CODEBUILD_WEBHOOK_HEAD_REF
- echo $CODEBUILD_WEBHOOK_ACTOR_ACCOUNT_ID
- echo $CODEBUILD_WEBHOOK_EVENT
- echo $CODEBUILD_WEBHOOK_TRIGGER
- echo $CODEBUILD_WEBHOOK_BASE_REF

# Codebuild only runs on PUSH events if HEAD_REF
# is refs/heads/develop (merge to develop). In this
# case CODEBUILD_GIT_BRANCH="develop"

- if [ "$CODEBUILD_WEBHOOK_EVENT" = "PUSH" ];
then export CODEBUILD_GIT_BRANCH="develop";
echo "Merging to develop";
else export CODEBUILD_GIT_BRANCH=${CODEBUILD_WEBHOOK_HEAD_REF#refs/heads/};
fi

- echo "CODEBUILD_GIT_BRANCH=${CODEBUILD_GIT_BRANCH}"
- echo "CODEBUILD_SOURCE_VERSION=${CODEBUILD_SOURCE_VERSION}"

pre_build:
commands:
- echo Executing pre_build phase
- mkdir /build_container
- mkdir /jcsda
- git lfs install # creates .gitconfig

# Set crtm branch name
- export CRTM_JEDI_BRANCH="release/crtm_jedi"

- if [ "$CODEBUILD_GIT_BRANCH" = "develop" ];
then export CODEBUILD_GIT_BRANCH_FORK="release-stable";
export CODEBUILD_GIT_BRANCH_CRTM=${CRTM_JEDI_BRANCH};
else export CODEBUILD_GIT_BRANCH_FORK=${CODEBUILD_GIT_BRANCH};
export CODEBUILD_GIT_BRANCH_CRTM=${CODEBUILD_GIT_BRANCH};
echo "CODEBUILD_GIT_BRANCH_FORK=${CODEBUILD_GIT_BRANCH_FORK}";
fi

# Upload branch name and commit sha as CodeBuild artifact to S3
- mkdir -p /jcsda/artifacts
- echo ${CODEBUILD_GIT_BRANCH} > /jcsda/artifacts/branch_name.txt
- echo ${CODEBUILD_RESOLVED_SOURCE_VERSION} > /jcsda/artifacts/commit_sha.txt

- cd CI

## jedi core repos
# oops
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/oops $CODEBUILD_GIT_BRANCH oops /jcsda/mpas-bundle develop

# saber
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/saber $CODEBUILD_GIT_BRANCH saber /jcsda/mpas-bundle develop

# ioda
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/ioda $CODEBUILD_GIT_BRANCH ioda /jcsda/mpas-bundle develop

# ufo
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/ufo $CODEBUILD_GIT_BRANCH ufo /jcsda/mpas-bundle develop

# crtm
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/crtm $CODEBUILD_GIT_BRANCH_CRTM crtm /jcsda/mpas-bundle $CRTM_JEDI_BRANCH

## internal repos
# mpas-model
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/MPAS-Model $CODEBUILD_GIT_BRANCH_FORK MPAS /jcsda/mpas-bundle release-stable

# mpas-jedi
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/mpas-jedi $CODEBUILD_GIT_BRANCH mpas-jedi /jcsda/mpas-bundle develop

# mpas-jedi-data
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/mpas-jedi-data $CODEBUILD_GIT_BRANCH mpas-jedi-data /jcsda/mpas-bundle develop

# jedi-cmake
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/jedi-cmake $CODEBUILD_GIT_BRANCH jedicmake /jcsda/mpas-bundle develop

# ropp
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/ropp-test $CODEBUILD_GIT_BRANCH ropp-ufo /jcsda/mpas-bundle develop

# rttov
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/rttov $CODEBUILD_GIT_BRANCH rttov /jcsda/mpas-bundle develop

# ufo-test
- ./clone.sh $GIT_USER $GIT_PASS jcsda-internal/ufo-data $CODEBUILD_GIT_BRANCH ufo-data /jcsda/mpas-bundle develop

# move CMakeLists.txt
- cp CMakeLists.txt /jcsda/mpas-bundle
- cp -r cmake /jcsda/mpas-bundle/
# cdash upload setup
- cp /jcsda/mpas-bundle/cmake/CTestConfig.cmake /jcsda/mpas-bundle

build:
on-failure: CONTINUE
commands:
- echo Executing build phase
- echo $CODEBUILD_BUILD_SUCCEEDING
- export BUILD_STATUS="0"
- echo $BUILD_STATUS

# configure and build
- cd /build_container

- ecbuild -Wno-dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCDASH_OVERRIDE_GIT_BRANCH=$CODEBUILD_GIT_BRANCH -DCTEST_UPDATE_VERSION_ONLY=FALSE /jcsda/mpas-bundle/
- ls /build_container
- cd /build_container/mpas-jedi
- cp ../DartConfiguration.tcl .
- sed -i 's/mpas-bundle/mpas-bundle\/mpas-jedi/' DartConfiguration.tcl
- sed -i 's/build_container/build_container\/mpas-jedi/' DartConfiguration.tcl
- cat DartConfiguration.tcl

- make -j4

- if [ "$CODEBUILD_BUILD_SUCCEEDING" = "1" ];
then export BUILD_STATUS="1";
echo "Build passed";
fi
- echo $BUILD_STATUS

- cd /build_container/mpas-jedi
- ctest -C RelWithDebInfo -D ExperimentalTest -E compare_mpasjedi_hofx

finally:
- cd /build_container/mpas-jedi
- ctest -C RelWithDebInfo -D ExperimentalSubmit -M Continuous -- --track Continuous --group Continuous

post_build:
commands:
- echo Executing post_build phase
- echo $CODEBUILD_BUILD_SUCCEEDING
- echo $BUILD_STATUS

# upload find cdash url and upload it as CodeBuild artifact to S3
- if [ "$BUILD_STATUS" = "1" ];
then echo "Build & tests passed, find cdash url";
bash /jcsda/mpas-bundle/mpas-jedi/CI/cdash-url.sh /build_container/mpas-jedi/Testing;
url=$(bash /jcsda/mpas-bundle/mpas-jedi/CI/cdash-url.sh /build_container/mpas-jedi/Testing);
echo $url;
echo ${url} > /jcsda/artifacts/cdash-url.txt;
cat /jcsda/artifacts/cdash-url.txt;
else echo "Build failed";
fi

artifacts:
files:
- '/jcsda/artifacts/*'
name: mpas-clang-url
Loading

0 comments on commit e0780d1

Please sign in to comment.