-
Notifications
You must be signed in to change notification settings - Fork 227
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
EDSC-3932: Integrate edsc-visualize as a lambda into EDSC remove calls to the browse-scaler API #1716
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1716 +/- ##
==========================================
+ Coverage 91.95% 92.00% +0.04%
==========================================
Files 725 739 +14
Lines 19383 19638 +255
Branches 4585 4653 +68
==========================================
+ Hits 17824 18067 +243
- Misses 1423 1434 +11
- Partials 136 137 +1 ☔ View full report in Codecov by Sentry. |
e5eb48b
to
2a47a69
Compare
serverless/src/scaleImage/utils/cmr/__tests__/fetchCmrCollectionGranules.test.js
Outdated
Show resolved
Hide resolved
serverless/src/scaleImage/utils/cmr/__tests__/getBrowseImageUrlFromConcept.test.js
Show resolved
Hide resolved
serverless/src/scaleImage/utils/sharp/buildAndResizeUnavailableImageBuffer.js
Outdated
Show resolved
Hide resolved
serverless/src/scaleImage/utils/cache/__tests__/getCacheConnection.test.js
Outdated
Show resolved
Hide resolved
serverless/src/scaleImage/utils/sharp/buildUnavailableImageBuffer.js
Outdated
Show resolved
Hide resolved
serverless/src/scaleImage/utils/sharp/buildUnavailableImageBuffer.js
Outdated
Show resolved
Hide resolved
static/src/js/components/GranuleResults/GranuleResultsFocusedMeta.js
Outdated
Show resolved
Hide resolved
943f45a
to
485f598
Compare
This PR is still ongoing; the issue is that during some feature branch testing we came to find a dependency we have with our AWS infrastructure which requires NGAP to configure an additional API_GWY layer outside of our control to allow binary media types in the lambda responses. See ticket comments for accompanying |
485f598
to
e5f8c47
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1716 +/- ##
==========================================
+ Coverage 91.93% 92.01% +0.08%
==========================================
Files 730 744 +14
Lines 19568 19769 +201
Branches 4647 4700 +53
==========================================
+ Hits 17989 18190 +201
Misses 1441 1441
Partials 138 138 ☔ View full report in Codecov by Sentry. |
8e6fa37
to
868d45a
Compare
a91b96e
to
26f7197
Compare
6187038
to
2face82
Compare
EDSC-3932: Update Redis cache configuration
e9dee36
to
4082cde
Compare
@@ -144,7 +148,6 @@ | |||
"eslint-webpack-plugin": "^3.1.1", | |||
"events": "^3.3.0", | |||
"fast-xml-parser": "^4.1.3", | |||
"file-loader": "^6.2.0", |
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.
Was not being used
@@ -46,6 +46,10 @@ const ServerlessWebpackConfig = { | |||
], | |||
module: { | |||
rules: [ | |||
{ | |||
test: /\.svg$/, |
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.
Needed so I could read in an svg into serverless to return unavailable images during failures
@@ -64,7 +64,7 @@ tmp | |||
EOF | |||
|
|||
cat <<EOF > Dockerfile | |||
FROM node:18.16-bullseye | |||
FROM node:18.19-bullseye |
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 needed to be updated because sharp
its latest version, only accepts at least NPM10. Previous docker node image was using <10 so sharp was not being installed correctly see: https://sharp.pixelplumbing.com/install#cross-platform
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.
I'm still reviewing, but just wanted to get these out for now.
Overview
What is the feature?
We want to remove the application
browse-scaler
from CMR and achieve feature parity with that API as a lambda within EDSC. EDSC is the only client to that API and infrastructure, maintenance, and over complication of that API's artifacts can be significantly reduced this way.What is the Solution?
We pulled in an existing application which was never deployed
edsc-visaulize
(https://git.earthdata.nasa.gov/projects/EDSC/repos/edsc-visualize/browse/src/scaleImage) updated it to be able to integrate with EDSC and updated remaining EDSC modules to utilize this API in the from of a new AWS lambda. This also utilizes the infrastructure that browse-scaler previously used (a redis cache deployed as an elasticache) to cache images found to improve performance. Additionally due to limitations around API-gateway instances not allowing for binary media to be returned unless specificAccept
headers get passedimage/png
in our case. Because we cannot predict the order or the type of Accept header that a browser is going to sent via thesrc
prop of animg
element. We must request the image ourselves while supplying that Accept header. As a result we needed to add modules and refactor state of theEDSCImage
component so that we could ensure that thumbnails are rendered correctly. One additional point of contention was around the granule browse imagery cells on the granule table view. That component is wrapping around thereact-table
NPM component. Either that component (the NPM) or our implementation of the component has issues where table cells and columns are re-rendering often (this also occurs in prod but, is masked by browser-caching). We are significantly behind in versions and there was evidence that others experienced similar issues on their issues page. Memoization on those cells was not successful which appears to be because of thereact-table
package. Thev7
that we are using has reported issues where memoization was not possible for individual cells or columns. Due to this and the addition of the imagery modal popover which was added last year, and replaces much of that functionality, as well as the image size being small such that its use to discern granules is limited, we have elected to hide the cell for now and either delete it or restore it pending an update to the table component for its updated version.What areas of the application does this impact?
Serverless, cloud-formation, adds a new lambda, and alters collection/granule request modules
Testing
Reproduction steps
From the top level
/search
page we can see the thumbnails for the various collections and these should fill in as we scroll down for collections which have images. The rest should get the no image found default image instead.Click into a collection with a thumbnail to see the granule images once the granule images load we can scroll down to browse all of the granule images within a collection
Click on a specific granule i.e. make it a focused granule to get the image viewer modal to pop up. For granules with multiple images we can see all the images on that specific granule.
View the cache keys to ensure that values are in fact getting cached. To do so locally you need to enable the
useCache
feature toggle and utilize some redis cache either the service itself or through a docker containerAttachments
Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.
![image](https://private-user-images.githubusercontent.com/34591886/305228240-a86d60c8-975e-4bba-961d-c17cdba1615b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODMzNDksIm5iZiI6MTczOTU4MzA0OSwicGF0aCI6Ii8zNDU5MTg4Ni8zMDUyMjgyNDAtYTg2ZDYwYzgtOTc1ZS00YmJhLTk2M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hMmM4MzkyZTE1ZDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.99j7Wvgft2qCyFsmbxBvEtt7v_uwMXRz-9ZfFCMSVjc)
![image](https://private-user-images.githubusercontent.com/34591886/305228657-fea5d7b8-2e6f-432e-9dae-562fac673122.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODMzNDksIm5iZiI6MTczOTU4MzA0OSwicGF0aCI6Ii8zNDU5MTg4Ni8zMDUyMjg2NTctZmVhNWQ3YjgtMmU2Zi00MzJlLTlkYWUtNTYyZmFjNjczMTIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAxMzA0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU2MDJkNzI4YjY0YTA1YTQwMWJmNjIwMTc2NDQ2NjQ5ZjBlM2MwNTQwNTdhNjY2Nzc2ZDk1YTU5OGFjNzhjMjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hOkzEXYc5q71v2mOBvLcfsA17ukyeyMtmHFhNRG7vAs)
![image](https://private-user-images.githubusercontent.com/34591886/305228943-d161be96-8008-47c5-a539-7b950a6c88fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODMzNDksIm5iZiI6MTczOTU4MzA0OSwicGF0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