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
+1-132
Original file line number
Diff line number
Diff line change
@@ -1,135 +1,5 @@
1
1
## AWS Lambda Python Runtime Interface Client
2
2
3
-
<<<<<<< HEAD
4
-
The Lambda Runtime Interface Client helps with packaging functions using your own or community provided images.
5
-
It allows your runtime to receive requests from and send requests to the Lambda service.
6
-
The Runtime client starts the runtime and communicates with the Lambda [Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html) i.e., it calls the API for invocation events, starts the function code, calls the API to return the response.
7
-
The Lambda Python Runtime Interface Client is vended through [pip](https://pypi.org/project/awslambdaric).
8
-
You can include this package in your preferred base image to make that base image Lambda compatible.
9
-
10
-
## Requirements
11
-
The Python Runtime Interface Client package currently works on Python versions:
12
-
- Python 3.6.x
13
-
- Python 3.7.x
14
-
- Python 3.8.x
15
-
- Python 3.9.x
16
-
17
-
## Usage
18
-
19
-
### Creating a Docker Image for Lambda with the Runtime Interface Client
20
-
First step is to choose the base image to be used. The supported Linux OS distributions are:
21
-
22
-
- Amazon Linux 2
23
-
- Alpine
24
-
- CentOS
25
-
- Debian
26
-
- Ubuntu
27
-
28
-
29
-
Then, the Runtime Interface Client needs to be installed. We provide both wheel and source distribution. If the OS/pip version used does not support manylinux2014 wheels, you will also need to install the required build dependencies. Also, the Lambda function code needs to be copied into the image.
30
-
31
-
```Docker
32
-
# Include global arg in this stage of the build
33
-
ARG FUNCTION_DIR
34
-
35
-
# Install aws-lambda-cpp build dependencies
36
-
RUN apt-get update && \
37
-
apt-get install -y \
38
-
g++ \
39
-
make \
40
-
cmake \
41
-
unzip \
42
-
libcurl4-openssl-dev
43
-
44
-
45
-
# Create function directory
46
-
RUN mkdir -p ${FUNCTION_DIR}
47
-
48
-
# Copy handler function
49
-
COPY app/* ${FUNCTION_DIR}
50
-
51
-
# Install the function's dependencies
52
-
RUN pip install \
53
-
--target ${FUNCTION_DIR} \
54
-
awslambdaruntimeclient
55
-
```
56
-
57
-
The next step would be to set the `ENTRYPOINT` property of the Docker image to invoke the Runtime Interface Client and then set the `CMD` argument to specify the desired handler.
58
-
59
-
Example Dockerfile (to keep the image light we use a multi-stage build):
60
-
```Docker
61
-
# Define custom function directory
62
-
ARG FUNCTION_DIR="/function"
63
-
64
-
FROM python:buster as build-image
65
-
66
-
# Include global arg in this stage of the build
67
-
ARG FUNCTION_DIR
68
-
69
-
# Install aws-lambda-cpp build dependencies
70
-
RUN apt-get update && \
71
-
apt-get install -y \
72
-
g++ \
73
-
make \
74
-
cmake \
75
-
unzip \
76
-
libcurl4-openssl-dev
77
-
78
-
79
-
# Create function directory
80
-
RUN mkdir -p ${FUNCTION_DIR}
81
-
82
-
# Copy handler function
83
-
COPY app/* ${FUNCTION_DIR}
84
-
85
-
# Install the function's dependencies
86
-
RUN pip install \
87
-
--target ${FUNCTION_DIR} \
88
-
awslambdaric
89
-
90
-
91
-
FROM python:buster
92
-
93
-
# Include global arg in this stage of the build
94
-
ARG FUNCTION_DIR
95
-
96
-
# Set working directory to function root directory
For testing locally you will need to set up a local Runtime Interface Emulator against which the Runtime Interface Client will make API calls. You will need to post data to the endpoint it creates in order to invoke your function. For more information check out the [Runtime Interface Emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator).
110
-
111
-
112
-
## Development
113
-
114
-
### Building the package
115
-
Clone this repository and run:
116
-
117
-
```bash
118
-
make init
119
-
make build
120
-
```
121
-
122
-
### Running tests
123
-
124
-
Make sure the project is built:
125
-
```bash
126
-
make init build
127
-
```
128
-
Then,
129
-
* to run unit tests: `make test`
130
-
* to run integration tests: `make test-integ`
131
-
* to run examples: `make test-example`
132
-
=======
133
3
We have open-sourced a set of software packages, Runtime Interface Clients (RIC), that implement the Lambda
134
4
[Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html), allowing you to seamlessly extend your preferred
135
5
base images to be Lambda compatible.
@@ -141,7 +11,6 @@ You can include this package in your preferred base image to make that base imag
141
11
## Requirements
142
12
The Python Runtime Interface Client package currently supports Python versions:
143
13
- 3.6.x up to and including 3.9.x
144
-
>>>>>>> origin/main
145
14
146
15
## Usage
147
16
@@ -306,4 +175,4 @@ If you discover a potential security issue in this project we ask that you notif
306
175
307
176
## License
308
177
309
-
This project is licensed under the Apache-2.0 License.
178
+
This project is licensed under the Apache-2.0 License.
0 commit comments