-
Notifications
You must be signed in to change notification settings - Fork 239
add support for ARM based platforms #300
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
Conversation
This change can be tested using this sample project: https://github.com/muellerc/lambda-java-ric-platform-test |
.../src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the contribution - I've made a few changes on top of those in I've pushed a commit that does this: carlzogh@0b16ecd
@muellerc what do you think about including these changes in your PR? (I tried pushing to your fork but it seems I don't have permissions to do so)
.../src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
Outdated
Show resolved
Hide resolved
aws-lambda-java-runtime-interface-client/src/main/jni/build-jni-lib.sh
Outdated
Show resolved
Hide resolved
@carlzogh , I already managed to incorporate the proposed improvements. Let me know if there is something else I can do. |
I tried looking at why this build was failing, but I can't work it out. I can only think it's something to do with the phase in which lombok code is generated. Line 60 in bd490cb
I can't see what else it would be. |
.../src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
Outdated
Show resolved
Hide resolved
aws-lambda-java-runtime-interface-client/src/main/jni/build-jni-lib.sh
Outdated
Show resolved
Hide resolved
.../src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
Outdated
Show resolved
Hide resolved
aws-lambda-java-runtime-interface-client/test/integration/codebuild-local/Dockerfile.agent
Outdated
Show resolved
Hide resolved
...va/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/UnknownPlatformException.java
Outdated
Show resolved
Hide resolved
I took @muellerc branch changed the project version number. Ran Then I used this artefact to build a Lambda function which was then deployed to the ARM architecture on AWS Lambda. Whereas previously this would cause an exception, I'm now getting a successful response. edit - I should say this was all done my my Apple M1 laptop. |
Thanks @msailes! |
@carlzogh - have you seen #316 - I think something has gone wrong with the JAR build as the ARM shared objects are actually x86
This means we cannot easily run on Apple M1 (have to use x86 docker platform param --platform=linux/amd64) |
*Description of changes:
The current version 2.0.0 doesn't support ARM based platforms, as the native code is compiled for x86 only.
This change extends the build process to [cross-] compile the native code for x86 and ARM. When executed on the target platform, it detects the underlying architecture (x86 or ARM) and loads these native libraries only.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.