Skip to content

Commit

Permalink
Merge branch 'develop' into feature_2206_fair_crps_to_ecnt
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Linden committed Sep 12, 2022
2 parents 32c060a + 98fecaf commit 8db8ce8
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/jobs/build_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CMD_LOGFILE=${GITHUB_WORKSPACE}/docker_build.log
time_command docker build -t ${DOCKERHUB_TAG} \
--build-arg SOURCE_BRANCH \
--build-arg MET_BASE_REPO \
--build-arg MET_BASE_IMAGE \
--build-arg MET_BASE_TAG \
-f $DOCKERFILE_PATH ${GITHUB_WORKSPACE}
if [ $? != 0 ]; then
cat ${GITHUB_WORKSPACE}/docker_build.log
Expand Down
6 changes: 3 additions & 3 deletions .github/jobs/set_job_controls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run_unit_tests=false
run_diff=false
run_update_truth=false
met_base_repo=met-base
met_base_image=v1.0
met_base_tag=v1.1
input_data_version=develop
truth_data_version=develop

Expand Down Expand Up @@ -114,7 +114,7 @@ echo ::set-output name=run_unit_tests::$run_unit_tests
echo ::set-output name=run_diff::$run_diff
echo ::set-output name=run_update_truth::$run_update_truth
echo ::set-output name=met_base_repo::$met_base_repo
echo ::set-output name=met_base_image::$met_base_image
echo ::set-output name=met_base_tag::$met_base_tag
echo ::set-output name=input_data_version::$input_data_version
echo ::set-output name=truth_data_version::$truth_data_version

Expand All @@ -124,7 +124,7 @@ echo run_unit_tests: $run_unit_tests
echo run_diff: $run_diff
echo run_update_truth: $run_update_truth
echo met_base_repo: $met_base_repo
echo met_base_image: $met_base_image
echo met_base_tag: $met_base_tag
echo input_data_version: $input_data_version
echo truth_data_version: $truth_data_version

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_docker_and_trigger_metplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
env:
SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }}-lite
MET_BASE_REPO: met-base
MET_BASE_IMAGE: v1.0
MET_BASE_TAG: v1.1

- name: Push Docker Image
run: .github/jobs/push_docker_image.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run_diff: ${{ steps.job_status.outputs.run_diff }}
run_update_truth: ${{ steps.job_status.outputs.run_update_truth }}
met_base_repo: ${{ steps.job_status.outputs.met_base_repo }}
met_base_image: ${{ steps.job_status.outputs.met_base_image }}
met_base_tag: ${{ steps.job_status.outputs.met_base_tag }}
branch_name: ${{ steps.job_status.outputs.branch_name }}
truth_data_version: ${{ steps.job_status.outputs.truth_data_version }}
input_data_version: ${{ steps.job_status.outputs.input_data_version }}
Expand All @@ -76,7 +76,7 @@ jobs:
env:
SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }}
MET_BASE_REPO: ${{ needs.job_control.outputs.met_base_repo }}
MET_BASE_IMAGE: ${{ needs.job_control.outputs.met_base_image }}
MET_BASE_TAG: ${{ needs.job_control.outputs.met_base_tag }}

- name: Copy Docker build log into logs directory
if: always()
Expand Down
5 changes: 5 additions & 0 deletions docs/Contributors_Guide/coding_standards.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
****************
Coding Standards
****************

Coming Soon!
17 changes: 17 additions & 0 deletions docs/Contributors_Guide/continuous_integration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
**********************
Continuous Integration
**********************

Coming Soon!

Overview
========


Keywords
========


Upstream Testing
================

14 changes: 14 additions & 0 deletions docs/Contributors_Guide/dev_env.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
***********************
Development Environment
***********************

Coming Soon!

Setting Up the Environment
==========================



Autoconf Version
================

5 changes: 5 additions & 0 deletions docs/Contributors_Guide/dockerhub.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*********
DockerHub
*********

Coming Soon!
6 changes: 6 additions & 0 deletions docs/Contributors_Guide/documentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*************
Documentation
*************

Coming Soon!

5 changes: 5 additions & 0 deletions docs/Contributors_Guide/github_workflow.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
***************
GitHub Workflow
***************

Coming Soon!
5 changes: 5 additions & 0 deletions docs/Contributors_Guide/templates.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*********
Templates
*********

Coming Soon!
15 changes: 15 additions & 0 deletions docs/Contributors_Guide/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*******
Testing
*******

Coming Soon!

make test
=========


Unit Tests
==========

Regression Tests
================
5 changes: 5 additions & 0 deletions docs/Contributors_Guide/user_support.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
************
User Support
************

Coming Soon!
2 changes: 1 addition & 1 deletion docs/Users_Guide/grid-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Grid-Stat Tool
Introduction
============

The Grid-Stat tool functions in much the same way as the Point-Stat tool, except that the verification statistics it calculates are for a matched forecast-observation grid (as opposed to a set of observation points). Neither the forecast nor the observation grid needs to be identical to the final matched grid; If the forecast grid is different than the final matched grid, then forecast values are regridded (interpolated) to the final matched grid. The same is done for observations, if desired. No regridding is necessary if the forecast and observation grids are identical but remains optional. The interpolation parameters may be used to perform a smoothing operation on the forecast and observation fields prior to verification. All the matched forecast-observation grid points are used to compute the verification statistics. In addition to traditional verification approaches, the Grid-Stat tool includes Fourier decompositions, gradient statistics, distance metrics, and neighborhood methods, designed to examine forecast performance as a function of spatial scale.
The Grid-Stat tool functions in much the same way as the Point-Stat tool, except that the verification statistics it calculates are for a matched forecast-observation grid (as opposed to a set of observation points). Neither the forecast nor the observation grid needs to be identical to the final matched grid. If the forecast grid is different from the final matched grid, then forecast values are regridded (interpolated) to the final matched grid. The same procedure is followed for observations. No regridding is necessary if the forecast and observation grids are identical but remains optional. A smoothing operation may be performed on the forecast and observation fields prior to verification. All the matched forecast-observation grid points are used to compute the verification statistics. In addition to traditional verification approaches, the Grid-Stat tool includes Fourier decompositions, gradient statistics, distance metrics, and neighborhood methods, designed to examine forecast performance as a function of spatial scale.

Scientific and statistical aspects of the Grid-Stat tool are briefly described in this section, followed by practical details regarding usage and output from the tool.

Expand Down
4 changes: 2 additions & 2 deletions internal/scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG MET_BASE_REPO=met-base
ARG MET_BASE_IMAGE=v1.0
ARG MET_BASE_TAG=v1.1

FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_IMAGE}
FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_TAG}
MAINTAINER John Halley Gotway <johnhg@ucar.edu>

#
Expand Down
6 changes: 3 additions & 3 deletions internal/scripts/docker/Dockerfile.copy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG MET_BASE_REPO=met-base
ARG MET_BASE_IMAGE=v1.0
ARG MET_BASE_REPO=met-base-unit-test
ARG MET_BASE_TAG=v1.1

FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_IMAGE}
FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_TAG}
MAINTAINER John Halley Gotway <johnhg@ucar.edu>

#
Expand Down
69 changes: 54 additions & 15 deletions internal/scripts/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,76 @@
# How to Use Dockerfiles
How to Use Dockerfiles
======================

Run all of the Docker commands from the top-level directory of the MET repository
GitHub actions are triggered for Pull Requests to the "develop" and "main_v*"
branches and for pushes to the branches "feature_*", "bugfix_*", "develop",
"develop-ref", and "main_v*" created in this repository to automatically build
images from these Dockerfiles and push them to DockerHub repositories. The
MET Docker image is used in Dockerfiles in the METplus wrappers component
repository for testing.

## Build MET from clone
Descriptions of the Dockerfiles in this directory are provided below. Sample
commands for building these Docker images locally are also provided. Please
note that these commands should be run from the top-level directory of
the MET repository.

1. The first example below shows how to manually build a MET Docker image
using code that is cloned from the
[MET GitHub repository](https://github.com/dtcenter/MET/) and using a Docker
image for the base compilation environment for MET from the
[dtcenter/met-base](https://hub.docker.com/repository/docker/dtcenter/met-base)
DockerHub repository. It uses `Dockerfile`, which checks out MET from GitHub,
compiles the specified branch or tag from source, sets a working directory,
downloads and installs GhostScript fonts, and deletes the MET source code for
tagged releases matching "v"*. Tagged versions of the MET Docker image are
available in the
[dtcenter/met](https://hub.docker.com/repository/docker/dtcenter/met-base)
DockerHub repository.
```
docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} internal/scripts/docker
docker push dtcenter/met:${TAG_NAME}
```

where:
* TAG_NAME is the name of the DockerHub tag to create
* BRANCH_NAME is the MET branch to checkout

## Build MET from local source code with minimum requirements
* `${TAG_NAME}` is the name of the DockerHub tag to create
* `${BRANCH_NAME}` is the MET branch to checkout

2. The second example below shows how to manually build a MET Docker image
using a specified branch or tag from local source code and using a local
Docker image for the base compilation environment for MET from the
[METbaseimage](https://github.com/dtcenter/METbaseimage/)
GitHub repository. (See the
[METbaseimage README.md](https://github.com/dtcenter/METbaseimage/blob/main/README.md)
file for more information on manually creating the Docker image for the base
compilation environment.) This example uses `Dockerfile.copy`, which compiles
MET using the specified branch or tag from local source code, sets a working
directory, downloads and installs GhostScript fonts, and deletes the MET
source code for tagged releases matching "v"*.
```
docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} -f internal/scripts/docker/Dockerfile.copy .
docker push dtcenter/met:${TAG_NAME}
```

where:
* TAG_NAME is the name of the DockerHub tag to create
* BRANCH_NAME is the identifier to use for $MET_GIT_NAME inside image

## Build MET from local source code with unit test requirements
* `${TAG_NAME}` is the name of the DockerHub tag to create
* `${BRANCH_NAME}` is the identifier to use for $MET_GIT_NAME inside image

3. The third example below shows how to manually build a MET Docker image
using a specified branch or tag from local source code and using a local
Docker image for the base compilation environment along with the additional
packages required for running the MET unit tests from the
[METbaseimage](https://github.com/dtcenter/METbaseimage/)
GitHub repository. (See the
[METbaseimage README.md](https://github.com/dtcenter/METbaseimage/blob/main/README.md)
file for more information on manually creating the Docker image with the base
compilation environment and with the additional packages required for running
the MET unit tests.) This example also uses `Dockerfile.copy`, which is
described above.
```
docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} --build-arg MET_BASE_IMAGE=unit_test_${MET_BASE_IMAGE_VERSION} -f internal/scripts/docker/Dockerfile.copy .
docker build -t dtcenter/met:${TAG_NAME} --build-arg SOURCE_BRANCH=${BRANCH_NAME} --build-arg MET_BASE_TAG=${MET_BASE_TAG} -f internal/scripts/docker/Dockerfile.copy .
docker push dtcenter/met:${TAG_NAME}
```

where:
* TAG_NAME is the name of the DockerHub tag to create
* BRANCH_NAME is the identifier to use for $MET_GIT_NAME inside image
* MET_BASE_IMAGE_VERSION is the METbaseimage tag version number
* `${TAG_NAME}` is the name of the DockerHub tag to create
* `${BRANCH_NAME}` is the identifier to use for $MET_GIT_NAME inside image
* `${MET_BASE_TAG}` is the version of [dtcenter/met-base-unit-test](https://hub.docker.com/repository/docker/dtcenter/met-base-unit-test) to be used
3 changes: 2 additions & 1 deletion internal/scripts/docker/build_met_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ echo "Configuring MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
MET_HDF=/usr/local/hdf MET_HDFEOS=/usr/local/hdfeos \
MET_FREETYPEINC=/usr/include/freetype2 MET_FREETYPELIB=/usr/lib \
MET_CAIROINC=/usr/include/cairo MET_CAIROLIB=/usr/lib \
MET_PYTHON_CC='-I/usr/include/python3.6m' MET_PYTHON_LD='-lpython3.6m' > ${LOG_FILE}
MET_PYTHON_CC='-I/usr/local/include/python3.8' \
MET_PYTHON_LD='-L/usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu -L/usr/local/lib/python3.8 -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -Xlinker -export-dynamic' > ${LOG_FILE}
if [ $? != 0 ]; then
exit 1
fi
Expand Down

0 comments on commit 8db8ce8

Please sign in to comment.