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