Skip to content
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

Replace luafilesystem-ffi to fix build issue on aarch64 #1445

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

tkan145
Copy link
Contributor

@tkan145 tkan145 commented Feb 8, 2024

This is a experimental PR, replace the lfs-ffi https://github.com/3scale/luafilesystem-ffi/blob/master/lfs_ffi.lua#L921 with https://github.com/lunarmodules/luafilesystem to hopefully fix the issue on arm64 https://issues.redhat.com/browse/THREESCALE-10662.

Verification Steps

The lfs module is mainly used during startup, so the criteria is to have the APIcast start without errors.

  • Build docker image from this git branch
make runtime-image IMAGE_NAME=apicast-test
  • HTTP dev environment setup
cd dev-environments/plain-http-upstream
make gateway IMAGE_NAME=apicast-test

The gateway should be running without error

  • The request should be accepted (200 OK)
curl --resolve get.example.com:8080:127.0.0.1 -v "http://get.example.com:8080/?user_key=123"

@tkan145 tkan145 requested a review from a team as a code owner February 8, 2024 01:18
@tkan145 tkan145 changed the title [DO NOT MERGE] Replace luafilesystem-ffi to fix build issue with arm64 [DO NOT MERGE] Replace luafilesystem-ffi to fix issue with arm64 Feb 8, 2024
@eguzki
Copy link
Member

eguzki commented Feb 8, 2024

it would be good to have verification steps

@eguzki
Copy link
Member

eguzki commented Feb 13, 2024

Is there an easy way to build ARM docker image on x86 host?

Is there an easy way to run ARM docker image on x86 host?

@tkan145
Copy link
Contributor Author

tkan145 commented Feb 13, 2024

Docker supports building arm images on x86 with -platform linux/arm64. I haven't tried running the arm image on x86 but I don't think it will work. The easiest way is to run the image inside a VM.

https://docs.docker.com/build/building/multi-platform/

@eguzki
Copy link
Member

eguzki commented Feb 14, 2024

The easiest way is to run the image inside a VM.

Can you elaborate more on that?

Is this PR still in progress? (the title says "do not merge"). Then, what is missing? (other that CHANGELOG.md)

@tkan145
Copy link
Contributor Author

tkan145 commented Feb 14, 2024

I'm using this on my x86 laptop https://github.com/multiarch/qemu-user-static with QEMU.

$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
$ docker run --rm -t arm64v8/ubuntu uname -m

This is more like a test PR so @gsaslis can trigger a build for arm64 using code in this branch. I have provided 2 patches, 1 adds a new structure to luafilesystem-ffi and this patch replaces luafilesystem-ffi with another lib.

If the first patch works then great, everyone happy
If that one doesn't work but this one does then we may need to analyze whether this new lib has any impact on performance.

@tkan145 tkan145 changed the title [DO NOT MERGE] Replace luafilesystem-ffi to fix issue with arm64 Replace luafilesystem-ffi to fix build issue on aarch64 Feb 27, 2024
@gsaslis
Copy link
Member

gsaslis commented Feb 27, 2024

@tkan145 it looks like some CI checks are still failing.

Please ping me here once those are taken care of, so I can adapt the product build accordingly. ;)

@tkan145
Copy link
Contributor Author

tkan145 commented Feb 27, 2024

@gsaslis all the tests passed now 😄

@tkan145 tkan145 requested a review from eguzki March 5, 2024 22:28
@tkan145 tkan145 merged commit 74abce8 into 3scale:master Mar 7, 2024
12 checks passed
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.

3 participants