roche icon indicating copy to clipboard operation
roche copied to clipboard

Create an AWS Lambda compat layer

Open No9 opened this issue 5 years ago • 12 comments

In order to run this on AWS lambda a set of tide APIs need to be built into a base image to interact with the base platform. The APIs are specified here https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html

No9 avatar Dec 07 '20 00:12 No9

Hi @No9, aws lambda now support containers ( https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/ ) and may this be a more simple way to make it works, but a custom runtime sounds good also.

pepoviola avatar Dec 07 '20 12:12 pepoviola

Thanks @pepoviola that's not what I took from the announcement. In the link above it says:

You can deploy your own arbitrary base images to Lambda, for example images based on Alpine or Debian Linux. To work with Lambda, these images must implement the Lambda Runtime API.

I may have misunderstood the article (I'm happy to be wrong). From what I can tell amazon given access to the container version of the runtimes they support but if you're using something different like rust you're on your own.

No9 avatar Dec 07 '20 15:12 No9

Ahh yes, you need the extra work to make it works in lambda. 👍

pepoviola avatar Dec 07 '20 15:12 pepoviola

Hi @No9, I found this repo that add a runtime for running docker images in awa lambda https://github.com/glassechidna/serverlessish . Could be a good starting point for this issue.

Thx!

pepoviola avatar Dec 19 '20 15:12 pepoviola

Thanks @pepoviola I've also started on the rust build

No9 avatar Dec 19 '20 16:12 No9

Thanks @pepoviola

I've also started on the rust build

Ahh that great! Let me know if I can help you.

pepoviola avatar Dec 19 '20 17:12 pepoviola

I'll get it feature comparative with the script and push it out. Once we have the lambda compat layer we might also want to look at this from the JSFoundation for inspiration / integration? https://arc.codes/docs/en/guides/get-started/why-architect

No9 avatar Dec 20 '20 00:12 No9

Sounds great!

pepoviola avatar Dec 20 '20 01:12 pepoviola

Hi @No9, Jeremiah publish a lambda listener for tide yesterday ( https://github.com/Fishrock123/tide-lambda-listener ), I think exploring how to integrate with roche would be a nice step forward 👍

We can maybe add sam cli to run locally and deploy to aws :D Thx!

pepoviola avatar May 20 '21 17:05 pepoviola

Awesome news - Thanks for the update!!

No9 avatar May 20 '21 21:05 No9

Hi @No9, I just created an example app using the lambda listener. Is a little bit hacky how to use the build.rs file to only compile the needed code buts works. This is the repo if you want to take a look https://github.com/pepoviola/tide-lambda-listener-example

Thx!

pepoviola avatar Jun 08 '21 11:06 pepoviola

Hey @pepoviola very cool - i'll take a look

No9 avatar Jul 09 '21 20:07 No9