Skip to content
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

configure DefaultTTL for CloudFront #1691

Merged
merged 2 commits into from
Mar 2, 2022

Conversation

tianleh
Copy link
Member

@tianleh tianleh commented Mar 2, 2022

Signed-off-by: Tianle Huang [email protected]

Description

As related issue states #1690, we observed that the latest build number is not updating even though the index.json file has changed content. After researching around, figure that the DefaultTTL shall be set to avoid the default behavior of caching for 1 day. Currently I set it to be 5mins to both get a recent build and also low the traffic impact to S3.

Issues Resolved

Resolves #1690

Tests

  1. unit test
  2. Deployed to my personal AWS account and verify the DefaultTTL change and also update the same file to see the change taking effect.

Screen Shot 2022-03-02 at 12 58 27 PM

Current value of index.json https://d17qm4xnop70sv.cloudfront.net/ci/dbc/distribution-build-opensearch/2.0.0/index.json
Screen Shot 2022-03-02 at 12 59 29 PM

updating the index.json to be 188.

confirm S3 has the new value.
Screen Shot 2022-03-02 at 1 01 18 PM

Refreshing https://d17qm4xnop70sv.cloudfront.net/ci/dbc/distribution-build-opensearch/2.0.0/index.json and still get 166

Screen Shot 2022-03-02 at 1 01 48 PM

waiting for 5min and will check again.

Screen Shot 2022-03-02 at 1 07 00 PM

We can see that 188 is showing!

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Tianle Huang <[email protected]>
@tianleh tianleh requested a review from a team as a code owner March 2, 2022 21:08
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2022

Codecov Report

Merging #1691 (2857272) into main (fbf167f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #1691   +/-   ##
=========================================
  Coverage     94.74%   94.74%           
  Complexity       14       14           
=========================================
  Files           166      166           
  Lines          3504     3504           
  Branches         26       26           
=========================================
  Hits           3320     3320           
  Misses          181      181           
  Partials          3        3           
Impacted Files Coverage Δ
deployment/lib/artifacts-public-access.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fbf167f...2857272. Read the comment docs.

@gaiksaya gaiksaya merged commit dd17a9d into opensearch-project:main Mar 2, 2022
@gaiksaya
Copy link
Member

gaiksaya commented Mar 2, 2022

I'll update this PR once the changes are deployed.

@gaiksaya
Copy link
Member

gaiksaya commented Mar 3, 2022

Hi @tianleh The changes have been deployed. Please check.
Thanks!

@tianleh
Copy link
Member Author

tianleh commented Mar 3, 2022

Hi @tianleh The changes have been deployed. Please check.
Thanks!

checked this.
https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/1.3.0/latest/linux/arm64/builds/opensearch/manifest.yml

Currently it is showing 1211
Screen Shot 2022-03-02 at 4 14 42 PM

I will check again once there is a newer bundle build for os 1.3.0

@tianleh
Copy link
Member Author

tianleh commented Mar 3, 2022

I will check again once there is a newer bundle build for os 1.3.0

Just checked again. It is now 1213. Things are working! Thanks @gaiksaya for the support!

Screen Shot 2022-03-02 at 7 50 45 PM

@tianleh
Copy link
Member Author

tianleh commented Mar 3, 2022

link to the main issue #1492

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.

[Bug]: distribution url to index.json is being cached by CloudFront leading to old value of latest url
4 participants