-
Notifications
You must be signed in to change notification settings - Fork 104
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
CU-8695hghww backwards compatibility workflow #478
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0a50169
CU-8695hghww: Add bash script to run backwards compatibility
mart-r 55e3534
CU-8695hghww: Rename backwards compatibility running bash script
mart-r cbc4077
CU-8695hghww: Add new step to workflow to run model backwards compati…
mart-r 2221668
Merge branch 'master' into CU-8695hghww-backwards-compatibility-workflow
mart-r 731693b
CU-8695hghww: Fix model compatibility regression suite path
mart-r 1a94d2d
Merge branch 'master' into CU-8695hghww-backwards-compatibility-workflow
mart-r f8db30d
Merge branch 'master' into CU-8695hghww-backwards-compatibility-workflow
mart-r 4be8459
Merge branch 'master' into CU-8695hghww-backwards-compatibility-workflow
mart-r 83eb7db
CU-8695hghww: Simplify creation and removal of fake model folder
mart-r 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
51 changes: 51 additions & 0 deletions
51
tests/resources/model_compatibility/check_backwards_compatibility.sh
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,51 @@ | ||
# CONSTANTs/ shouldn't change | ||
REGRESSION_MODULE="medcat.utils.regression.regression_checker" | ||
REGRESSION_OPTIONS="--strictness STRICTEST --require-fully-correct" | ||
|
||
# CHANGABLES | ||
# target models | ||
DL_LINK="https://cogstack-medcat-example-models.s3.eu-west-2.amazonaws.com/medcat-example-models/all_fake_medcat_models.zip" | ||
ZIP_FILE_NAME="all_fake_medcat_models.zip" | ||
# target regression set | ||
REGRESSION_TEST_SET="tests/resources/regression/testing/test_model_regresssion.yml" | ||
# folder to house models under test | ||
MODEL_FOLDER="fake_models" | ||
|
||
# START WORK | ||
|
||
echo "Downloading models" | ||
wget $DL_LINK | ||
# Create folder if it doesn't exit | ||
if [ ! -d "$MODEL_FOLDER" ]; then | ||
mkdir "$MODEL_FOLDER" | ||
CREATED=1 | ||
else | ||
# mark to NOT remove if folder already existed | ||
CREATED=0 | ||
fi | ||
echo "Uncompressing files" | ||
unzip $ZIP_FILE_NAME -d $MODEL_FOLDER | ||
echo "Cleaning up the overall zip" | ||
rm $ZIP_FILE_NAME | ||
for model_path in `ls $MODEL_FOLDER/*.zip`; do | ||
if [ -f "$model_path" ]; then | ||
echo "Processing $model_path" | ||
python -m $REGRESSION_MODULE \ | ||
"$model_path" \ | ||
$REGRESSION_TEST_SET \ | ||
$REGRESSION_OPTIONS | ||
# this is a sanity check - needst to run after so that the folder has been created | ||
grep "MedCAT Version" "${model_path%.*}/model_card.json" | ||
# clean up here so we don't leave both the .zip'ed model | ||
# and the folder so we don't fill the disk | ||
echo "Cleaning up at: ${model_path%.*}" | ||
rm -rf ${model_path%.*}* | ||
else | ||
echo "No files found matching the pattern: $file" | ||
fi | ||
done | ||
|
||
# Remove the folder if it was created by the script | ||
if [ $CREATED -eq 1 ]; then | ||
rm -r "$MODEL_FOLDER" | ||
fi |
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.
pretty defensive? would it matter if this dir is removed between runs? Maybe just do:
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.
The idea was that if the model existed before, then it was "meant to be there" and may have things that are expected in there. And I didn't want to remove other stuff that's (potentially) in there at the end.
With that said, you're probably right - there shouldn't really be a reason for that to be the case.