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.
As per https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html:
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:
So, I think we can be fairly confident that this is safe to deploy.
We should reconsider this whole setup 😄.