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 629 metdbload #882

Merged
merged 195 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
b1e261f
add cfg file and script to obtain METdatadb repository
Mar 15, 2021
7f06221
started creating wrapper and config files
georgemccabe Mar 15, 2021
84b91fd
Merge branch 'develop' into feature_629_metdbload
georgemccabe Mar 16, 2021
b96667a
added function to generate random tmp filename
georgemccabe Mar 16, 2021
1fd5375
implemented xml file string substitution
georgemccabe Mar 16, 2021
45e9142
updated config files
georgemccabe Mar 16, 2021
ab5a906
added scripts to obtain METviewer
georgemccabe Mar 16, 2021
3e05655
added new use case to list
georgemccabe Mar 16, 2021
12a7eff
only run new use case for testing
georgemccabe Mar 16, 2021
e9c264d
obtain METviewer from docker
georgemccabe Mar 16, 2021
80fbf35
remove commented dependency
georgemccabe Mar 17, 2021
d17f60a
make new script executable
georgemccabe Mar 17, 2021
33ccdd1
skip unit tests for now
georgemccabe Mar 17, 2021
3ecdbbd
added comments with commands that will go into a script called inside…
georgemccabe Mar 17, 2021
9499c0a
added get image back
georgemccabe Mar 17, 2021
3467ca3
added get image back
georgemccabe Mar 17, 2021
fcd06ef
log github context to easily see what is available to control
georgemccabe Mar 17, 2021
5858d2e
testing logic to only run new use cases
georgemccabe Mar 17, 2021
2ff003c
more only run new
georgemccabe Mar 17, 2021
7d2cc2f
try to skip based on matrix.categories in main.yml instead
georgemccabe Mar 17, 2021
3798bcd
fixed syntax issues
georgemccabe Mar 17, 2021
acc4027
fixed syntax issues again
georgemccabe Mar 17, 2021
626f911
fixed missing quotes for commit message, try to skip step if previous…
georgemccabe Mar 17, 2021
2f1d486
missing quotes
georgemccabe Mar 17, 2021
ad97d29
parse out ci-skip-get-image from this commit message to skip get_imag…
georgemccabe Mar 17, 2021
d38b518
fix expression
georgemccabe Mar 17, 2021
8810bda
add quotes
georgemccabe Mar 17, 2021
dbe01c6
try again
georgemccabe Mar 17, 2021
685855b
try again again
georgemccabe Mar 17, 2021
9cbbc1b
added support for skipping some jobs via commit message
georgemccabe Mar 17, 2021
22d47e4
check value of run_ variable to see determine if job should be skipped
georgemccabe Mar 17, 2021
952f3d7
add quotes to comparison
georgemccabe Mar 17, 2021
90d1890
debugging
georgemccabe Mar 17, 2021
5e82ab4
set dependency for jobs to wait for job control job
georgemccabe Mar 17, 2021
bad7b24
more debugging
georgemccabe Mar 17, 2021
f726fe0
even more debugging
georgemccabe Mar 17, 2021
8785960
fix ident
georgemccabe Mar 17, 2021
bfc20a5
add depend
georgemccabe Mar 17, 2021
1d70be0
another test
georgemccabe Mar 17, 2021
6de7c10
try saving job control status as artifact to read into env for each job
georgemccabe Mar 17, 2021
295e20f
removed invalid line
georgemccabe Mar 17, 2021
58f9ddb
typo
georgemccabe Mar 17, 2021
0c543ce
try read vars into env and echo
georgemccabe Mar 17, 2021
f69b2f0
cat file not echo
georgemccabe Mar 17, 2021
76381e8
list
georgemccabe Mar 17, 2021
af6eb59
fix cat command
georgemccabe Mar 17, 2021
fee793f
test ci-skip-get-image
georgemccabe Mar 17, 2021
6d369ff
fix test for ci-skip-get-image
georgemccabe Mar 17, 2021
02fedff
another test
georgemccabe Mar 17, 2021
49efca4
another test2
georgemccabe Mar 17, 2021
34b1b39
test skip get image
georgemccabe Mar 17, 2021
4857907
test fixed ci-skip-get-image logic
georgemccabe Mar 17, 2021
f566feb
removed logic to skip existing use cases from action
georgemccabe Mar 17, 2021
41bcd79
added job control logic to all jobs
georgemccabe Mar 17, 2021
292ec09
added job control dependency to doc job
georgemccabe Mar 17, 2021
e008f52
add diff control, add logic to auto run diff on PR into develop or ma…
georgemccabe Mar 17, 2021
019fdc3
print job control settings after setting for easy reference, removed …
georgemccabe Mar 17, 2021
52fafdd
added rule to only run CI if there was at least 1 file outside of the…
georgemccabe Mar 17, 2021
2988221
added all use cases back to list but made default setting to only run…
georgemccabe Mar 17, 2021
ea714d9
pass run diff boolean into run_tests action to determine if diff logi…
georgemccabe Mar 17, 2021
36a9b4a
fixed printing of job control status
georgemccabe Mar 17, 2021
3822108
added step to determine if the current use case group should be run, …
georgemccabe Mar 17, 2021
fec644d
fixed typo in if block
georgemccabe Mar 17, 2021
f5aefcf
fixed typo in if block
georgemccabe Mar 17, 2021
81ea14a
fixed typo in if block
georgemccabe Mar 17, 2021
04ade46
fixed broken if logic
georgemccabe Mar 17, 2021
88437d3
remove skip run if change is only in docs dir, clean up
georgemccabe Mar 17, 2021
561de86
comment other use cases for test
georgemccabe Mar 17, 2021
226e727
attempt to fix condition logic
georgemccabe Mar 17, 2021
fd43674
attempt2 to fix condition logic
georgemccabe Mar 17, 2021
0c3bb13
moved logic to determine jobs to run into a shell sript
georgemccabe Mar 17, 2021
ed98cf1
use full path to job control script
georgemccabe Mar 17, 2021
34bfed5
checkout code before calling script
georgemccabe Mar 17, 2021
0499010
set commit message and environment variable and pass it into script
georgemccabe Mar 17, 2021
a6dbb31
added useful name description for check if use case should run, force…
georgemccabe Mar 17, 2021
c3aa354
check values
georgemccabe Mar 17, 2021
c3a0ed7
minor change and use ci-force-all-cases
georgemccabe Mar 17, 2021
641dd55
test again with ci-force-all-cases
georgemccabe Mar 17, 2021
6beefb9
changed single quote to double
georgemccabe Mar 17, 2021
db0a490
Merge branch 'develop' into feature_629_metdbload
georgemccabe Mar 17, 2021
c5017ec
add documentation for CI
georgemccabe Mar 17, 2021
beef988
added back support for ci-docs-only, fixed check for -ref in branch name
georgemccabe Mar 17, 2021
c47dac6
remove comments and add back all use cases
georgemccabe Mar 17, 2021
5330788
moved logic to determine which jobs to run into a separate job, added…
georgemccabe Mar 17, 2021
17dbd87
added to add use case instructions to add ':NEW' to the end of a new …
georgemccabe Mar 17, 2021
13bccbc
minor change to test forcing diff logic with ci-force-diff
georgemccabe Mar 17, 2021
676180e
added doc about ci-docs-only keyword
georgemccabe Mar 17, 2021
24c9643
changed climate use case group to NEW temporary to test that it only …
georgemccabe Mar 17, 2021
bb3e256
removed NEW from climate group and only run doc by setting ci-docs-only
georgemccabe Mar 17, 2021
2ad43c2
added logic to strip of :NEW from use case group name when getting ar…
georgemccabe Mar 17, 2021
2330a80
added back :NEW to climate group and retry diff test with ci-force-diff
georgemccabe Mar 17, 2021
aaaaec5
if not pull request, use get develop branch truth data, ci-force-diff
georgemccabe Mar 17, 2021
386f32b
removed NEW from climate group and skip all ci with ci-skip-all
georgemccabe Mar 17, 2021
bc2093d
changed script to bash to fix nested if blocks and ci-force-diff
georgemccabe Mar 17, 2021
ba1e888
removed incorrectly placed colon and ci-force-diff
georgemccabe Mar 17, 2021
2a21c87
set climate group to NEW AGAIN and ci-force-diff
georgemccabe Mar 17, 2021
0feb834
removed NEW from climate group and run all use cases via ci-force-all…
georgemccabe Mar 17, 2021
84cdc24
remove extra == 'true' from boolean env vars that shouldn't be necess…
georgemccabe Mar 17, 2021
9486409
when forcing diff logic, also set to run all use cases since new use …
georgemccabe Mar 18, 2021
5278f22
rename step to be more descriptive
georgemccabe Mar 18, 2021
ae051d9
only apply commit message overrides if not pull request or -ref branc…
georgemccabe Mar 18, 2021
70a96b7
merged feature_629_ci_keywords and resolved conflicts
georgemccabe Mar 18, 2021
5446b4a
Revert "remove extra == 'true' from boolean env vars that shouldn't b…
georgemccabe Mar 18, 2021
1c6e084
Revert "remove extra == 'true' from boolean env vars that shouldn't b…
georgemccabe Mar 18, 2021
d442d6e
Merge branch 'develop' into feature_629_ci_keywords
georgemccabe Mar 18, 2021
4adf62b
renamed keywords to be consistent
georgemccabe Mar 18, 2021
05baca5
Merge branch 'feature_629_ci_keywords' into feature_629_metdbload
georgemccabe Mar 18, 2021
d80f145
added steps to create METviewer database in CI
georgemccabe Mar 18, 2021
2c25b95
renamed variables to include MV_ and set values in conf to reflect da…
georgemccabe Mar 18, 2021
6e64224
try using docker-compose from METviewer main_v3.1 instead of develop
georgemccabe Mar 18, 2021
a5d0fb0
check if mysqld is running
georgemccabe Mar 18, 2021
2da71f1
sleep after starting database
georgemccabe Mar 18, 2021
dc05446
longer sleep
georgemccabe Mar 18, 2021
bd11a8c
added lxml python package to requirements for new use case
georgemccabe Mar 18, 2021
ed69262
moved lxml python dependency into script to get metdatadb since it is…
georgemccabe Mar 18, 2021
17b2258
change settings to match data provided to XML script
georgemccabe Mar 18, 2021
f7fcd6b
add support for setting more values, fixed typo in username
georgemccabe Mar 18, 2021
2afe475
changed host to metviewer_1:8080
georgemccabe Mar 19, 2021
a50cd3d
longer sleep
georgemccabe Mar 19, 2021
eedb6f8
changed database info back to correct value
georgemccabe Mar 19, 2021
0ecb4f0
try mapping the tcp ports so the use case can find the mysql database
georgemccabe Mar 19, 2021
200fcdd
print port forwarding info
georgemccabe Mar 19, 2021
598b884
added support for cip-skip-unit-tests
georgemccabe Mar 19, 2021
1704d82
remove all port specification and let GitHub Actions use default port…
georgemccabe Mar 19, 2021
ee7cb8c
fixed typo in ci-skip-unit-tests logic
georgemccabe Mar 19, 2021
d0ee05d
print docker info
georgemccabe Mar 22, 2021
a46b945
shut down ubuntu MySQL before setting up database for METviewer
georgemccabe Mar 22, 2021
4652204
added port back to mysql host
georgemccabe Mar 22, 2021
ab77904
try mounting /var/lib/mysql so database is reachable from container
georgemccabe Mar 22, 2021
d1dda03
added to echo, ci-skip-unit-tests
georgemccabe Mar 22, 2021
311c576
changed volume mount to /var/run/mysqld, ci-skip-unit-tests
georgemccabe Mar 22, 2021
a4f2b69
list mysqld dir, ci-skip-unit-tests
georgemccabe Mar 22, 2021
2e79514
show databases, mount mysql dir into metplus container, ci-skip-unit-…
georgemccabe Mar 22, 2021
42f4919
fixed typo
georgemccabe Mar 22, 2021
646b990
set port in docker run, ci-skip-unit-tests
georgemccabe Mar 22, 2021
8766ca5
expose all ports ci-skip-unit-tests
georgemccabe Mar 22, 2021
7d0e71e
use develop version of docker-compose from METviewer
georgemccabe Mar 22, 2021
bb90f54
switch back to main_v3.1 docker-compose, try setting port ci-skip-uni…
georgemccabe Mar 22, 2021
2700bd7
try docker IP as host ci-skip-unit-tests
georgemccabe Mar 22, 2021
b742933
set network value to container:mysql_mv in docker run command, change…
georgemccabe Mar 23, 2021
669cbab
write mysql and metviewer output to output directory so it is availab…
georgemccabe Mar 23, 2021
71cda95
fixed path for mounting mysql directory
georgemccabe Mar 23, 2021
fc2929f
use develop docker-compose file from METviewer, add verbose option to…
georgemccabe Mar 23, 2021
e86365d
removed --verbose option that doesn't seem to work
georgemccabe Mar 23, 2021
477dc78
merged develop and resolved conflicts
georgemccabe Mar 23, 2021
d9ba973
add docker-compose up db to see what is happening with mysql database…
georgemccabe Mar 23, 2021
984cd3b
try creating /var/lib/mysql dir so it is writable by mysql user ci-sk…
georgemccabe Mar 23, 2021
59e16c6
open up write permissions for mysql dir ci-skip-unit-tests
georgemccabe Mar 23, 2021
c16a9e1
open permissions for mysql, ci-skip-unit-tests
georgemccabe Mar 23, 2021
a7edde2
revert back to using root for mysql, ci-skip-unit-tests
georgemccabe Mar 23, 2021
8f685b5
switch back to develop metviewer, open up permissions ci-skip-unit-tests
georgemccabe Mar 23, 2021
d3b0c48
added missing docker-compose up db command to see error messages ci-s…
georgemccabe Mar 23, 2021
119af3a
open permissions for local dir instead of /var dir ci-skip-unit-tests
georgemccabe Mar 23, 2021
79309ff
create dirs for database in separate step, ci-skip-unit-tests
georgemccabe Mar 23, 2021
b727fa7
list permissions ci-skip-unit-tests
georgemccabe Mar 23, 2021
dfc5460
list output dir ci-skip-unit-tests
georgemccabe Mar 23, 2021
5041b9b
explicitly create runner workspace mysql/metviewer dirs, ci-skip-unit…
georgemccabe Mar 23, 2021
93d14ac
updated METdbLoad wrapper to traverse through directory and add any d…
georgemccabe Mar 23, 2021
473397a
Merge branch 'develop' into feature_629_metdbload
georgemccabe Mar 23, 2021
87b19e8
removed docker compose call that was causing the job to hang
georgemccabe Mar 23, 2021
f6ad7e4
list output mysql dir to see permissions, ci-skip-unit-tests
georgemccabe Mar 23, 2021
617df43
fixed typo in XML
georgemccabe Mar 23, 2021
c4b6fe6
moved mysql directory up a level so it is output of the output direct…
georgemccabe Mar 23, 2021
f8f8785
list metviewer dir and try to copy its contents ci-skip-unit-tests
georgemccabe Mar 23, 2021
5294906
added sample XML file to use to load plot into METviewer
georgemccabe Mar 23, 2021
516f86a
clean up testing commands
georgemccabe Mar 23, 2021
3b7e44d
added documentation for new wrapper and use case ci-docs-only
georgemccabe Mar 24, 2021
6a63fa1
removed extra quick search keyword that is not relevant
georgemccabe Mar 24, 2021
0f55c58
merged develop resolved conflicts
georgemccabe Mar 30, 2021
ced8cbd
try moving METdatadb up a level
georgemccabe Mar 30, 2021
dccbc4a
merged develop and resolved conflicts
georgemccabe Mar 30, 2021
a772b90
Merge branch 'develop' into feature_629_metdbload
georgemccabe Mar 31, 2021
9cb2f67
added METDbLoad to list of wrappers to convert name to correct camel …
georgemccabe Mar 31, 2021
3260db0
moved new python requirements scripts into sub directory, ci-run-diff
georgemccabe Mar 31, 2021
bd9ee38
merged develop and resolved conflicts
georgemccabe Apr 13, 2021
8c32c34
only read grid_stat data
georgemccabe Apr 13, 2021
33f4483
removed unused manage externals file
georgemccabe Apr 13, 2021
d1cfb64
fixed incorrect conflict resolution
georgemccabe Apr 13, 2021
40294f7
try skipping step to create directories for mysql and metviewer
georgemccabe Apr 13, 2021
0d48279
remove unused metviewer xml file
georgemccabe Apr 13, 2021
60b1e37
try creating directories but only adding write permissions
georgemccabe Apr 13, 2021
996be53
only obtain metviewer if it is in the list of requirements for the us…
georgemccabe Apr 13, 2021
66558c4
added additional use case to test that METviewer is only obtained if …
georgemccabe Apr 13, 2021
e49ebc5
only set --network argument to docker run if setting up metviewer dat…
georgemccabe Apr 13, 2021
3f17c80
call python script instead of setting variable to the command
georgemccabe Apr 13, 2021
491b4ac
remove print statement from utility function
georgemccabe Apr 13, 2021
75c3161
remove escape characters for network arg
georgemccabe Apr 13, 2021
8adccea
removed extra use case for testing and comments
georgemccabe Apr 13, 2021
51f8564
Merge branch 'develop' into feature_629_metdbload
georgemccabe Apr 13, 2021
3acea51
Update docs/use_cases/met_tool_wrapper/METdbLoad/METdbLoad.py
georgemccabe Apr 14, 2021
4a08fe7
Update docs/use_cases/met_tool_wrapper/METdbLoad/METdbLoad.py
georgemccabe Apr 14, 2021
ed6a91f
Update docs/use_cases/met_tool_wrapper/METdbLoad/METdbLoad.py
georgemccabe Apr 14, 2021
4ce6997
Update docs/use_cases/met_tool_wrapper/METdbLoad/METdbLoad.py
georgemccabe Apr 14, 2021
e29e3b4
Update docs/use_cases/met_tool_wrapper/METdbLoad/METdbLoad.py
georgemccabe Apr 14, 2021
59ef6bd
Update docs/use_cases/met_tool_wrapper/METdbLoad/METdbLoad.py
georgemccabe Apr 14, 2021
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
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
- "s2s:1-3"
- "space_weather:0-1"
- "tc_and_extra_tc:0-2"
- "met_tool_wrapper:54:NEW"
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -138,6 +139,12 @@ jobs:
echo run_this_case=$run_this_case >> $GITHUB_ENV
echo Ends with NEW: ${{ endsWith(matrix.categories, ':NEW') }}
echo Run all: ${{ env.run_all_use_cases }}
- name: Create directories for database
run: |
mkdir -p $RUNNER_WORKSPACE/mysql
mkdir -p $RUNNER_WORKSPACE/output/metviewer
chmod a+w $RUNNER_WORKSPACE/mysql
chmod a+w $RUNNER_WORKSPACE/output/metviewer
- uses: actions/checkout@v2
if: ${{ env.run_this_case == 'true' }}
- uses: ./ci/actions/run_tests
Expand Down
17 changes: 15 additions & 2 deletions ci/actions/run_tests/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ if [ "$INPUT_CATEGORIES" == "pytests" ]; then
exit $?
fi

# get METviewer if used in any use cases
all_requirements=`./ci/jobs/get_requirements.py ${CATEGORIES} ${SUBSETLIST}`
echo All requirements: $all_requirements
NETWORK_ARG=""
if [[ "$all_requirements" =~ .*"metviewer".* ]]; then
echo "Setting up METviewer"
${GITHUB_WORKSPACE}/ci/jobs/python_requirements/get_metviewer.sh
NETWORK_ARG=--network="container:mysql_mv"
fi

# install Pillow library needed for diff testing
# this will be replaced with better image diffing package used by METplotpy
pip_command="pip3 install Pillow; yum -y install poppler-utils; pip3 install pdf2image"
Expand Down Expand Up @@ -86,6 +96,9 @@ fi

echo VOLUMES_FROM: $VOLUMES_FROM

echo docker ps:
docker ps -a

echo "Run Docker container: $DOCKERHUBTAG"
echo docker run -e GITHUB_WORKSPACE -v $GHA_OUTPUT_DIR:$DOCKER_OUTPUT_DIR -v $GHA_DIFF_DIR:$DOCKER_DIFF_DIR -v $GHA_ERROR_LOG_DIR:$DOCKER_ERROR_LOG_DIR -v $WS_PATH:$GITHUB_WORKSPACE ${VOLUMES_FROM} --workdir $GITHUB_WORKSPACE $DOCKERHUBTAG bash -c "${pip_command};${command}"
docker run -e GITHUB_WORKSPACE -v $GHA_OUTPUT_DIR:$DOCKER_OUTPUT_DIR -v $GHA_DIFF_DIR:$DOCKER_DIFF_DIR -v $GHA_ERROR_LOG_DIR:$DOCKER_ERROR_LOG_DIR -v $WS_PATH:$GITHUB_WORKSPACE ${VOLUMES_FROM} --workdir $GITHUB_WORKSPACE $DOCKERHUBTAG bash -c "${pip_command};${command}"
echo docker run -e GITHUB_WORKSPACE $NETWORK_ARG -v $RUNNER_WORKSPACE/output/mysql:/var/lib/mysql -v $GHA_OUTPUT_DIR:$DOCKER_OUTPUT_DIR -v $GHA_DIFF_DIR:$DOCKER_DIFF_DIR -v $GHA_ERROR_LOG_DIR:$DOCKER_ERROR_LOG_DIR -v $WS_PATH:$GITHUB_WORKSPACE ${VOLUMES_FROM} --workdir $GITHUB_WORKSPACE $DOCKERHUBTAG bash -c "${pip_command};${command}"
docker run -e GITHUB_WORKSPACE $NETWORK_ARG -v $RUNNER_WORKSPACE/output/mysql:/var/lib/mysql -v $GHA_OUTPUT_DIR:$DOCKER_OUTPUT_DIR -v $GHA_DIFF_DIR:$DOCKER_DIFF_DIR -v $GHA_ERROR_LOG_DIR:$DOCKER_ERROR_LOG_DIR -v $WS_PATH:$GITHUB_WORKSPACE ${VOLUMES_FROM} --workdir $GITHUB_WORKSPACE $DOCKERHUBTAG bash -c "${pip_command};${command}"
37 changes: 37 additions & 0 deletions ci/jobs/get_requirements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /usr/bin/env python3

# Used in GitHub Actions (in ci/actions/run_tests/entrypoint.sh)
# to obtain list of requirements from use case group

import os
import sys

import get_use_case_commands

# add internal_tests/use_cases directory to path so the test suite can be found
USE_CASES_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.pardir,
os.pardir))
sys.path.insert(0, USE_CASES_DIR)

from internal_tests.use_cases.metplus_use_case_suite import METplusUseCaseSuite

def main():
all_requirements = set()
categories, subset_list, compare = (
get_use_case_commands.handle_command_line_args()
)

test_suite = METplusUseCaseSuite()
test_suite.add_use_case_groups(categories, subset_list)

for group_name, use_cases_by_req in test_suite.category_groups.items():
for use_case_by_req in use_cases_by_req:
for requirement in use_case_by_req.requirements:
all_requirements.add(requirement)

return list(all_requirements)

if __name__ == '__main__':
all_requirements = main()
print(','.join(all_requirements))
5 changes: 5 additions & 0 deletions ci/jobs/get_use_case_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
def handle_requirements(requirements, work_dir):
requirement_args = []
for requirement in requirements:
# don't obtain METviewer here because it has to be set up outside of
# docker container that runs the use cases
if requirement.lower() == 'metviewer':
continue

# check if get_{requirement} script exists and use it if it does
script_path = os.path.join(work_dir,
'ci',
Expand Down
10 changes: 10 additions & 0 deletions ci/jobs/python_requirements/get_metdatadb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

pip3 install lxml
pip3 install PyMySQL

basedir=$(dirname "$0")
work_dir=$basedir/../../..

# run manage externals to obtain METdatadb
${work_dir}/manage_externals/checkout_externals -e ${work_dir}/ci/parm/Externals_metdatadb.cfg
33 changes: 33 additions & 0 deletions ci/jobs/python_requirements/get_metviewer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/bash

# set environment variables needed by METviewer docker-compose.yml
export METVIEWER_DATA=$RUNNER_WORKSPACE
export MYSQL_DIR=$RUNNER_WORKSPACE/mysql
export METVIEWER_DIR=$RUNNER_WORKSPACE/output/metviewer
export METVIEWER_DOCKER_IMAGE=dtcenter/metviewer
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway Apr 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will pull the Docker image for dtcenter/metviewer:latest which is the latest stable release (currently version 3.1). I assume that's fine and to be expected, but wanted to clarify. Will we have any problems with version incompatibility? For example, METplus is running MET's develop branch which creates .stat files for MET version 10.0.0. But the latest stable version of METviewer (3.1) shouldn't know anything about MET version 10.0.0 since it pre-dates it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point to bring up. I noticed there is a develop image in the METviewer DockerHub. We should probably use this to ensure that we are using the latest of everything. This script also downloads the docker-compose.yml file from METviewer develop, so it would be good to be consistent.


# install docker-compose
apk add docker-compose

# download docker-compose.yml file from METviewer develop branch
wget https://raw.githubusercontent.com/dtcenter/METviewer/develop/docker/docker-compose.yml

# Run docker-compose to create the containers
docker-compose up -d

# sleep for a few seconds to ensure database has fully started
sleep 20

# print list of currently running containers to
# verify mysql and metviewer are running
docker ps -a

# commands to run inside METviewer container
cmd="mysql -hmysql_mv -uroot -pmvuser -e\"create database mv_metplus_test;\";"
cmd+="mysql -hmysql_mv -uroot -pmvuser mv_metplus_test < /METviewer/sql/mv_mysql.sql"
cmd+=";mysql -hmysql_mv -uroot -pmvuser -e\"show databases;\""

# execute commands inside metviewer container to create database
echo Executing commands inside metviewer_1 container to create database
echo docker exec metviewer_1 /bin/bash -c "$cmd"
docker exec metviewer_1 /bin/bash -c "$cmd"
4 changes: 4 additions & 0 deletions ci/jobs/set_job_controls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ else
run_use_cases=false
fi

if grep -q "ci-skip-unit-tests" <<< "$commit_msg"; then
run_unit_tests=false
fi

if grep -q "ci-only-docs" <<< "$commit_msg"; then
run_docs=true
run_get_image=false
Expand Down
9 changes: 9 additions & 0 deletions ci/parm/Externals_metdatadb.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[METdatadb]
local_path = ../METdatadb
protocol = git
required = True
repo_url = https://github.com/dtcenter/METdatadb
branch = develop

[externals_description]
schema_version = 1.0.0
123 changes: 123 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5985,6 +5985,129 @@ METplus Configuration Glossary

| *Used by:* SeriesAnalysis

MET_DB_LOAD_RUNTIME_FREQ
Frequency to run Grid-Diag. See :ref:`Runtime_Freq` for more information.

| *Used by:* GridDiag

MET_DATA_DB_DIR
Set this the location of the dtcenter/METdatadb repository.

| *Used by:* METdbLoad

MET_DB_LOAD_XML_FILE
Template XML file that is used to load data into METviewer using the
met_db_load.py script. Values from the METplus configuration file are
substituted into this file before passing it to the script. The default
value can be used to run unless the template doesn't fit the needs of the
use case.

| *Used by:* METdbLoad

MET_DB_LOAD_REMOVE_TMP_XML
If set to False, then the temporary XML file with substituted values will
not be removed after the use case finishes. This is used for debugging
purposes only. The temporary XML file may contain sensitive information
like database credentials so it is recommended to remove the temporary
file after each run.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_HOST
Set the <load_spec><connection><host> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_DATABASE
Set the <load_spec><connection><database> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_USER
Set the <load_spec><connection><user> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_PASSWORD
Set the <load_spec><connection><password> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_VERBOSE
Set the <load_spec><verbose> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_INSERT_SIZE
Set the <load_spec><insert_size> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_MODE_HEADER_DB_CHECK
Set the <load_spec><mode_header_db_check> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_DROP_INDEXES
Set the <load_spec><drop_indexes> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_APPLY_INDEXES
Set the <load_spec><apply_indexes> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_GROUP
Set the <load_spec><group> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_LOAD_STAT
Set the <load_spec><load_stat> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_LOAD_MODE
Set the <load_spec><load_mode> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_LOAD_MTD
Set the <load_spec><load_mtd> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_MV_LOAD_MPR
Set the <load_spec><load_mpr> value in the
METdbLoad XML template file.

| *Used by:* METdbLoad

MET_DB_LOAD_INPUT_TEMPLATE
Path to a directory containing .stat or .tcst file that will be loaded
into METviewer. This can be a single directory or a list of directories.
The paths can include filename template tags that correspond to each
run time. The wrapper will traverse through each sub directory under the
directories listed here and add any directory that contains any files that
end with .stat or .tcst to the XML file that is passed into the
met_db_load.py script.

| *Used by:* METdbLoad

CYCLONE_PLOTTER_ADD_WATERMARK
If set to True, add a watermark with the current time to the image generated by
CyclonePlotter.
Expand Down
1 change: 1 addition & 0 deletions docs/Users_Guide/quicksearch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Use Cases by METplus Feature:
| `Looping by Month or Year <https://metplus.readthedocs.io/en/develop/search.html?q=LoopByMonthFeatureUseCase&check_keywords=yes&area=default>`_
| `List Expansion (using begin_end_incr syntax) <https://metplus.readthedocs.io/en/develop/search.html?q=ListExpansionFeatureUseCase&check_keywords=yes&area=default>`_
| `Masking for Regions of Interest <https://metplus.readthedocs.io/en/develop/search.html?q=MaskingFeatureUseCase&check_keywords=yes&area=default>`_
| `METdbLoad <https://metplus.readthedocs.io/en/develop/search.html?q=METdbLoadUseCase&check_keywords=yes&area=default>`_
| `MET_PYTHON_EXE Environment Variable <https://metplus.readthedocs.io/en/develop/search.html?q=MET_PYTHON_EXEUseCase&check_keywords=yes&area=default>`_
| `Multiple Conf File Use <https://metplus.readthedocs.io/en/develop/search.html?q=MultiConfUseCase&check_keywords=yes&area=default>`_
| `Observation Time Summary <https://metplus.readthedocs.io/en/develop/search.html?q=ObsTimeSummaryUseCase&check_keywords=yes&area=default>`_
Expand Down
Loading