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 #1980 Use the main_vX.Y of METplus components for main METplus tests #1985

Merged
merged 5 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .github/jobs/get_use_case_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from internal.tests.use_cases.metplus_use_case_suite import METplusUseCaseSuite
from metplus.util.string_manip import expand_int_string_to_list
from docker_utils import VERSION_EXT

from metplus import get_metplus_version

# path to METplus install location in Docker
METPLUS_DOCKER_LOC = '/metplus/METplus'
Expand All @@ -38,6 +38,7 @@
'gempak',
]


def handle_automation_env(host_name, reqs, work_dir):
# if no env is specified, use metplus base environment
conda_env = METPLUS_BASE_ENV
Expand Down Expand Up @@ -74,24 +75,32 @@ def handle_automation_env(host_name, reqs, work_dir):
else:
py_embed_arg = ''

# get METplus version to determine Externals file to use
# to get METplotpy/METcalcpy/METdataio
# If stable release, get main branch, otherwise get develop
is_stable_release = len(get_metplus_version().split('-')) == 1
externals_ext = '_stable.cfg' if is_stable_release else '.cfg'

# if any metplotpy/metcalcpy keywords are in requirements list,
# add command to obtain and install METplotpy and METcalcpy
if any([item for item in PLOTCALC_KEYWORDS if item in str(reqs).lower()]):
ce_file = os.path.join(work_dir, '.github', 'parm',
f'Externals_metplotcalcpy{externals_ext}')
setup_env += (
f'cd {METPLUS_DOCKER_LOC};'
f'{work_dir}/manage_externals/checkout_externals'
f' -e {work_dir}/.github/parm/Externals_metplotcalcpy.cfg;'
f'{work_dir}/manage_externals/checkout_externals -e {ce_file};'
f'{python_path} -m pip install {METPLUS_DOCKER_LOC}/../METplotpy;'
f'{python_path} -m pip install {METPLUS_DOCKER_LOC}/../METcalcpy;'
'cd -;'
)

# if metdataio is in requirements list, add command to obtain METdataio
if 'metdataio' in str(reqs).lower():
ce_file = os.path.join(work_dir, '.github', 'parm',
f'Externals_metdataio{externals_ext}')
setup_env += (
f'cd {METPLUS_DOCKER_LOC};'
f'{work_dir}/manage_externals/checkout_externals'
f' -e {work_dir}/.github/parm/Externals_metdataio.cfg;'
f'{work_dir}/manage_externals/checkout_externals -e {ce_file};'
f'{python_path} -m pip install {METPLUS_DOCKER_LOC}/../METdataio;'
'cd -;'
)
Expand All @@ -117,6 +126,7 @@ def handle_automation_env(host_name, reqs, work_dir):

return setup_env, py_embed_arg


def main(categories, subset_list, work_dir=None,
host_name=os.environ.get('HOST_NAME')):
all_commands = []
Expand Down Expand Up @@ -174,6 +184,7 @@ def main(categories, subset_list, work_dir=None,

return all_commands


def handle_command_line_args():
# read command line arguments to determine which use cases to run
if len(sys.argv) < 2:
Expand Down Expand Up @@ -201,6 +212,7 @@ def handle_command_line_args():

return categories, subset_list, do_comparison


if __name__ == '__main__':
categories, subset_list, _ = handle_command_line_args()
all_commands = main(categories, subset_list)
Expand Down
9 changes: 9 additions & 0 deletions .github/parm/Externals_metdataio_stable.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[METdataio]
local_path = ../METdataio
protocol = git
required = True
repo_url = https://github.com/dtcenter/METdataio
branch = main_v2.0

[externals_description]
schema_version = 1.0.0
16 changes: 16 additions & 0 deletions .github/parm/Externals_metplotcalcpy_stable.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[METcalcpy]
local_path = ../METcalcpy
protocol = git
required = True
repo_url = https://github.com/dtcenter/METcalcpy
branch = main_v2.0

[METplotpy]
local_path = ../METplotpy
protocol = git
required = True
repo_url = https://github.com/dtcenter/METplotpy
branch = main_v2.0

[externals_description]
schema_version = 1.0.0
Original file line number Diff line number Diff line change
@@ -1,9 +1,60 @@
Update the version numbers in the manage externals files
--------------------------------------------------------

build_components/Externals_stable.cfg
There are a few .cfg files used by Manage Externals that should
include the correct tag or branch that corresponds to the
METplus Coordinated Release for each METplus component.

Each of the components in these files has a tag associated with them.
Update the value for tag to the tag associated with the release for each
METplus component that is part of this METplus coordinated release, i.e.
MET should be v10.0.0 for the METplus 4.0.0 coordinated release.
**THIS MAY HAVE ALREADY BEEN DONE PRIOR TO THE RELEASE!**

For a METplus X.Y.Z Coordinated Release,
the version of the components are typically:

* **MET:** X+6
* **METviewer:** X
* **METplotpy:** X-3
* **METcalcpy:** X-3
* **METdataio:** X-3

Examples:

For the METplus **4.1**.0 release:

* MET is **10.1**.0
* METviewer is **4.1**.0
* METplotpy is **1.1**.0
* METcalcpy is **1.1**.0
* METdataio is **1.1**.0

For the METplus **5.0**.0 release:

* MET is **11.0**.0
* METviewer is **5.0**.0
* METplotpy is **2.0**.0
* METcalcpy is **2.0**.0
* METdataio is **2.0**.0

**This may not always be the case.**
When in doubt, check the components' repository or ask another developer.

Update build_components/Externals_stable.cfg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Ensure the *tag* for each component is correct. It should match the format
**vX.Y.Z** where X.Y.Z is the version of that component.
For example, MET should be **v11.0.0** for METplus 5.0.0.


Update .github/parm/Externals_metdataio_stable.cfg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Ensure the *branch* value is correct. It should match the format
**main_vX.Y** where X.Y is the version of that component.
For example, METdataio should be **main_v2.0** for METplus 5.0.0.

Update .github/parm/Externals_metplotcalcpy_stable.cfg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Ensure the *branch* for each component is correct. It should match the format
**main_vX.Y** where X.Y is the version of that component.
For example, METplotpy and METcalcpy should be **main_v2.0** for METplus 5.0.0.