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

Stream export payloads, so that we get a bigger quota #2058

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

rebeccacremona
Copy link
Contributor

As per https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html:

Response stream payloads have a soft limit of 20 MB as compared to the 6 MB limit for buffered responses.

This PR switches our code to call invoke_with_response_stream instead of plain invoke, and then adapts to the new response format.

I could not get anything similar working locally with the AWS Lambda Runtime Emulator that we are using. So, unfortunately, the branch of our code that talks to real AWS now differs even more substantially than before. But... I do not currently know of an alternative.

Our test suite, run through the emulator, is still useful: it proves that the lambda function itself works, even if it can't prove that our invocation of it will be correct in production, or that our error handling works.

For this PR, I have tested that locally by configuring my dev setup to talk directly to the real, deployed lambda function. I tested with:

  • small books that have always worked
  • big books that didn't used to work with the non-streaming approach, but now do
  • big books that still don't work, and error out

So, I think we can be fairly confident that this is safe to deploy.

We should reconsider this whole setup 😄.

@rebeccacremona rebeccacremona requested a review from a team as a code owner August 1, 2024 21:21
@rebeccacremona rebeccacremona requested review from cmsetzer and removed request for a team August 1, 2024 21:21
@rebeccacremona rebeccacremona requested review from bensteinberg and removed request for cmsetzer August 1, 2024 21:23
@rebeccacremona rebeccacremona removed the request for review from bensteinberg August 1, 2024 21:34
@rebeccacremona rebeccacremona merged commit 488d723 into harvard-lil:develop Aug 1, 2024
2 checks passed
@rebeccacremona rebeccacremona deleted the stream-lambda branch September 10, 2024 15:00
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.

2 participants