Skip to content

Add ARM64 architecture support #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ___
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-runtime-interface-client</artifactId>
<version>1.1.0</version>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
Expand All @@ -69,7 +69,7 @@ ___
'com.amazonaws:aws-lambda-java-events:3.10.0'
'com.amazonaws:aws-lambda-java-events-sdk-transformer:3.0.6'
'com.amazonaws:aws-lambda-java-log4j2:1.2.0'
'com.amazonaws:aws-lambda-java-runtime-interface-client:1.1.0'
'com.amazonaws:aws-lambda-java-runtime-interface-client:2.0.0'
'com.amazonaws:aws-lambda-java-tests:1.1.0'
```

Expand All @@ -80,7 +80,7 @@ ___
[com.amazonaws/aws-lambda-java-events "3.10.0"]
[com.amazonaws/aws-lambda-java-events-sdk-transformer "3.0.6"]
[com.amazonaws/aws-lambda-java-log4j2 "1.2.0"]
[com.amazonaws/aws-lambda-java-runtime-interface-client "1.1.0"]
[com.amazonaws/aws-lambda-java-runtime-interface-client "2.0.0"]
[com.amazonaws/aws-lambda-java-tests "1.1.0"]
```

Expand All @@ -91,7 +91,7 @@ ___
"com.amazonaws" % "aws-lambda-java-events" % "3.10.0"
"com.amazonaws" % "aws-lambda-java-events-sdk-transformer" % "3.0.6"
"com.amazonaws" % "aws-lambda-java-log4j2" % "1.2.0"
"com.amazonaws" % "aws-lambda-java-runtime-interface-client" % "1.1.0"
"com.amazonaws" % "aws-lambda-java-runtime-interface-client" % "2.0.0"
"com.amazonaws" % "aws-lambda-java-tests" % "1.1.0"
```

Expand Down
2 changes: 1 addition & 1 deletion aws-lambda-java-runtime-interface-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pom.xml
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-runtime-interface-client</artifactId>
<version>1.1.0</version>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
### June 02, 2020
### Sept 29, 2021
`2.0.0`
- Added support for ARM64 architecture

### June 02, 2021
`1.1.0`:
- Added reserved environment variables constants ([#238](https://github.com/aws/aws-lambda-java-libs/pull/238))
- Updated libcurl dependency to `7.77.0` ([#249](https://github.com/aws/aws-lambda-java-libs/pull/249))
Expand Down
2 changes: 1 addition & 1 deletion aws-lambda-java-runtime-interface-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-runtime-interface-client</artifactId>
<version>1.1.0</version>
<version>2.0.0</version>
<packaging>jar</packaging>

<name>AWS Lambda Java Runtime Interface Client</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN ./configure \
--prefix $(pwd)/../artifacts \
--disable-shared \
--without-ssl \
--with-pic \
--without-zlib && \
make && \
make install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ FROM alpine:3

ARG CURL_VERSION

# Add Corretto repository
RUN wget -O /etc/apk/keys/amazoncorretto.rsa.pub https://apk.corretto.aws/amazoncorretto.rsa.pub && \
echo "https://apk.corretto.aws/" >> /etc/apk/repositories

RUN apk update && \
apk add \
amazon-corretto-8 \
openjdk11 \
cmake \
file \
g++ \
Expand All @@ -25,6 +21,7 @@ RUN ./configure \
--prefix $(pwd)/../artifacts \
--disable-shared \
--without-ssl \
--with-pic \
--without-zlib && \
make && \
make install
Expand All @@ -44,7 +41,8 @@ RUN cmake .. \
# Build native client
ADD *.cpp *.h /src/
WORKDIR /src
ENV JAVA_HOME=/usr/lib/jvm/java-8-amazon-corretto

ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk
RUN /usr/bin/c++ -c \
-std=gnu++11 \
-fPIC \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ batch:
static:
ignore-failure: false
env:
type: LINUX_CONTAINER
privileged-mode: true
dynamic:
env:
Expand Down Expand Up @@ -44,15 +43,25 @@ phases:
- echo "Extracting and including Runtime Interface Emulator"
- SCRATCH_DIR=".scratch"
- mkdir "${SCRATCH_DIR}"
- tar -xvf aws-lambda-java-runtime-interface-client/test/integration/resources/aws-lambda-rie.tar.gz --directory "${SCRATCH_DIR}"
- ARCHITECTURE=$(arch)
- >
if [[ "$ARCHITECTURE" == "x86_64" ]]; then
RIE="aws-lambda-rie"
elif [[ "$ARCHITECTURE" == "aarch64" ]]; then
RIE="aws-lambda-rie-arm64"
else
echo "Architecture $ARCHITECTURE is not currently supported."
exit 1
fi
- tar -xvf aws-lambda-java-runtime-interface-client/test/integration/resources/${RIE}.tar.gz --directory "${SCRATCH_DIR}"
- >
cp "aws-lambda-java-runtime-interface-client/test/integration/docker/Dockerfile.function.${OS_DISTRIBUTION}" \
"${SCRATCH_DIR}/Dockerfile.function.${OS_DISTRIBUTION}.tmp"
- >
echo "RUN apk add curl" >> \
"${SCRATCH_DIR}/Dockerfile.function.${OS_DISTRIBUTION}.tmp"
- >
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
echo "COPY ${SCRATCH_DIR}/${RIE} /usr/bin/${RIE}" >> \
"${SCRATCH_DIR}/Dockerfile.function.${OS_DISTRIBUTION}.tmp"
- echo "Building image ${IMAGE_TAG}"
- >
Expand All @@ -69,12 +78,11 @@ phases:
- >
docker run \
--detach \
-e "JAVA_BINARY_LOCATION=${JAVA_BINARY_LOCATION}" \
--name "${OS_DISTRIBUTION}-app" \
--network "${OS_DISTRIBUTION}-network" \
--entrypoint="" \
"${IMAGE_TAG}" \
sh -c '/usr/bin/aws-lambda-rie ${JAVA_BINARY_LOCATION} -jar ./HelloWorld-1.0.jar helloworld.App'
sh -c "/usr/bin/${RIE} ${JAVA_BINARY_LOCATION} -jar ./HelloWorld-1.0.jar helloworld.App"
- sleep 2
- >
docker run \
Expand All @@ -90,19 +98,20 @@ phases:
echo "Response: ${actual}"
if [[ "$actual" != "$expected" ]]; then
echo "fail! runtime: $RUNTIME - expected output $expected - got $actual"
echo "---------Container Logs: ${OS_DISTRIBUTION}-app----------"
echo
docker logs "${OS_DISTRIBUTION}-app"
echo
echo "---------------------------------------------------"
echo "--------Container Logs: ${OS_DISTRIBUTION}-tester--------"
echo
docker logs "${OS_DISTRIBUTION}-tester"
echo
echo "---------------------------------------------------"
exit -1
fi
finally:
- |
echo "---------Container Logs: ${OS_DISTRIBUTION}-app----------"
echo
docker logs "${OS_DISTRIBUTION}-app" || true
echo
echo "---------------------------------------------------"
echo "--------Container Logs: ${OS_DISTRIBUTION}-tester--------"
echo
docker logs "${OS_DISTRIBUTION}-tester" || true
echo
echo "---------------------------------------------------"
- echo "Cleaning up..."
- docker stop "${OS_DISTRIBUTION}-app" || true
- docker rm --force "${OS_DISTRIBUTION}-app" || true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ batch:
static:
ignore-failure: false
env:
type: LINUX_CONTAINER
privileged-mode: true
dynamic:
env:
Expand Down Expand Up @@ -42,12 +41,22 @@ phases:
- echo "Extracting and including Runtime Interface Emulator"
- SCRATCH_DIR=".scratch"
- mkdir "${SCRATCH_DIR}"
- tar -xvf aws-lambda-java-runtime-interface-client/test/integration/resources/aws-lambda-rie.tar.gz --directory "${SCRATCH_DIR}"
- ARCHITECTURE=$(arch)
- >
if [[ "$ARCHITECTURE" == "x86_64" ]]; then
RIE="aws-lambda-rie"
elif [[ "$ARCHITECTURE" == "aarch64" ]]; then
RIE="aws-lambda-rie-arm64"
else
echo "Architecture $ARCHITECTURE is not currently supported."
exit 1
fi
- tar -xvf aws-lambda-java-runtime-interface-client/test/integration/resources/${RIE}.tar.gz --directory "${SCRATCH_DIR}"
- >
cp "aws-lambda-java-runtime-interface-client/test/integration/docker/Dockerfile.function.${OS_DISTRIBUTION}" \
"${SCRATCH_DIR}/Dockerfile.function.${OS_DISTRIBUTION}.tmp"
- >
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
echo "COPY ${SCRATCH_DIR}/${RIE} /usr/bin/${RIE}" >> \
"${SCRATCH_DIR}/Dockerfile.function.${OS_DISTRIBUTION}.tmp"
- echo "Building image ${IMAGE_TAG}"
- >
Expand All @@ -64,12 +73,11 @@ phases:
- >
docker run \
--detach \
-e "JAVA_BINARY_LOCATION=${JAVA_BINARY_LOCATION}" \
--name "${OS_DISTRIBUTION}-app" \
--network "${OS_DISTRIBUTION}-network" \
--entrypoint="" \
"${IMAGE_TAG}" \
sh -c '/usr/bin/aws-lambda-rie ${JAVA_BINARY_LOCATION} -jar ./HelloWorld-1.0.jar helloworld.App'
sh -c "/usr/bin/${RIE} ${JAVA_BINARY_LOCATION} -jar ./HelloWorld-1.0.jar helloworld.App"
- sleep 2
- >
docker run \
Expand All @@ -85,19 +93,20 @@ phases:
echo "Response: ${actual}"
if [[ "$actual" != "$expected" ]]; then
echo "fail! runtime: $RUNTIME - expected output $expected - got $actual"
echo "---------Container Logs: ${OS_DISTRIBUTION}-app----------"
echo
docker logs "${OS_DISTRIBUTION}-app"
echo
echo "---------------------------------------------------"
echo "--------Container Logs: ${OS_DISTRIBUTION}-tester--------"
echo
docker logs "${OS_DISTRIBUTION}-tester"
echo
echo "---------------------------------------------------"
exit -1
fi
finally:
- |
echo "---------Container Logs: ${OS_DISTRIBUTION}-app----------"
echo
docker logs "${OS_DISTRIBUTION}-app" || true
echo
echo "---------------------------------------------------"
echo "--------Container Logs: ${OS_DISTRIBUTION}-tester--------"
echo
docker logs "${OS_DISTRIBUTION}-tester" || true
echo
echo "---------------------------------------------------"
- echo "Cleaning up..."
- docker stop "${OS_DISTRIBUTION}-app" || true
- docker rm --force "${OS_DISTRIBUTION}-app" || true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ batch:
static:
ignore-failure: false
env:
type: LINUX_CONTAINER
privileged-mode: true
dynamic:
env:
variables:
DISTRO_VERSION:
- "1"
- "2"
RUNTIME_VERSION:
- "openjdk8"
phases:
Expand All @@ -42,12 +40,22 @@ phases:
- echo "Extracting and including Runtime Interface Emulator"
- SCRATCH_DIR=".scratch"
- mkdir "${SCRATCH_DIR}"
- tar -xvf aws-lambda-java-runtime-interface-client/test/integration/resources/aws-lambda-rie.tar.gz --directory "${SCRATCH_DIR}"
- ARCHITECTURE=$(arch)
- >
if [[ "$ARCHITECTURE" == "x86_64" ]]; then
RIE="aws-lambda-rie"
elif [[ "$ARCHITECTURE" == "aarch64" ]]; then
RIE="aws-lambda-rie-arm64"
else
echo "Architecture $ARCHITECTURE is not currently supported."
exit 1
fi
- tar -xvf aws-lambda-java-runtime-interface-client/test/integration/resources/${RIE}.tar.gz --directory "${SCRATCH_DIR}"
- >
cp "aws-lambda-java-runtime-interface-client/test/integration/docker/Dockerfile.function.${OS_DISTRIBUTION}" \
"${SCRATCH_DIR}/Dockerfile.function.${OS_DISTRIBUTION}.tmp"
- >
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
echo "COPY ${SCRATCH_DIR}/${RIE} /usr/bin/${RIE}" >> \
"${SCRATCH_DIR}/Dockerfile.function.${OS_DISTRIBUTION}.tmp"
- echo "Building image ${IMAGE_TAG}"
- >
Expand All @@ -64,12 +72,11 @@ phases:
- >
docker run \
--detach \
-e "JAVA_BINARY_LOCATION=${JAVA_BINARY_LOCATION}" \
--name "${OS_DISTRIBUTION}-app" \
--network "${OS_DISTRIBUTION}-network" \
--entrypoint="" \
"${IMAGE_TAG}" \
sh -c '/usr/bin/aws-lambda-rie ${JAVA_BINARY_LOCATION} -jar ./HelloWorld-1.0.jar helloworld.App'
sh -c "/usr/bin/${RIE} ${JAVA_BINARY_LOCATION} -jar ./HelloWorld-1.0.jar helloworld.App"
- sleep 2
- >
docker run \
Expand All @@ -85,19 +92,20 @@ phases:
echo "Response: ${actual}"
if [[ "$actual" != "$expected" ]]; then
echo "fail! runtime: $RUNTIME - expected output $expected - got $actual"
echo "---------Container Logs: ${OS_DISTRIBUTION}-app----------"
echo
docker logs "${OS_DISTRIBUTION}-app"
echo
echo "---------------------------------------------------"
echo "--------Container Logs: ${OS_DISTRIBUTION}-tester--------"
echo
docker logs "${OS_DISTRIBUTION}-tester"
echo
echo "---------------------------------------------------"
exit -1
fi
finally:
- |
echo "---------Container Logs: ${OS_DISTRIBUTION}-app----------"
echo
docker logs "${OS_DISTRIBUTION}-app" || true
echo
echo "---------------------------------------------------"
echo "--------Container Logs: ${OS_DISTRIBUTION}-tester--------"
echo
docker logs "${OS_DISTRIBUTION}-tester" || true
echo
echo "---------------------------------------------------"
- echo "Cleaning up..."
- docker stop "${OS_DISTRIBUTION}-app" || true
- docker rm --force "${OS_DISTRIBUTION}-app" || true
Expand Down
Loading