Skip to content

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

Merged
merged 24 commits into from
Jan 20, 2022
Merged

add support for ARM based platforms #300

merged 24 commits into from
Jan 20, 2022

Conversation

muellerc
Copy link
Contributor

*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.

@muellerc
Copy link
Contributor Author

This change can be tested using this sample project: https://github.com/muellerc/lambda-java-ric-platform-test

Copy link
Contributor

@carlzogh carlzogh left a 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)

@muellerc
Copy link
Contributor Author

muellerc commented Jan 6, 2022

@carlzogh , I already managed to incorporate the proposed improvements. Let me know if there is something else I can do.

@msailes
Copy link
Collaborator

msailes commented Jan 8, 2022

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.

public static S3BatchResponseBuilder fromS3BatchEvent(S3BatchEvent s3BatchEvent) {

I can't see what else it would be.

fafriat pushed a commit to microlam-io/aws-lambda-java-runtime-interface-client that referenced this pull request Jan 11, 2022
@msailes
Copy link
Collaborator

msailes commented Jan 19, 2022

I took @muellerc branch changed the project version number. Ran make build in the aws-lambda-java-runtime-interface-client directory to install the proposed changes into my local repo.

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.

@carlzogh
Copy link
Contributor

Thanks @msailes!

@carlzogh carlzogh merged commit 6785d09 into aws:master Jan 20, 2022
@carlzogh
Copy link
Contributor

I've just released version 2.1.0 containing these changes - it should propagate to Maven Central and be available within a few hours. Thanks again @muellerc for your contribution and @msailes for your support!

@davidmelia
Copy link

@carlzogh - have you seen #316 - I think something has gone wrong with the JAR build as the ARM shared objects are actually x86

arm64/aws-lambda-runtime-interface-client.glibc.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=2b546f8d337d95e96fbf08f486a92ca29cde36da, not stripped
arm64/aws-lambda-runtime-interface-client.musl.so:  ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, with debug_info, not stripped

This means we cannot easily run on Apple M1 (have to use x86 docker platform param --platform=linux/amd64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants