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

Feature #2138 CI enhance MET Docker tag override #2258

Merged
merged 8 commits into from
Jul 24, 2023
11 changes: 7 additions & 4 deletions .github/jobs/docker_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ 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 [ ! -z "$MET_FORCE_TAG" ]; then
MET_TAG=$MET_FORCE_TAG
MET_DOCKER_REPO=met
# 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 "$SET_MET_IMAGE" ]; then
force_info=(${SET_MET_IMAGE//:/ })
MET_DOCKER_REPO=${force_info[0]}
MET_TAG=${force_info[1]}
fi

echo Using MET_DOCKER_REPO=$MET_DOCKER_REPO
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: 11.0.0
#SET_MET_IMAGE: met:11.0.0

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
DanielAdriaansen marked this conversation as resolved.
Show resolved Hide resolved
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."
DanielAdriaansen marked this conversation as resolved.
Show resolved Hide resolved

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
georgemccabe marked this conversation as resolved.
Show resolved Hide resolved
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
georgemccabe marked this conversation as resolved.
Show resolved Hide resolved
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