-
Notifications
You must be signed in to change notification settings - Fork 17
Add support for linux arm64 target #157
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
The Alpine base image causes systematic crash for some libsecp256k1 operations. JNI-related issues related to the use of `musl` instead of `glibc` are well documented. The issue is fixed by switching alpine for ubuntu, which is `glibc`-based. Note that it makes the final image significantly larger (502MB vs 313MB). The goal of using the JVM on docker was for compatibility with ARM. Once we support native ARM on Linux (#157), we could potentially move back to Alpine with native phoenixd, an even smaller footprint than before. Fixes #159.
The Alpine base image causes systematic crash for some libsecp256k1 operations. JNI-related issues related to the use of `musl` instead of `glibc` are well documented. The issue is fixed by switching alpine for ubuntu, which is `glibc`-based. Note that it makes the final image significantly larger (502MB vs 313MB). The goal of using the JVM on docker was for compatibility with ARM. Once we support native ARM on Linux (#157), we could potentially move back to Alpine with native phoenixd, an even smaller footprint than before. Fixes #159.
|
This builds and runs, but we get an SSL error immediately: |
Very likely the switch to Ubuntu also means you need to install the |
pm47
left a comment
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.
Needs rebase, otherwise LGTM.
Starblocks is running on arm64.
The SSL issue was due to https://youtrack.jetbrains.com/issue/KTOR-8339, we added a workaround in ACINQ/lightning-kmp#769. |
|
I went ahead and rebased. |
|
@sethforprivacy Do you know how to create a cross-platform dockerfile for native phoenixd? |
Should have everything you need here: https://github.com/sethforprivacy/phoenixd-docker Specifically: https://github.com/sethforprivacy/phoenixd-docker/blob/main/.github/workflows/build-image-on-push.yml |
|
This Dockerfile was working before for arm64 builds so should form a good base, I'll re-test it once you cut a release with the fixes in this PR: |
|
What am I doing wrong? |
Pretty sure they need to push updates to lightning-kmp-core before you can build master. Just wait for a release :) |
|
Gotcha Jumped the gun hahaha |
The binary must be built **on x86** with: ``` ./gradlew linuxArm64DistZip ``` Fixes ACINQ#137. --------- Co-Authored-By: pm47 <[email protected]>
The binary must be built **on x86** with: ``` ./gradlew linuxArm64DistZip ``` Fixes ACINQ#137. --------- Co-Authored-By: pm47 <[email protected]>
The binary must be built **on x86** with: ``` ./gradlew linuxArm64DistZip ``` Fixes ACINQ#137. --------- Co-Authored-By: pm47 <[email protected]>
This a follow-up to #161, specifically: > The goal of using the JVM on docker was for compatibility with ARM. Once we support native ARM on Linux (#157), we could potentially move back to Alpine with native phoenixd, an even smaller footprint than before. I didn't go with Alpine because it isn't glibc based and we could run into compat issues. Nevertheless, with Debian slim the image size has been reduced from 230MB to 40MB (-80%). Cross-platform build: ```shell docker buildx build --platform linux/amd64,linux/arm64 -t acinq/phoenixd:0.6.0 --push .docker ``` From now on the image will be published on docker hub: https://hub.docker.com/repository/docker/acinq/phoenixd/general.
See ACINQ/secp256k1-kmp#120 for limitations.
I checked that
phoenixdstarts correctly on an AWS arm64 machine (with AWS Linux 2023).