-
Notifications
You must be signed in to change notification settings - Fork 99
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
Lambda RIE as Standalone App/Container for Testing #83
Comments
Thank you for bring this to our attention. Just to understand the problem better, why can https://gallery.ecr.aws/lambda/java not be used? |
Ok, so what I'm trying to do is create automated tests using JUnit 5 + TestContainers + GraalVM for a custom Lambda Runtime Client and this could be achieved just by exposing a simple Dummy Lambda Emulator and overriding Do you think this is possible to achieve? |
So you are not able to use https://gallery.ecr.aws/lambda/java because you are not using the included Java Lambda Runtime Interface Client (RIC), but you are building your own RIC and want to test that? |
Hello @bodelsc , no. I'm just looking for a Runtime API Emulator/Simulator that I can just Pub/Sub and assert responses to test a Custom HTTP Client |
The AWS base images for Lambda include the AWS Lambda Runtime Interface Emulator(RIE). For your purpose can you not copy your function's code into the container, start it and then use HTTP to make requests? See |
Is it possible to Start the Container Standalone without Function Code inside? |
I am unsure about starting, but you can create one, copy in code etc and then start it. E.g.
|
I want to do the same. I took a stab at it like this: FROM ubuntu
RUN apt-get update && \
apt-get install -y curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p ~/.aws-lambda-rie && \
curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \
https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64 && \
chmod +x ~/.aws-lambda-rie/aws-lambda-rie && \
mv ~/.aws-lambda-rie/aws-lambda-rie /usr/local/bin/aws-lambda-rie
ENTRYPOINT [ "aws-lambda-rie" ] Then a docker compose: version: '3.9'
services:
lilfunc:
build: .
image: lilfunc:latest
container_name: lilfunc
environment:
AWS_LAMBDA_RUNTIME_API: rie:8080
depends_on:
- rie
rie:
build:
context: .
dockerfile: Dockerfile.rie
image: rie:latest
container_name: rie
ports:
- 9000:8080
But this happens in the function container:
|
I ended up creating a simple app that simulates lambda runtime api server. |
Hello,
For Testing purposes, in this case Java, it would be great that AWS makes Lambda RIE available as Standalone App/Container so we can easily add this to JUnit 5 + Test Containers and be able to do Integration Tests (via Public ECR Gallery) on our Clients.
Thanks
The text was updated successfully, but these errors were encountered: