Skip to content

Commit

Permalink
renamed MET_FORCE_TAG variable in testing workflow to SET_MET_IMAGE t…
Browse files Browse the repository at this point in the history
…o be more clear of its purpose and added documentation to describe how to set the MET image to use previous stable releases or development versions in the tests
  • Loading branch information
georgemccabe committed Jul 20, 2023
1 parent 00847f2 commit 6759a90
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/jobs/docker_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ elif [ "${EXTERNAL_TRIGGER}" == "true" ]; then
MET_TAG=${MET_TAG}-lite
fi

# if MET_FORCE_TAG variable is set and not empty, use that version instead
# if SET_MET_IMAGE variable is set and not empty, use that version instead
# format is <REPO>:<TAG> where the repo used is dtcenter/<REPO> and
# the tag used is <TAG>, e.g. met:11.1.0 uses dtcenter/met:11.1.0
if [ ! -z "$MET_FORCE_TAG" ]; then
force_info=(${MET_FORCE_TAG//:/ })
if [ ! -z "$SET_MET_IMAGE" ]; then
force_info=(${SET_MET_IMAGE//:/ })
MET_DOCKER_REPO=${force_info[0]}
MET_TAG=${force_info[1]}
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
EXTERNAL_TRIGGER: ${{ needs.job_control.outputs.external_trigger }}
MET_FORCE_TAG: met-dev:feature_2597_disk_space
SET_MET_IMAGE: met-dev:feature_2597_disk_space

update_data_volumes:
name: Docker Setup - Update Data Volumes
Expand Down
34 changes: 26 additions & 8 deletions docs/Contributors_Guide/continuous_integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ Create/Update METplus Docker Image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
#MET_FORCE_TAG: 10.0.0
#SET_MET_IMAGE: met:10.0.0

This job calls the **docker_setup.sh** script.
This script builds a METplus Docker image and pushes it to DockerHub.
Expand All @@ -496,15 +496,33 @@ development testing. If testing is done on a stable release, then the
corresponding MET stable release will be used. However, there may be an
instance where a change in MET breaks something in another METplus component,
i.e. METplotpy or METviewer, until a corresponding change is made to that
component. If this occurs then some of the METplus use cases may break. To
allow the tests to run successfully in the meantime, an option was added to
force the version of the MET tag that is used to build the METplus Docker image
that is used for testing. In the **testing.yml** workflow file,
there is a commented variable called
MET_FORCE_TAG that can be uncommented and set to force the version of MET to
use. This variable is found in the **get_image** job under the **env** section
component. If this occurs then some of the METplus use cases may break.

Another situation that may require a different MET Docker image is if there
are changes in a MET feature or bugfix branch that are needed to test changes
in METplus.

To allow the tests to run successfully in these cases, an option was added to
force a specific MET Docker image to be used to build the METplus Docker image
that is used for testing.

In the **testing.yml** workflow file, there is a commented variable called
SET_MET_IMAGE that can be uncommented and set the MET Docker image to use.
This variable is found in the **get_image** job under the **env** section
for the step named "Get METplus Image."

The format of the value is <REPO>:<TAG>
where the DockerHub repo used is dtcenter/<REPO> and the tag used is <TAG>.

Stable releases of MET are found in the dtcenter/met DockerHub repo and
are named using the X.Y.Z version of the release,
so setting **SET_MET_IMAGE=met:11.1.0** will use dtcenter/met:11.1.0.

Development versions of MET are found in the dtcenter/met-dev DockerHub
repo and are named using the branch name,
so setting **SET_MET_IMAGE=met-dev:feature_XYZ_info** will use
dtcenter/met-dev:feature_XYZ_info.


.. _cg-ci-update-data-volumes:

Expand Down

0 comments on commit 6759a90

Please sign in to comment.