8000 Microns 1366 -Search for by sandyhider · Pull Request #12 · jhuapl-boss/boss-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Microns 1366 -Search for #12

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

Merged
merged 3 commits into from
Aug 5, 2018
Merged

Microns 1366 -Search for #12

merged 3 commits into from
Aug 5, 2018

Conversation

sandyhider
Copy link
Member

When corrupt tile images or zero length tile images are uploaded with the ingest client, it crashed the ingest_lambda.

Solution: Catch errors and use a ndarray of zeros. However we also need to shape the ndarray based off of the x and y tile dimensions.

Ingest lambda does not current have this information. It needs to be added to the s3 tile metadata.

This set of changes

  • catches ndarray errors
  • prints errors that can be searched in the cloudwatch logs afterwards
  • pulls the tile size from the tile metadata, which is needed to shape replacement black tiles

… shape the black tile when the actual tile data is corrupt.
… search Cloudwatch Logs for errors.

Added the symbolic link to allow the lambda function to be imported into test scripts.  Lambda is a reserved word so can't directly import that name.
@sandyhider
Copy link
Member Author

Heres the original PR. I am working on a Test for the ingest_lambda but thought it would be helpful to get this out first and give you time to review.

@sandyhider sandyhider requested a review from movestill August 4, 2018 15:40
@@ -29,6 +29,8 @@

from botocore.exceptions import ClientError

print("$$$ IN TILE UPLOAD LAMBDA $$$")
Copy link
Member Author

Choose a reason for hiding this comment

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

This is really unrelated but I found it helpful to be able to search multilambda logs for specific types of lambas. that is what this is giving us.

Copy link
Member
@lrodri29 lrodri29 left a comment

Choose a reason for hiding this comment

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

Looks good

else:
try:
tile_img = np.asarray(Image.open(image_bytes), dtype=dtype)
except TypeError as te:
Copy link
Member

Choose a reason for hiding this comment

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

Don’t really need to except as te since you’re not using te?

Copy link
Member
@movestill movestill left a comment

Choose a reason for hiding this comment

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

Looks good.

@sandyhider sandyhider merged commit 5866bc1 into master Aug 5, 2018
@sandyhider
Copy link
Member Author

I tried the test it looks like there is a lot of things that need to be Mocked for this to work. I added another ticket to pull ingest_lambda.py out of multilambda, refactor so it isn't one large single function and then create unit test on the parts.

@sandyhider sandyhider deleted the MICRONS-1366 branch August 5, 2018 19:17
@sandyhider sandyhider restored the MICRONS-1366 branch August 5, 2018 19:37
@sandyhider sandyhider deleted the MICRONS-1366 branch February 18, 2019 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0