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 #2022 Use Debian 10 / Python 3.10.4 in automated tests #2050

Merged
merged 57 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
807e286
test using MET feature branch to run tests, ci-run-all-diff
georgemccabe Jan 20, 2023
be808d2
updated bashrc file to match debian location
georgemccabe Jan 20, 2023
3e9488d
update bashrc path on debian OS, ci-run-diff
georgemccabe Jan 24, 2023
05440dc
changed path to bashrc file because previous path was not found using…
georgemccabe Jan 24, 2023
cf5e292
fixed root bashrc path again, ci-run-all-diff
georgemccabe Jan 24, 2023
2173f74
fix bashrc in Dockerfile, ci-run-all-diff
georgemccabe Jan 24, 2023
9229ab8
change script to use python3 from environment instead of python, ci-r…
georgemccabe Jan 24, 2023
3aef03c
update version extension of conda environments to use v5.1 instead of…
georgemccabe Feb 2, 2023
7f8267f
fix paths to conda files, ci-run-all-cases
georgemccabe Feb 3, 2023
331378f
Merge branch 'develop' into feature_2022_test_compile
georgemccabe Feb 3, 2023
14d5ec6
ci-run-all-cases
georgemccabe Feb 3, 2023
99cc454
fix path to conda envs
georgemccabe Feb 3, 2023
af0f914
fix conda env dir, ci-run-all-cases
georgemccabe Feb 3, 2023
437edfb
create directories to copy conda files, ci-run-all-cases
georgemccabe Feb 3, 2023
7d28802
updated gempak requirements, ci-run-all-cases
georgemccabe Feb 3, 2023
ac5ccba
updated netcdf lib location to match METbaseimage, ci-run-all-cases
georgemccabe Feb 3, 2023
2b6fc9e
use pytest.v5.1 env
georgemccabe Feb 3, 2023
24db9c8
test METplotpy branch to see if change to call to cartopy function fi…
georgemccabe Feb 3, 2023
03da560
change branch for METplotpy back to develop since the changes were me…
georgemccabe Feb 6, 2023
4327d54
fix path to pytest exe, ci-run-all-cases
georgemccabe Feb 6, 2023
7513fe2
add dir containing java exe to path
georgemccabe Feb 6, 2023
589c1b1
copy hdf5 libraries to run env
georgemccabe Feb 6, 2023
4b03298
turn on specific cases to test
georgemccabe Feb 6, 2023
761953d
use branch of metcalcpy to test change
georgemccabe Feb 6, 2023
b66f299
added missing semi-colon
georgemccabe Feb 6, 2023
2b222ed
turn off use case group that did not fail
georgemccabe Feb 6, 2023
5b4f6ea
use metplotpy branch to test change
georgemccabe Feb 6, 2023
14bafc1
fix path to java exe
georgemccabe Feb 6, 2023
e0df0d5
turn off cases that passed
georgemccabe Feb 6, 2023
e4963bc
escape dollar sign to prevent value from being expanded
georgemccabe Feb 6, 2023
0362881
remove logic to set path for java since it is handled in Dockerfile.r…
georgemccabe Feb 6, 2023
1a98d0d
turn off use case groups that now pass
georgemccabe Feb 6, 2023
71e5f6a
changed METplotpy branch back to develop since changes were merged
georgemccabe Feb 7, 2023
95a83e9
changed METcalcpy branch back to develop
georgemccabe Feb 9, 2023
24f332d
Merge branch 'develop' into feature_2022_test_compile
georgemccabe Feb 14, 2023
26745e1
updated example list of use case groups if the script is run directly
georgemccabe Jan 27, 2023
9c7a899
add group name to output base for use case tests and update logic to …
georgemccabe Jan 27, 2023
b5ba3ad
clean up after testing
georgemccabe Feb 14, 2023
3dcc5e8
remove group name from output path to test diff, ci-run-all-diff
georgemccabe Feb 14, 2023
13eb350
copy missing gfortran libs
georgemccabe Feb 14, 2023
97f58ef
turn on use cases that failed, ci-run-diff
georgemccabe Feb 14, 2023
83c4295
fix library copy, ci-run-diff
georgemccabe Feb 14, 2023
c59d70d
Merge branch 'develop' into feature_2022_test_compile
georgemccabe Feb 14, 2023
9b9137e
copy missing library used by gfdl tracker, ci-run-diff
georgemccabe Feb 14, 2023
2fe01c7
copy lib64 dir, ci-run-diff
georgemccabe Feb 14, 2023
5e89420
resolved conflicts, ci-run-diff
georgemccabe Feb 14, 2023
741f2eb
added ldflags to gfdl tracker dockerfile
georgemccabe Feb 14, 2023
06f042d
copy only libm
georgemccabe Feb 14, 2023
f83cd3f
set ld library path to include directories that gfdl tracker cannot find
georgemccabe Feb 14, 2023
cc62175
copy all libs from /lib64
georgemccabe Feb 14, 2023
e18d47a
check if gfdl tracker install is successfully by checking number of e…
georgemccabe Feb 15, 2023
a504759
clean up logic that is no longer needed
georgemccabe Feb 15, 2023
51c806c
switch to using MET docker image that is using p3.10 and debian10 for…
georgemccabe Feb 15, 2023
8d310df
Merge branch 'develop' into feature_2022_test_compile
georgemccabe Feb 16, 2023
583d5e1
turn off use case groups
georgemccabe Feb 16, 2023
5930d0d
remove configure arguments that aren't used
georgemccabe Feb 16, 2023
8d8aede
revert changes since MET PR dtcenter/MET#2440 was merged
georgemccabe Feb 16, 2023
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
5 changes: 3 additions & 2 deletions .github/actions/run_tests/Dockerfile.run
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ FROM dtcenter/metplus-envs:${METPLUS_ENV_TAG} as env
ARG METPLUS_IMG_TAG=develop
FROM dtcenter/metplus-dev:${METPLUS_IMG_TAG}

COPY --from=env /usr/local/envs /usr/local/envs/
COPY --from=env /usr/local/bin/conda /usr/local/bin/conda
RUN mkdir -p /usr/local/conda/envs && mkdir -p /usr/local/conda/bin
COPY --from=env /usr/local/conda/envs /usr/local/conda/envs/
COPY --from=env /usr/local/conda/bin/conda /usr/local/conda/bin/conda
5 changes: 3 additions & 2 deletions .github/actions/run_tests/Dockerfile.run_cartopy
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ FROM dtcenter/metplus-envs:${METPLUS_ENV_TAG} as env
ARG METPLUS_IMG_TAG=develop
FROM dtcenter/metplus-dev:${METPLUS_IMG_TAG}

COPY --from=env /usr/local/envs /usr/local/envs/
COPY --from=env /usr/local/bin/conda /usr/local/bin/conda
RUN mkdir -p /usr/local/conda/envs && mkdir -p /usr/local/conda/bin
COPY --from=env /usr/local/conda/envs /usr/local/conda/envs/
COPY --from=env /usr/local/conda/bin/conda /usr/local/conda/bin/conda

COPY --from=env /root/.local/share/cartopy /root/.local/share/cartopy/
6 changes: 4 additions & 2 deletions .github/actions/run_tests/Dockerfile.run_gempak
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM dtcenter/metplus-envs:${METPLUS_ENV_TAG} as env
ARG METPLUS_IMG_TAG=develop
FROM dtcenter/metplus-dev:${METPLUS_IMG_TAG}

COPY --from=env /usr/lib/jvm/jre /usr/lib/jvm/jre/
COPY --from=env /usr/share/javazi-1.8/tzdb.dat /usr/share/javazi-1.8/
COPY --from=env /usr/lib/jvm/adoptopenjdk-8-hotspot-amd64 /usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/
COPY --from=env /data/input/GempakToCF.jar /data/input/GempakToCF.jar

# add java executable to path
RUN echo "export PATH=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin:\$PATH;" >> /root/.bashrc
1 change: 1 addition & 0 deletions .github/actions/run_tests/Dockerfile.run_gfdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FROM dtcenter/metplus-envs:${METPLUS_ENV_TAG} as env
ARG METPLUS_IMG_TAG=develop
FROM dtcenter/metplus-dev:${METPLUS_IMG_TAG}

COPY --from=env /usr/local/lib/libhdf5* /usr/local/lib/
COPY --from=env /usr/local/lib/libnetcdf.so.19* /usr/local/lib/
COPY --from=env /usr/local/lib/libnetcdff* /usr/local/lib/
COPY --from=env /standalone_gfdl-vortextracker_v3.9a_gcc/trk_exec/* /usr/local/bin/
4 changes: 2 additions & 2 deletions .github/actions/run_tests/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fi

# running unit tests (pytests)
if [[ "$INPUT_CATEGORIES" == pytests* ]]; then
export METPLUS_ENV_TAG="pytest"
export METPLUS_ENV_TAG="pytest.v5.1"
export METPLUS_IMG_TAG=${branch_name}
echo METPLUS_ENV_TAG=${METPLUS_ENV_TAG}
echo METPLUS_IMG_TAG=${METPLUS_IMG_TAG}
Expand All @@ -61,7 +61,7 @@ if [[ "$INPUT_CATEGORIES" == pytests* ]]; then
for x in `cat $PYTESTS_GROUPS_FILEPATH`; do
marker="${x//_or_/ or }"
marker="${marker//not_/not }"
command+="/usr/local/envs/pytest/bin/pytest -vv --cov=../../../metplus -m \"$marker\""
command+="/usr/local/conda/envs/${METPLUS_ENV_TAG}/bin/pytest -vv --cov=../../../metplus -m \"$marker\""
command+=";if [ \$? != 0 ]; then status=1; fi;"
done
command+="if [ \$status != 0 ]; then echo ERROR: Some pytests failed. Search for FAILED to review; false; fi"
Expand Down
13 changes: 5 additions & 8 deletions .github/jobs/copy_error_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

def main(output_data_dir, error_logs_dir):
"""! Copy log output to error log directory if any use case failed """
for use_case_dir in os.listdir(output_data_dir):
log_dir = os.path.join(output_data_dir,
use_case_dir,
'logs')
if not os.path.isdir(log_dir):
for log_dir, _, log_files in os.walk(output_data_dir):
# skip non logs directories
if not log_dir.endswith('/logs'):
continue
use_case_dir = log_dir.replace(f'{output_data_dir}/', '')[0:-5]

# check if there are errors in the metplus.log file and
# only copy directory if there are any errors
Expand All @@ -28,9 +27,7 @@ def main(output_data_dir, error_logs_dir):
if not found_errors:
continue

output_dir = os.path.join(error_logs_dir,
use_case_dir)
log_files = os.listdir(log_dir)
output_dir = os.path.join(error_logs_dir, use_case_dir)
for log_file in log_files:
log_path = os.path.join(log_dir, log_file)
output_path = os.path.join(output_dir, log_file)
Expand Down
2 changes: 1 addition & 1 deletion .github/jobs/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
DOCKERHUB_METPLUS_DATA_DEV = 'dtcenter/metplus-data-dev'

# extension to add to conda environments
VERSION_EXT = '.v5'
VERSION_EXT = '.v5.1'


def get_data_repo(branch_name):
Expand Down
15 changes: 5 additions & 10 deletions .github/jobs/get_use_case_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def handle_automation_env(host_name, reqs, work_dir):
setup_env.append(_add_to_bashrc('# BELOW WAS ADDED BY TEST SCRIPT'))

# add conda bin to beginning of PATH
python_dir = os.path.join('/usr', 'local', 'envs',
python_dir = os.path.join('/usr', 'local', 'conda', 'envs',
conda_env_w_ext, 'bin')
python_path = os.path.join(python_dir, 'python3')
setup_env.append(_add_to_bashrc(f'export PATH={python_dir}:$PATH'))
Expand Down Expand Up @@ -106,12 +106,6 @@ def handle_automation_env(host_name, reqs, work_dir):
'cd -',
))

# if gempak is in requirements list, add JRE bin to path for java
if 'gempak' in str(reqs).lower():
setup_env.append(_add_to_bashrc(
'export PATH=$PATH:/usr/lib/jvm/jre/bin'
))

# if metplus is in requirements list,
# add top of METplus repo to PYTHONPATH so metplus can be imported
if 'metplus' in str(reqs).lower():
Expand All @@ -123,17 +117,17 @@ def handle_automation_env(host_name, reqs, work_dir):
if conda_env not in NOT_PYTHON_ENVS:
setup_env.extend((
f'echo Using environment: dtcenter/metplus-envs:{conda_env_w_ext}',
f'echo cat /usr/local/envs/{conda_env_w_ext}/environments.yml',
f'echo cat /usr/local/conda/envs/{conda_env_w_ext}/environments.yml',
f'echo ----------------------------------------',
f'cat /usr/local/envs/{conda_env_w_ext}/environments.yml',
f'cat /usr/local/conda/envs/{conda_env_w_ext}/environments.yml',
'echo ----------------------------------------',
))

return ';'.join(setup_env), py_embed_arg


def _add_to_bashrc(command):
return f"echo '{command};' >> /etc/bashrc"
return f"echo '{command};' >> /root/.bashrc"


def main(categories, subset_list, work_dir=None,
Expand Down Expand Up @@ -178,6 +172,7 @@ def main(categories, subset_list, work_dir=None,

config_args.append(config_arg)

#output_base = os.path.join(output_top_dir, group_name, use_case.name)
output_base = os.path.join(output_top_dir, use_case.name)
use_case_cmd = (f"run_metplus.py"
f" {' '.join(config_args)}"
Expand Down
2 changes: 1 addition & 1 deletion .github/jobs/setup_and_run_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
MOUNT_ARGS = ' '.join(VOLUME_MOUNTS)

# command to run inside Docker
diff_command = (f'/usr/local/envs/diff{VERSION_EXT}/bin/python3 '
diff_command = (f'/usr/local/conda/envs/diff{VERSION_EXT}/bin/python3 '
f'{GITHUB_WORKSPACE}/{CI_JOBS_DIR}/run_diff_docker.py')

# start detached interactive diff env container
Expand Down
2 changes: 1 addition & 1 deletion .github/jobs/setup_and_run_use_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def main():
# print bashrc file to see what was added by setup commands
# then force remove container to stop and remove it
if not run_commands([
_format_docker_exec_command('cat /etc/bashrc'),
_format_docker_exec_command('cat /root/.bashrc'),
f'docker rm -f {RUN_TAG}',
]):
isOK = False
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
EXTERNAL_TRIGGER: ${{ needs.job_control.outputs.external_trigger }}
#MET_FORCE_TAG: 10.1.0
#MET_FORCE_TAG: 11.0.0

update_data_volumes:
name: Docker Setup - Update Data Volumes
Expand Down
2 changes: 1 addition & 1 deletion internal/scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ONBUILD WORKDIR /metplus
FROM build_${OBTAIN_SOURCE_CODE}
MAINTAINER George McCabe <mccabe@ucar.edu>

RUN echo export PATH=$PATH:`pwd`/METplus/ush >> /etc/bashrc \
RUN echo export PATH=$PATH:`pwd`/METplus/ush >> /root/.bashrc \
&& echo setenv PATH $PATH:`pwd`/METplus/ush >> /etc/csh.cshrc

# if source code was retrieved, set default config variables and install package
Expand Down
4 changes: 4 additions & 0 deletions internal/scripts/docker_env/Dockerfile.gfdl-tracker
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ RUN cd / \
&& unset FC && unset CC \
&& ./configure \
&& cp configure.trk-docker-gnu configure.trk \
&& echo "\nLDFLAGS=-L/usr/local/lib -Wl,-rpath,/usr/local/lib -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu" >> configure.trk \
&& ./compile > tracker.log 2>&1

# check that all exes were created properly
RUN [ $(ls /standalone_gfdl-vortextracker_v3.9a_gcc/trk_exec -1 | wc -l) -ge 5 ]
28 changes: 22 additions & 6 deletions internal/tests/use_cases/metplus_use_case_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,12 @@ def parse_all_use_cases_file():
set_output = f'config.USE_CASE_NAME={name}'
config_args.append(set_output)

use_case_dict = {'index': index,
'name': name,
'config_args': config_args,
'requirements': requirements}
use_case_dict = {
'index': index,
'name': name,
'config_args': config_args,
'requirements': requirements,
}
all_cases[category].append(use_case_dict)
num_cases += 1

Expand All @@ -418,10 +420,14 @@ def parse_all_use_cases_file():

all_use_cases.add_use_case_groups('climate')

all_use_cases.add_use_case_groups('cryosphere')
all_use_cases.add_use_case_groups('air_quality_and_comp')

all_use_cases.add_use_case_groups('climate')

all_use_cases.add_use_case_groups('data_assimilation')

all_use_cases.add_use_case_groups('marine_and_cryosphere')

# slice(5) == medium range 0-4
all_use_cases.add_use_case_groups('medium_range',
case_slice=range(5))
Expand All @@ -434,9 +440,19 @@ def parse_all_use_cases_file():

all_use_cases.add_use_case_groups('precipitation')

all_use_cases.add_use_case_groups('s2s')

all_use_cases.add_use_case_groups('s2s_mid_lat')

all_use_cases.add_use_case_groups('s2s_mjo')

all_use_cases.add_use_case_groups('short_range')

all_use_cases.add_use_case_groups('s2s&space_weather&tc_and_extra_tc')
all_use_cases.add_use_case_groups('space_weather')

all_use_cases.add_use_case_groups('tc_and_extra_tc')

all_use_cases.add_use_case_groups('unstructured_grids')

all_use_cases.print()

Expand Down
2 changes: 1 addition & 1 deletion manage_externals/checkout_externals
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""Main driver wrapper around the manic/checkout utility.

Expand Down