Skip to content

Commit a4ea01e

Browse files
committed
fix al2023
1 parent 7d423f7 commit a4ea01e

5 files changed

Lines changed: 82 additions & 21 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ jobs:
2424
rie: aws-lambda-rie-arm64
2525
label: arm64
2626
distro_config:
27+
# al2023
28+
- distro: al2023
29+
distro_version: "al2023"
30+
runtime_version: "3.4"
31+
executable: /usr/local/bin/aws_lambda_ric
32+
- distro: al2023
33+
distro_version: "al2023"
34+
runtime_version: "3.3"
35+
executable: /usr/local/bin/aws_lambda_ric
2736
# Alpine
2837
- distro: alpine
2938
distro_version: "3.23"
@@ -42,7 +51,7 @@ jobs:
4251
distro_version: bookworm
4352
runtime_version: "3.3"
4453
executable: /usr/local/bundle/bin/aws_lambda_ric
45-
# Debian
54+
# Ubuntu
4655
- distro: ubuntu
4756
distro_version: "24.04"
4857
runtime_version: "3.4"

test/integration/docker/Dockerfile.echo.amazonlinux renamed to .scratch/Dockerfile.tmp

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# Define global args
2-
ARG DISTRO_VERSION
2+
ARG RUNTIME_VERSION
33

4-
# Grab a fresh copy of the image and install ruby and build the runtime interface client gem
5-
FROM amazonlinux:${DISTRO_VERSION} AS build-image
4+
# Build stage: compile Ruby and build the RIC gem
5+
FROM public.ecr.aws/lambda/provided:al2023 AS build-image
66

77
ARG RUNTIME_VERSION
88

9-
RUN yum update -y && \
10-
yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
9+
RUN dnf update -y && \
10+
dnf install -y git gcc gcc-c++ make openssl-devel readline-devel zlib-devel \
11+
libffi-devel libyaml-devel bzip2 autoconf automake libtool bison tar gzip
1112

1213
RUN rm -rf /root/.rbenv/
1314
RUN git clone https://github.com/rbenv/rbenv.git /root/.rbenv
1415
ENV PATH="/root/.rbenv/bin:$PATH"
15-
RUN echo 'eval "$(rbenv init -)"' >> /root/.bashrc
1616
RUN git clone https://github.com/rbenv/ruby-build.git /root/.rbenv/plugins/ruby-build
17-
RUN source /root/.bashrc
18-
RUN RUNTIME_VERSIONS=($(rbenv install -L | grep -oE $(echo "^${RUNTIME_VERSION}\.[0-9]+"))) && \
17+
RUN RUNTIME_VERSIONS=($(rbenv install -L | grep -oE $(echo "^${RUNTIME_VERSION}\.[0-9]+"))) && \
1918
RUNTIME_LATEST_VERSION=${RUNTIME_VERSIONS[-1]} && \
2019
rbenv install -v ${RUNTIME_LATEST_VERSION} && \
2120
rbenv global ${RUNTIME_LATEST_VERSION} && \
@@ -24,42 +23,37 @@ RUN RUNTIME_VERSIONS=($(rbenv install -L | grep -oE $(echo "^${RUNTIME_VERSION}
2423
gem install bundler
2524

2625
ARG RIC_BUILD_DIR="/build"
27-
# Create directory to build the Runtime Interface Client gem
2826
RUN mkdir -p ${RIC_BUILD_DIR}
29-
3027
WORKDIR ${RIC_BUILD_DIR}
3128
COPY . .
3229
RUN rake build
3330

3431

35-
# Grab a fresh copy of the Ruby image
36-
FROM amazonlinux:${DISTRO_VERSION}
37-
38-
RUN yum install -y curl
32+
# Runtime stage
33+
FROM public.ecr.aws/lambda/provided:al2023
3934

4035
ARG RUNTIME_VERSION
4136

37+
RUN dnf install -y libyaml
38+
4239
# Copy ruby from the build-image
4340
COPY --from=build-image /root/.rbenv /root/.rbenv
44-
4541
ENV PATH="/root/.rbenv/bin:$PATH"
4642

4743
# Copy the Runtime Interface Client gem and install it
4844
ARG RIC_BUILD_DIR="/build"
4945
COPY --from=build-image ${RIC_BUILD_DIR}/pkg/aws_lambda_ric*.gem aws_lambda_ric.gem
50-
RUN RUNTIME_VERSIONS=($(rbenv install -L | grep -oE $(echo "^${RUNTIME_VERSION}\.[0-9]+"))) && \
46+
RUN RUNTIME_VERSIONS=($(rbenv install -L | grep -oE $(echo "^${RUNTIME_VERSION}\.[0-9]+"))) && \
5147
RUNTIME_LATEST_VERSION=${RUNTIME_VERSIONS[-1]} && \
5248
cp /root/.rbenv/versions/${RUNTIME_LATEST_VERSION}/bin/gem /usr/local/bin/gem && \
5349
gem install aws_lambda_ric.gem && \
5450
cp /root/.rbenv/versions/${RUNTIME_LATEST_VERSION}/bin/aws_lambda_ric /usr/local/bin/aws_lambda_ric
5551

5652
ARG FUNCTION_DIR="/function"
57-
5853
RUN mkdir -p ${FUNCTION_DIR}
59-
# Copy function code
6054
COPY test/integration/test-handlers/echo/* ${FUNCTION_DIR}
61-
# Set working directory to function root directory
6255
WORKDIR ${FUNCTION_DIR}
6356

6457
ENTRYPOINT ["aws_lambda_ric"]
6558
CMD ["app.App::Handler.process"]
59+
COPY .scratch/aws-lambda-rie /usr/bin/aws-lambda-rie

.scratch/aws-lambda-rie

8.58 MB
Binary file not shown.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Define global args
2+
ARG RUNTIME_VERSION
3+
4+
# Build stage: compile Ruby and build the RIC gem
5+
FROM public.ecr.aws/lambda/provided:al2023 AS build-image
6+
7+
ARG RUNTIME_VERSION
8+
9+
RUN dnf update -y && \
10+
dnf install -y git gcc gcc-c++ make openssl-devel readline-devel zlib-devel \
11+
libffi-devel libyaml-devel bzip2 autoconf automake libtool bison tar gzip
12+
13+
RUN rm -rf /root/.rbenv/
14+
RUN git clone https://github.com/rbenv/rbenv.git /root/.rbenv
15+
ENV PATH="/root/.rbenv/bin:$PATH"
16+
RUN git clone https://github.com/rbenv/ruby-build.git /root/.rbenv/plugins/ruby-build
17+
RUN RUNTIME_VERSIONS=($(rbenv install -L | grep -oE $(echo "^${RUNTIME_VERSION}\.[0-9]+"))) && \
18+
RUNTIME_LATEST_VERSION=${RUNTIME_VERSIONS[-1]} && \
19+
rbenv install -v ${RUNTIME_LATEST_VERSION} && \
20+
rbenv global ${RUNTIME_LATEST_VERSION} && \
21+
cp /root/.rbenv/versions/${RUNTIME_LATEST_VERSION}/bin/gem /usr/local/bin/gem && \
22+
cp /root/.rbenv/versions/${RUNTIME_LATEST_VERSION}/bin/rake /usr/local/bin/rake && \
23+
gem install bundler
24+
25+
ARG RIC_BUILD_DIR="/build"
26+
RUN mkdir -p ${RIC_BUILD_DIR}
27+
WORKDIR ${RIC_BUILD_DIR}
28+
COPY . .
29+
RUN rake build
30+
31+
32+
# Runtime stage
33+
FROM public.ecr.aws/lambda/provided:al2023
34+
35+
ARG RUNTIME_VERSION
36+
37+
RUN dnf install -y libyaml
38+
39+
# Copy ruby from the build-image
40+
COPY --from=build-image /root/.rbenv /root/.rbenv
41+
ENV PATH="/root/.rbenv/bin:$PATH"
42+
43+
# Copy the Runtime Interface Client gem and install it
44+
ARG RIC_BUILD_DIR="/build"
45+
COPY --from=build-image ${RIC_BUILD_DIR}/pkg/aws_lambda_ric*.gem aws_lambda_ric.gem
46+
RUN RUNTIME_VERSIONS=($(rbenv install -L | grep -oE $(echo "^${RUNTIME_VERSION}\.[0-9]+"))) && \
47+
RUNTIME_LATEST_VERSION=${RUNTIME_VERSIONS[-1]} && \
48+
cp /root/.rbenv/versions/${RUNTIME_LATEST_VERSION}/bin/gem /usr/local/bin/gem && \
49+
gem install aws_lambda_ric.gem && \
50+
cp /root/.rbenv/versions/${RUNTIME_LATEST_VERSION}/bin/aws_lambda_ric /usr/local/bin/aws_lambda_ric
51+
52+
ARG FUNCTION_DIR="/function"
53+
RUN mkdir -p ${FUNCTION_DIR}
54+
COPY test/integration/test-handlers/echo/* ${FUNCTION_DIR}
55+
WORKDIR ${FUNCTION_DIR}
56+
57+
ENTRYPOINT ["aws_lambda_ric"]
58+
CMD ["app.App::Handler.process"]

test/integration/run-local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ case "$DISTRO" in
1717
alpine|debian)
1818
EXECUTABLE="/usr/local/bundle/bin/aws_lambda_ric"
1919
;;
20-
amazonlinux|ubuntu)
20+
al2023|amazonlinux|ubuntu)
2121
EXECUTABLE="/usr/local/bin/aws_lambda_ric"
2222
;;
2323
*)

0 commit comments

Comments
 (0)