You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-30Lines changed: 34 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,26 @@ The Python Runtime Interface Client package currently supports Python versions:
14
14
15
15
## Usage
16
16
17
+
### Container-Based Builds
18
+
19
+
For development or when you need to build awslambdaric from source, you can use container-based builds to ensure consistent compilation across different platforms, and native dependencies linking.
20
+
21
+
```shell script
22
+
# Build awslambdaric wheel in a Linux container
23
+
make build-container
24
+
# Or with poetry (run 'poetry install' first):
25
+
poetry run build-container
26
+
27
+
# Test with RIE using the built wheel
28
+
make test-rie
29
+
# Or with poetry:
30
+
poetry run test-rie
31
+
```
32
+
33
+
This approach builds the C++ extensions in a Linux environment, ensuring compatibility with Lambda's runtime environment regardless of your host OS.
34
+
35
+
**Note**: Running `make build` (or `poetry run build`) on non-Linux machines will not properly link the native C++ dependencies, resulting in a non-functional runtime client. Always use container-based builds for development.
36
+
17
37
### Creating a Docker Image for Lambda with the Runtime Interface Client
18
38
First step is to choose the base image to be used. The supported Linux OS distributions are:
To make it easy to locally test Lambda functions packaged as container images we open-sourced a lightweight web-server, Lambda Runtime Interface Emulator (RIE), which allows your function packaged as a container image to accept HTTP requests. You can install the [AWS Lambda Runtime Interface Emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator) on your local machine to test your function. Then when you run the image function, you set the entrypoint to be the emulator.
107
-
108
-
*To install the emulator and test your Lambda function*
109
-
110
-
1) From your project directory, run the following command to download the RIE from GitHub and install it on your local machine.
126
+
To test Lambda functions with the Runtime Interface Client, use the [AWS Lambda Runtime Interface Emulator (RIE)](https://github.com/aws/aws-lambda-runtime-interface-emulator). To test your local changes with RIE (Runtime Interface Emulator):
This command invokes the function running in the container image and returns a response.
135
-
136
-
*Alternately, you can also include RIE as a part of your base image. See the AWS documentation on how to [Build RIE into your base image](https://docs.aws.amazon.com/lambda/latest/dg/images-test.html#images-test-alternative).*
137
-
138
143
139
144
## Development
140
145
@@ -145,7 +150,6 @@ Clone this repository and run:
0 commit comments