Skip to content

Bugfix: Improve error handling for Docker image creation #639

@georgemccabe

Description

@georgemccabe

Describe the Problem

Currently the Docker build can fail to obtain the METplus Analysis Python packages (METdataio, METcalcpy, METplotpy), but continues to build as if it was successful. We should add error checking to have the build fail if this step fails. Also review other logic that should be error checked to ensure a successful build is actually successful.

For example, if the METviewer release is created before the Python releases are created, then the following lines will fail and the python code will not be included in the image:

echo "Checking out METcalcpy ${METCALCPY_GIT_NAME} from ${METCALCPY_GIT_URL}"
git clone --branch ${METCALCPY_GIT_NAME} ${METCALCPY_GIT_URL}
echo "Checking out METplotpy ${METPLOTPY_GIT_NAME} from ${METPLOTPY_GIT_URL}"
git clone --branch ${METPLOTPY_GIT_NAME} ${METPLOTPY_GIT_URL}
echo "Checking out METdataio ${METDATAIO_GIT_NAME} from ${METDATAIO_GIT_URL}"
git clone --branch ${METDATAIO_GIT_NAME} ${METDATAIO_GIT_URL}

From the build log:

#12 1.566 Checking out METcalcpy v3.2.0 from https://github.com/dtcenter/METcalcpy
#12 1.567 Cloning into 'METcalcpy'...
#12 1.737 fatal: Remote branch v3.2.0 not found in upstream origin
#12 1.739 Checking out METplotpy v3.2.0 from https://github.com/dtcenter/METplotpy
#12 1.740 Cloning into 'METplotpy'...
#12 1.894 fatal: Remote branch v3.2.0 not found in upstream origin
#12 1.896 Checking out METdataio v3.2.0 from https://github.com/dtcenter/METdataio
#12 1.897 Cloning into 'METdataio'...
#12 2.038 fatal: Remote branch v3.2.0 not found in upstream origin

We should check the return status of these commands and exit non-zero if it fails to clone.

Expected Behavior

Provide a clear and concise description of what you expected to happen here.

Environment

Describe your runtime environment:
1. Machine: (e.g. HPC name, Linux Workstation, Mac Laptop)
2. OS: (e.g. RedHat Linux, MacOS)
3. Software version number(s)

To Reproduce

Describe the steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Post relevant sample data following these instructions:
https://dtcenter.org/community-code/model-evaluation-tools-met/met-help-desk#ftp

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Review default alert labels
  • Select component(s)
  • Select priority
  • Select requestor(s)

Milestone and Projects

  • Select Milestone as the next bugfix version
  • Select Coordinated METplus-X.Y Support project for support of the current coordinated release
  • Select METviewer-X.Y.Z Development project for development toward the next official release

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_<Version>.
    Branch name: bugfix_<Issue Number>_main_<Version>_<Description>
  • Fix the bug and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into main_<Version>.
    Pull request: bugfix <Issue Number> main_<Version> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the next bugfix version
    Select: Coordinated METplus-X.Y Support project for support of the current coordinated release
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
    Select: Reviewer(s) and Development issue
    Select: Milestone as the next official version
    Select: METviewer-X.Y.Z Development project for development toward the next official release
  • Close this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🩺 Needs Triage

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions