Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1453 +/- ##
==========================================
+ Coverage 77.02% 77.22% +0.19%
==========================================
Files 219 221 +2
Lines 14853 14941 +88
==========================================
+ Hits 11441 11538 +97
+ Misses 3412 3403 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Inputs tarball re-uploaded under a doubled storage prefix (
oasis/files/oasis/files/)When a model run adds extra input files,
generate_losses_outputwrites the inputs tarball back to storage under the wrong key. With S3 storage andAWS_LOCATIONset, the storage location prefix ends up in the key twice, so the object lands at<AWS_LOCATION>/<AWS_LOCATION>/<name>. The original object it was meant to replace is left unchanged.Seen in a tenant bucket as:
s3://<bucket>/oasis/files/oasis/files/...withOASIS_AWS_LOCATION=oasis/filesAffected versions
oasis-data-manager==0.2.3STORAGE_TYPE=S3and a non-emptyAWS_LOCATIONinput-data, e.g.occurrence.binRoot cause
oasis-data-manager
158b037("Fix OASIS_AWS_LOCATION var", #43) changedAwsS3Storage.put()in two ways:locationin front of the key it writes;oasis/files/<name>).That behaviour is intended: the server's
is_in_bucket()/ CopyObject andfile_storage_link()all work with raw bucket keys.src/model_execution_worker/distributed_tasks.py(generate_losses_output) takes a reference to the stored tarball and passes it straight back intoput():input_location_storage is one of two things:
Either way the existing inputs tarball isn't overwritten. It keeps its old contents, and a stray object is written somewhere else in the bucket.
Impact
Fix
Branch fix/aws-location-issue:
src/common/filestore/filestore.py: new strip_storage_location(filestore, reference), which removes a leading location/ from a key and leaves anything else unchanged.
src/model_execution_worker/distributed_tasks.me(), used for the re-upload:
put() then adds the prefix exactly once and o. Shared-filesystem storage is unaffected.
Tests
AwsS3Storage(location='oasis/files'), includitrip.
All worker tests pass (89) and flake8 is clean. t covered by this fixServer file conversion (files/v1_api/tasks.pyres the location-prefixed key fromget_storage_url() in converted_file, so DjangION a second time when reading it. This can'thappen today: run_file_conversion fails earlier, because get_filestore(settings) is given Django settings, which have no .get(). The converter package also isn't instif conversion is turned back on.