Skip to content

Commit 7a6f162

Browse files
authored
feat: Prepare for Node.js 24 + Lambda Managed Instances RIC Launch (#161)
* ci: Update CI workflow and expand build documentation * docs: Update release changelog for v4.0.0 release
1 parent 23449b8 commit 7a6f162

File tree

3 files changed

+111
-30
lines changed

3 files changed

+111
-30
lines changed
Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
name: test-on-push-and-pr
1+
name: CI
22

33
on:
44
push:
5-
branches: [ nodejs22.x ]
5+
branches: [nodejs24.x]
66
pull_request:
7-
branches: [ '*' ]
7+
branches: [nodejs24.x]
88

99
jobs:
10-
unit-test:
10+
build-and-test:
1111
runs-on: ubuntu-latest
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
node-version: [18, 20, 22]
16-
1712
steps:
18-
- uses: actions/checkout@v5
19-
- name: Build and run tests for Node.js ${{ matrix.node-version }}
20-
run: |
21-
docker build -f test/unit/Dockerfile.nodejs${{ matrix.node-version }}.x -t unit/nodejs.${{ matrix.node-version }}x .
22-
docker run unit/nodejs.${{ matrix.node-version }}x
13+
- uses: actions/checkout@v5
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: npm
20+
21+
- name: Install dependencies
22+
run: npm ci --ignore-scripts
23+
24+
- name: Build and test
25+
run: npm run build
2326

2427

README.md

Lines changed: 90 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,63 @@ docker run -p 9000:8080 my-lambda-function
6666
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"message":"test"}'
6767
```
6868

69+
### Building on Custom Linux Distributions
70+
71+
You can build and run Lambda functions with the RIC on your own platform. Here's a minimal Dockerfile example:
72+
73+
```dockerfile
74+
FROM quay.io/centos/centos:stream9 AS build-image
75+
76+
ARG NODE_VERSION=22.14.0
77+
ARG FUNCTION_DIR="/function"
78+
79+
# Install build dependencies
80+
RUN dnf -y install \
81+
autoconf \
82+
automake \
83+
cmake \
84+
gcc \
85+
gcc-c++ \
86+
libtool \
87+
make \
88+
python3 \
89+
xz \
90+
&& dnf clean all
91+
92+
# Install Node.js
93+
RUN ARCH=$(uname -m) && \
94+
if [ "$ARCH" = "x86_64" ]; then NODE_ARCH="x64"; else NODE_ARCH="arm64"; fi && \
95+
curl -fsSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz | \
96+
tar -xJ -C /usr/local --strip-components=1
97+
98+
# Create function directory
99+
RUN mkdir -p ${FUNCTION_DIR}
100+
WORKDIR ${FUNCTION_DIR}
101+
102+
RUN npm install aws-lambda-ric
103+
104+
ENTRYPOINT ["npx", "aws-lambda-ric"]
105+
CMD ["index.handler"]
106+
```
107+
108+
Build and run locally with RIE:
109+
110+
```bash
111+
docker build -t my-lambda .
112+
docker run -p 9000:8080 \
113+
-e AWS_LAMBDA_FUNCTION_NAME=test \
114+
-v ~/.aws-lambda-rie:/aws-lambda \
115+
--entrypoint /aws-lambda/aws-lambda-rie \
116+
my-lambda npx aws-lambda-ric index.handler
117+
```
118+
69119
## Building from Source
70120

71121
### Prerequisites
72122

73123
- Node.js 22.x or later
74124
- npm
75125
- Docker (for container builds)
76-
- Make
77126

78127
### Local Development
79128

@@ -85,44 +134,56 @@ cd aws-lambda-nodejs-runtime-interface-client
85134
# Install dependencies
86135
npm install
87136

88-
# Run tests
137+
# Run all tests with coverage and linting
89138
npm test
90139

140+
# Run unit tests only
141+
npm run test:unit
142+
143+
# Run integration tests only
144+
npm run test:integ
145+
91146
# Run linter
92147
npm run lint
93148

94149
# Fix linting issues
95150
npm run lint:fix
96-
```
97151

98-
### Build Modes
152+
# Clean build artifacts
153+
npm run clean
154+
```
99155

100-
The project supports multiple build modes:
156+
### Build Commands
101157

102-
#### Metal Build (Local Development)
158+
#### Local Build
103159

104-
Fast build for local development and quick iterations:
160+
Build TypeScript and package for distribution:
105161

106162
```bash
107-
npm run build:metal
163+
npm run build
108164
```
109165

110-
- TypeScript compilation only
111-
- No native module compilation
112-
- ~5 seconds build time
166+
This runs tests, compiles TypeScript, and packages the output.
167+
168+
Individual steps:
169+
```bash
170+
npm run compile # TypeScript compilation only
171+
npm run pkg # Package with esbuild
172+
```
113173

114174
#### Container Build (Full Build)
115175

116-
Complete build including native module compilation:
176+
Complete build including native module compilation for Linux:
117177

118178
```bash
119179
npm run build:container
120180
```
121181

122182
- Builds using Docker on AL2023 base image
123-
- Compiles native C++ dependencies
124-
- Produces deployable artifacts
125-
- ~2-3 minutes build time
183+
- Compiles native C++ dependencies (curl, aws-lambda-cpp)
184+
- Produces deployable artifacts in `build-artifacts/`
185+
- Targets `linux/amd64` by default for Lambda compatibility
186+
- Use `PLATFORM=linux/arm64 npm run build:container` for ARM64 Lambda
126187

127188
### Testing with RIE
128189

@@ -139,6 +200,19 @@ npm run peek:rie
139200
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"message":"test"}'
140201
```
141202

203+
For multi-concurrent testing:
204+
```bash
205+
npm run peek:rie:mc
206+
```
207+
208+
### Interactive Container Testing
209+
210+
To explore the built package in an interactive container:
211+
212+
```bash
213+
npm run peek:container
214+
```
215+
142216
### Testing in Lambda using Container Image
143217

144218
To deploy and test as a Lambda container function:
@@ -149,7 +223,7 @@ npm run build:container
149223

150224
# Review and update variables in scripts/lambda-build.sh
151225

152-
# Build and deploy
226+
# Build and deploy (requires AWS credentials)
153227
npm run peek:lambda
154228
```
155229

RELEASE.CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### Dec 4, 2025
2+
`4.0.0`
3+
- Initial release of `v4` AWS Lambda Runtime Interface Client for NodeJS with typescript and multiconcurrency support for Node.js 24 and Lambda Managed Instances.
4+
15
### May 21, 2025
26
`3.3.0`
37
- Add support for multi tenancy ([#128](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/pull/128))

0 commit comments

Comments
 (0)