-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from keshayad/main
Add ARM64 architecture support
- Loading branch information
Showing
14 changed files
with
233 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
# frozen_string_literal: true | ||
|
||
module AwsLambdaRuntimeInterfaceClient | ||
VERSION = '1.0.2' | ||
VERSION = '2.0.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
version: 0.2 | ||
|
||
env: | ||
variables: | ||
OS_DISTRIBUTION: alpine | ||
EXECUTABLE: "/usr/local/bundle/bin/aws_lambda_ric" | ||
TEST_NAME: "aws-lambda-ruby-ric-alpine-test" | ||
batch: | ||
build-matrix: | ||
static: | ||
ignore-failure: false | ||
env: | ||
privileged-mode: true | ||
dynamic: | ||
env: | ||
variables: | ||
DISTRO_VERSION: | ||
- "3.12" | ||
RUNTIME_VERSION: | ||
- "2.5" | ||
- "2.6" | ||
- "2.7" | ||
- "3.0" | ||
phases: | ||
pre_build: | ||
commands: | ||
- export IMAGE_TAG="ruby-${OS_DISTRIBUTION}-${DISTRO_VERSION}:${RUNTIME_VERSION}" | ||
- echo "Extracting and including the Runtime Interface Emulator" | ||
- SCRATCH_DIR=".scratch" | ||
- mkdir "${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 test/integration/resources/${RIE}.tar.gz --directory "${SCRATCH_DIR}" | ||
- > | ||
cp "test/integration/docker/Dockerfile.echo.${OS_DISTRIBUTION}" \ | ||
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" | ||
- > | ||
echo "RUN apk add curl" >> \ | ||
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" | ||
- > | ||
echo "COPY ${SCRATCH_DIR}/${RIE} /usr/bin/${RIE}" >> \ | ||
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" | ||
- > | ||
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; | ||
then | ||
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." | ||
else | ||
echo "Performing DockerHub login . . ." | ||
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD | ||
fi | ||
- echo "Building image ${IMAGE_TAG}" | ||
- > | ||
docker build . \ | ||
-f "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" \ | ||
-t "${IMAGE_TAG}" \ | ||
--build-arg RUNTIME_VERSION="${RUNTIME_VERSION}" \ | ||
--build-arg DISTRO_VERSION="${DISTRO_VERSION}" | ||
build: | ||
commands: | ||
- set -x | ||
- echo "Running Image ${IMAGE_TAG}" | ||
- docker network create "${TEST_NAME}-network" | ||
- > | ||
docker run \ | ||
--detach \ | ||
--name "${TEST_NAME}-app" \ | ||
--network "${TEST_NAME}-network" \ | ||
--entrypoint="" \ | ||
"${IMAGE_TAG}" \ | ||
sh -c "/usr/bin/${RIE} "${EXECUTABLE}" "app.App::Handler.process"" | ||
- sleep 2 | ||
- > | ||
docker run \ | ||
--name "${TEST_NAME}-tester" \ | ||
--env "TARGET=${TEST_NAME}-app" \ | ||
--network "${TEST_NAME}-network" \ | ||
--entrypoint="" \ | ||
"${IMAGE_TAG}" \ | ||
sh -c 'curl -X POST "http://${TARGET}:8080/2015-03-31/functions/function/invocations" -d "{}" --max-time 10' | ||
- actual="$(docker logs --tail 1 "${TEST_NAME}-tester" | xargs)" | ||
- expected='success' | ||
- | | ||
echo "Response: ${actual}" | ||
if [[ "$actual" != "$expected" ]]; then | ||
echo "fail! runtime: $RUNTIME - expected output $expected - got $actual" | ||
exit -1 | ||
fi | ||
finally: | ||
- | | ||
echo "---------Container Logs: ${TEST_NAME}-app----------" | ||
echo | ||
docker logs "${TEST_NAME}-app" || true | ||
echo | ||
echo "---------------------------------------------------" | ||
echo "--------Container Logs: ${TEST_NAME}-tester--------" | ||
echo | ||
docker logs "${TEST_NAME}-tester" || true | ||
echo | ||
echo "---------------------------------------------------" | ||
- echo "Cleaning up..." | ||
- docker stop "${TEST_NAME}-app" || true | ||
- docker rm --force "${TEST_NAME}-app" || true | ||
- docker stop "${TEST_NAME}-tester" || true | ||
- docker rm --force "${TEST_NAME}-tester" || true | ||
- docker network rm "${TEST_NAME}-network" || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.