-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
Support for runtime: provided
without requiring useDocker
#1792
Conversation
* master: refactor: use provided log utils (dherault#1784) fix: skip adding authorizer to event if no authorizer is configured (dherault#1786) Update README.md
* master: fix: Support httpApi authorizer with different config and function names (dherault#1763) fix: Support ALB Event response headers (dherault#1756) v13.6.0 fix: treat application/octet-stream as a binary encoding (dherault#1587) feat: add support for provided.al2023 (dherault#1788) v13.5.1
Hi @dherault and @DorianMazur this PR might stir up some debate, so let me know what you think! Long story short, I never liked the requirement to have Docker to run serverless applications that have a compiled binary. It also caused long-ish first-runs of a lambda function as it downloads and runs the base container and layers. I found myself wishing Docker wasn't involved in the execution of the |
hi @dherault and @DorianMazur it's been about a week, have you been able to take a look at this? |
I'm trusting your guts @DorianMazur |
Closing. I'm developing a framework outside of |
Description
This PR allows usage of
runtime: provided
inserverless.yml
anduseDocker
is unset or false incustom.serverless-offline
:It now uses the
execa
library to do a local execution of thebootstrap
script:Motivation and Context
bootstrap
script without launching it inside a docker containerdelve
)How this works:
runtime: provided
anduseDocker: false|undefined
, will create aRuntimeServer
on a random port, and set theAWS_LAMBDA_RUNTIME_API
environment variable so that thebootstrap
script can interact with it./response
is called, theevent
is cleared from theRuntimeServer
so subsequent invocations of/next
indefinitely block.Notes
RuntimeServer
per invocation:RuntimeServer
could be shared by setting theAWS_LAMBDA_RUNTIME_API
environment variable to be:http://localhost:${some-non-random-port}/function-name
instead ofhttp://localhost:${some-random-port}
useDocker: false
orundefined
and there arelayers
on the functionHow Has This Been Tested?
./tests/integration/docker/provided
to./tests/lambda-run-mode/provided
useDocker: true
and began development until it worked