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
+28-21
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
## AWS Lambda Ruby Runtime Interface Client
2
2
3
-
We have open-sourced a set of software packages, Runtime Interface Clients (RIC), that implement the Lambda
4
-
[Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html), allowing you to seamlessly extend your preferred
5
-
base images to be Lambda compatible.
6
-
The Lambda Runtime Interface Client is a lightweight interface that allows your runtime to receive requests from and send requests to the Lambda service.
3
+
We have open-sourced a set of software packages, Runtime Interface Clients (RIC), that implements the Lambda
4
+
[Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html), allowing you to seamlessly extend
5
+
your preferred base images to be Lambda compatible.
6
+
The Lambda Runtime Interface Client is a lightweight interface that allows your runtime to
7
+
receive requests from and send requests to the Lambda service.
7
8
8
9
The Lambda Ruby Runtime Interface Client is vended through [rubygems](https://rubygems.org/gems/aws_lambda_ric).
9
10
You can include this package in your preferred base image to make that base image Lambda compatible.
10
11
11
12
## Requirements
12
-
The Ruby Runtime Interface Client package currently supports Ruby versions:
13
-
- 3.2 and 3.3
13
+
The Ruby Runtime Interface Client package currently supports ruby 3.0 and above.
14
14
15
15
## Usage
16
16
@@ -37,17 +37,9 @@ Or install it manually as:
37
37
38
38
$ gem install aws_lambda_ric
39
39
40
-
41
-
Next step would be to copy your Lambda function code into the image's working directory.
42
-
```dockerfile
43
-
# Copy function code
44
-
RUN mkdir -p ${FUNCTION_DIR}
45
-
COPY app.rb ${FUNCTION_DIR}
46
-
47
-
WORKDIR ${FUNCTION_DIR}
48
-
```
49
-
50
-
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.
40
+
The next step would be to copy your Lambda function code into the image's working directory.
41
+
You will need to set the `ENTRYPOINT` property of the Docker image to invoke the Runtime Interface Client and
42
+
then set the `CMD` argument to specify the desired handler.
Note that the `ENTRYPOINT` may differ based on the base image used. You can find the correct path by running an
80
+
interactive shell in the container and checking the installed location of the gem.
81
+
82
+
```shell script
83
+
docker run -it --rm amazonlinux:latest bash
84
+
yum install -y which ruby
85
+
gem install aws_lambda_ric
86
+
which aws_lambda_ric
87
+
```
88
+
89
+
Finally, create a Ruby handler. This is an example `app.rb`:
90
+
88
91
```ruby
89
92
moduleApp
90
93
classHandler
@@ -97,7 +100,10 @@ end
97
100
98
101
### Local Testing
99
102
100
-
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.
103
+
To make it easy to locally test Lambda functions packaged as container images we open-sourced a lightweight web-server,
104
+
Lambda Runtime Interface Emulator (RIE), which allows your function packaged as a container image to accept HTTP requests.
105
+
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.
106
+
Thenm when you run the image function, you set the entrypoint to be the emulator.
101
107
102
108
*To install the emulator and test your Lambda function*
0 commit comments