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

chore(sdk): updating the aws-sdk to version 3.577.0 #5611

Merged
merged 24 commits into from May 17, 2024

Conversation

marciocadev
Copy link
Collaborator

@marciocadev marciocadev commented Feb 2, 2024

This PR updates the aws-sdk past version 3.502, which reduces the cold start runtime on Lambdas according to the article by David Behroozi: Coldstarts with the AWS Javascript 3.502 SDK

I did some tests and in a simple code like the one below, I managed to reduce the cold start from an average of 340ms to an average of 280ms (it's not much but every millisecond counts).

bring cloud;

let counter = new cloud.Counter() as "my-counter";

new cloud.Function(inflight () => {
  counter.inc();
}) as "my-function";

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@marciocadev marciocadev requested a review from a team as a code owner February 2, 2024 18:53
@marciocadev marciocadev changed the title feat(sdk): update aws-sdk version feat(sdk): updating the aws-sdk to version 3.502.0 Feb 2, 2024
@marciocadev marciocadev changed the title feat(sdk): updating the aws-sdk to version 3.502.0 chore(sdk): updating the aws-sdk to version 3.502.0 Feb 2, 2024
@marciocadev marciocadev marked this pull request as draft February 3, 2024 15:27
@staycoolcall911
Copy link
Contributor

Hey @marciocadev - what's the status of this PR? Once it's ready for review please let me know and move it out of draft, thank you

@marciocadev
Copy link
Collaborator Author

Hey @staycoolcall911

I'm having an issue with the getSignedUrl test, the aws-sdk is a bit tricky to mock and spyOn

@marciocadev
Copy link
Collaborator Author

@staycoolcall911, I need some help here.

Everything is okay, but the signedUrl test isn't working because I can't mock the getSignedUrl method. I created a project to test by copying this method, and the test I'm using in my project works perfectly.

I'm not able to get this to work, could someone help me with this?

Here's the project with the test working

https://github.com/marciocadev/AWSSignedUrlTest

@staycoolcall911
Copy link
Contributor

Hey @marciocadev - of course, I'll find someone to help you out.

@staycoolcall911
Copy link
Contributor

@marciocadev - @hasanaburayyan will reach out soon.

@hasanaburayyan
Copy link
Collaborator

@marciocadev my bad, I for some reason thought #5429 included this change. But I see it only upgraded the sdk to 3.490.0

@Chriscbr
Copy link
Contributor

Chriscbr commented Mar 6, 2024

I tried a few approaches (like mocks and spies) within our repo and also got stuck. After seeing it worked in https://github.com/marciocadev/AWSSignedUrlTest, I decided to instead try removing code from our repo to see what was necessary to get it working.

I'm not quite sure why it fixes it, but if I comment out this line in our vitest config, it seems to fix the test. cc @MarkMcCulloh

globalSetup: "test/global.setup.ts",

marciocadev and others added 2 commits March 6, 2024 20:16
@marciocadev marciocadev changed the title chore(sdk): updating the aws-sdk to version 3.502.0 chore(sdk): updating the aws-sdk to version 3.523.0 Mar 8, 2024
@Chriscbr
Copy link
Contributor

@marciocadev @hasanaburayyan I feel for now it's better if we upgrade to the latest AWS SDK version and try to address the test mocking issue another time. I've pushed a commit that skips the relevant tests - let's try and get this across the finish line

monadabot and others added 2 commits April 19, 2024 19:22
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Apr 19, 2024
@Chriscbr Chriscbr changed the title chore(sdk): updating the aws-sdk to version 3.523.0 chore(sdk): updating the aws-sdk to version 3.577.0 May 17, 2024
@Chriscbr Chriscbr marked this pull request as ready for review May 17, 2024 20:26
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label May 17, 2024
@Chriscbr
Copy link
Contributor

Copy link
Contributor

mergify bot commented May 17, 2024

Thanks for contributing, @marciocadev! This PR will now be added to the merge queue, or immediately merged if update-aws-sdk is up-to-date with main and the queue is empty.

@mergify mergify bot merged commit c43ce84 into winglang:main May 17, 2024
15 checks passed
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.73.53.

eladb pushed a commit that referenced this pull request May 18, 2024
This PR updates the aws-sdk past version 3.502, which reduces the cold start runtime on Lambdas according to the article  by David Behroozi: [Coldstarts with the AWS Javascript 3.502 SDK](https://speedrun.nobackspacecrew.com/blog/2024/02/01/coldstarts-with-the-aws-javascript-3502-sdk.html)

I did some tests and in a simple code like the one below, I managed to reduce the cold start from an average of 340ms to an average of 280ms (it's not much but every millisecond counts).

```wing
bring cloud;

let counter = new cloud.Counter() as "my-counter";

new cloud.Function(inflight () => {
  counter.inc();
}) as "my-function";
```

- [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [ ] Tests added (always)
- [ ] Docs updated (only required for features)
- [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
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.

None yet

6 participants