Skip to content

Commit f5351be

Browse files
committed
Add test environment for Amazon Linux 2023
1 parent 40f350d commit f5351be

File tree

8 files changed

+150
-0
lines changed

8 files changed

+150
-0
lines changed

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,37 @@ jobs:
100100
runCmd: |
101101
./py27/setup
102102
./py27/test
103+
amazonlinux2023-x86-64:
104+
name: AmazonLinux2023/x86_64
105+
runs-on: ubuntu-22.04
106+
needs: image
107+
steps:
108+
- name: Checkout
109+
uses: actions/checkout@v4
110+
- name: Test
111+
uses: devcontainers/ci@v0.2
112+
with:
113+
push: never
114+
cacheFrom: ghcr.io/rails-lambda/crypteia-ci
115+
runCmd: |
116+
./amzn2023/setup
117+
./amzn2023/test
118+
amazonlinux2023-arm64:
119+
name: AmazonLinux2023 arm64
120+
runs-on: ubuntu-22.04
121+
needs: image
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v4
125+
- name: Set up QEMU
126+
uses: docker/setup-qemu-action@v3
127+
- name: Set up Docker Buildx
128+
uses: docker/setup-buildx-action@v3
129+
- name: Test
130+
uses: devcontainers/ci@v0.2
131+
with:
132+
push: never
133+
cacheFrom: ghcr.io/rails-lambda/crypteia-ci
134+
runCmd: |
135+
./amzn2023/setup-arm64
136+
./amzn2023/test-arm64

amzn2023/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM public.ecr.aws/amazonlinux/amazonlinux:2023
2+
3+
RUN dnf install -y gcc openssl-devel python3-pip
4+
RUN dnf clean all
5+
6+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
7+
ENV PATH="/root/.cargo/bin:${PATH}"
8+
9+
RUN /root/.cargo/bin/rustup update \
10+
&& /root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
11+
RUN rustup default stable
12+
13+
ENV CRYPTEIA_BUILD_OS=amzn
14+
ENV CRYPTEIA_BUILD_TARGET=x86_64-unknown-linux-gnu

amzn2023/Dockerfile-arm64

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM public.ecr.aws/amazonlinux/amazonlinux:2023-arm64
2+
3+
RUN dnf install -y gcc openssl-devel python3-pip
4+
RUN dnf clean all
5+
6+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
7+
ENV PATH="/root/.cargo/bin:${PATH}"
8+
9+
RUN /root/.cargo/bin/rustup update \
10+
&& /root/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
11+
RUN rustup default stable
12+
13+
ENV CRYPTEIA_BUILD_OS=amzn
14+
ENV CRYPTEIA_BUILD_TARGET=aarch64-unknown-linux-gnu

amzn2023/Dockerfile-test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM public.ecr.aws/lambda/provided:al2023
2+
3+
COPY build/crypteia-amzn /opt/extensions/crypteia
4+
COPY build/libcrypteia-amzn.so /opt/lib/libcrypteia.so
5+
6+
ENV CRYPTEIA_BUILD_OS=amzn
7+
ENV SKIP_CARGO_TEST=1
8+
9+
ENV EXISTING=existingvalue
10+
ENV LD_PRELOAD=/opt/lib/libcrypteia.so
11+
12+
# For assert.sh support
13+
RUN dnf install -y util-linux
14+
RUN dnf clean all

amzn2023/setup

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
set -e
3+
4+
echo "== [amzn2023/Dockerfile] building... =="
5+
docker build --tag crypteia-lambda-amzn2023 --file amzn2023/Dockerfile .
6+
7+
echo "== [amzn2023/Dockerfile] bin/setup =="
8+
docker run \
9+
--rm \
10+
--user root \
11+
--entrypoint "./bin/setup" \
12+
--volume "${PWD}:/var/task" \
13+
crypteia-lambda-amzn2023

amzn2023/setup-arm64

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
set -e
3+
4+
echo "== [amzn2023/Dockerfile-arm64] building... =="
5+
docker build --tag crypteia-lambda-amzn2023-arm64 --file amzn2023/Dockerfile-arm64 .
6+
7+
echo "== [amzn2023/Dockerfile-arm64] bin/setup =="
8+
docker run \
9+
--rm \
10+
--user root \
11+
--entrypoint "./bin/setup" \
12+
--volume "${PWD}:/var/task" \
13+
--platform=linux/arm64 \
14+
crypteia-lambda-amzn2023-arm64

amzn2023/test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
set -e
3+
4+
echo "== [amzn2023/Dockerfile] bin/test =="
5+
docker run \
6+
--rm \
7+
--user root \
8+
--entrypoint "./test/libcrypteia.sh" \
9+
--volume "${PWD}:/var/task" \
10+
--env TEST_LANG=node \
11+
crypteia-lambda-amzn2023
12+
13+
echo "== [amzn2023/Dockerfile-test] lambda/runtime building... =="
14+
docker build --tag crypteia-lambda-amzn2023-test --file amzn2023/Dockerfile-test .
15+
16+
echo "== [amzn2023/Dockerfile-test] lambda/runtime bin/test =="
17+
docker run \
18+
--rm \
19+
--user root \
20+
--entrypoint "./test/libcrypteia.sh" \
21+
--volume "${PWD}:/var/task" \
22+
--env TEST_LANG=node \
23+
crypteia-lambda-amzn2023-test

amzn2023/test-arm64

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
set -e
3+
4+
echo "== [amzn2023/Dockerfile-arm64] bin/test =="
5+
docker run \
6+
--rm \
7+
--user root \
8+
--entrypoint "./test/libcrypteia.sh" \
9+
--volume "${PWD}:/var/task" \
10+
--env TEST_LANG=node \
11+
--platform=linux/arm64 \
12+
crypteia-lambda-amzn202V3-arm64
13+
14+
echo "== [amzn2023/Dockerfile-test-arm64] lambda/runtime building... =="
15+
docker build --tag crypteia-lambda-amzn2023-test-arm64 --file amzn2023/Dockerfile-test-arm64 .
16+
17+
echo "== [amzn2023/Dockerfile-test-arm64] lambda/runtime bin/test =="
18+
docker run \
19+
--rm \
20+
--user root \
21+
--entrypoint "./test/libcrypteia.sh" \
22+
--volume "${PWD}:/var/task" \
23+
--env TEST_LANG=node \
24+
crypteia-lambda-amzn2023-test-arm64

0 commit comments

Comments
 (0)