-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Running arm32/v7 containers on an aarch64-only host #4
Comments
Hi @Silex! It seems that you are trying to use qus on an aarch64 host to target armhf. I believe I explicitly excluded armhf/armv7 targets for aarch64 hosts because AFAIK all aarch64 devices are indeed armv8 which is capable of running either aarch64 or aarch32. The later is suppossed to be a superset of armhf/armv7. Hence, in your case, I would expect arm32v7/ubuntu to work without qus. In fact, I have used either arm32v7 or arm64v8 on RPi 3 with raspbian (which is a 32 bit OS and should not be able to execute arm64v8), without qus. May I know which device are you trying to run arm32v7 containers on?
In any case, I think you should not need to add libraries for a foreign architecture to your host. That is precisely the purpose of using a container. So, when using arm32v7 or arm64v8 you are effectively changing the set of standard libraries that the target application will find in the environment. |
I thought so too before running into this issue 😅
From what I know it's a 96 core ThunderX system running on ubuntu 18.04. Feel free to ask me for more informations, here's parts of
Alright. If you have any suggestions 😉 Or questions I should ask the owner of this machine... |
I just tested and confirm that without qus, only |
I'm going to assume it's a recent version of ThunderX with support for 64bit only. I'd be glad if you could ask the owner about it. However, this is just curiosity (see below).
That's partially good news. It means that qus works as expected.
As a result, I'd say that you'd need Since Hence, we have isolated the issue, I think. Now, I would suggest you to:
If that works as expected, we need to find the equivalent to running Unfortunately, playing with this can be risky. If we modify the script improperly and qemu-aarch-static gets registered on an aarch64 host, weird things will happen. That's why I suggest we go step by step and introduce commands manually first. Slow but secure. |
@umarcor: thanks for the fantastic reply. I'll try your steps and report. |
ThunderX is 64 bit only, as is ThunderX2 |
@vielmetti: thanks for confirming. Will try umarcor's idea which should work, will keep you posted. |
@umarcor: I confirm your suggestion works:
I cross compiled a basic hello.c using |
@vielmetti, thanks for clarifying. @Silex, your tests are ok. The qemu-arm-static you extracted is likely to be the exact same version (or very similar), just retrieved with a different procedure. I wrote a temporal fix for
$ docker run --rm --privileged -itv $(pwd)/qemu-binfmt-conf.sh:/qus/qemu-binfmt-conf.sh --entrypoint=sh aptman/qus
# cat /qus/qemu-binfmt-conf.sh | grep armeb64
docker run --rm --privileged -v $(pwd)/qemu-binfmt-conf.sh:/qus/qemu-binfmt-conf.sh aptman/qus -s -- -p That will hopefully allow you to run |
@umarcor: it works! 🎉 The only weird thing is that the first time I run it for other architectures it seems to output the output twice, but maybe that's just this particular session:
Thanks a lot, I'll run some tests and report if I find weird things. |
Oh btw, I'm not sure you need to fix this in qus... 64bits-only arm architectures are pretty rare no? I mean for me an entry in the wiki would be ok. |
Awesome! I'm glad it was such an easy fix :D
I think it must be some transitient and not important issue. Should it be some annoying intermitent bug, it is definitely not related to the last fix: umarcor/qemu@699f972
Your are welcome! And thank you for helping have qus tested on not-so-mainstream platforms! Nevertheless, note that you are likely to find bugs if you run complex applications, specially the ones that use signals. Furthermore, you should expect a 4-10x execution time penalty. Unfortunately, this is unrelated to qus (which is a helper/wrapper project), but dependent on QEMU's development history. See https://github.com/dbhi/qus/blob/master/docs/context.md. Fortunately, qemu-user and ARM targets seem to be gaining increased attention. Regarding combination of Docker and QEMU system, you might want to raise your hand in kata-containers/runtime#1280.
As said, this is not really related to qus, but to QEMU. The modifications that were made to qemu-binfmt-conf.sh will hopefully be upstreamed some day: https://patchew.org/search?q=project%3AQEMU+qemu-binfmt-conf.sh Hence, in order to avoid keeping a forked/custom script after all other tweaks/enhancements are upstreamed, I think that the fix should be upstreamed too. From my point of view, there is currently a bug in all oficial qemu-user packages that prevents you from having a working default installation. I.e., you do need to tweak EDIT https://lists.gnu.org/archive/html/qemu-devel/2020-04/msg03667.html |
64-bits only Arm architectures are characteristic of the newest Arm server and supercomputer designs, including Cavium ThunderX, Marvell ThunderX2, Qualcomm Centriq (now defunct). |
Well, yes that's the story of my life so far. I'm trying to cross-build docker images for Emacs (Silex/docker-emacs#38) and I run into issues after issues, because Emacs is both complex and requiring weird configuration (namely having to disable ASLR) in order to build (https://bugs.launchpad.net/qemu/+bug/1861161 is an example of a QEMU bug I usually run into from amd64 hosts). Anyway, I think it's now safe to say that the QEMU way is a dead-end for Emacs. The only way would be to build each image on the right architecture (tho I never had issues building i386/amd64 on the same architecture, so I expect an arm32/arm64 capable host to build Emacs images without any issues as well). So, basically this means I can use this server to build arm64 images, I can use my own server to build i386/amd64 images and I just need to find one more server to build arm32 \o/ @NicolasPetton, @vielmetti: sorry to ask again but could you provide an arm32 host? I'd then need to refactor and split the monolitic design of the current building process into 3 gitlab workers where each workers builds only for its architecture, with all the fun it implies 😅 EDIT @vielmetti: I saw your comment about Ampere eMag being both 32 and 64 bit, would it be complicated for me to use that kind of servers instead? |
@vielmetti, since I believe this trend is not going to slow down, I think it would be good to make the upstream
@Silex I guess you took a really hard target to fight with ;) |
FYI we found an alternative setup that seems to work for us, so this issue is not blocking anymore. I'll keep it open so you can decide what to do with it. About your question on how to detect these arm64-only architectures, I don't know but my google-fu found this:
I notice
If you compare to the ThunderX one, we see the CPU variant moved from |
Yes, please, leave it open. I believe this is a bug upstream that should be fixed. Thanks for the reference and the hint about the CPU variant. Unfortunately, I cannot focus on this issue at the moment, but I will follow those leads when I come back to it. |
Hello - I know this thread has been quiet for a long time, but I wanted to add another processor (family) affected by this issue. I recently moved the docker stack running on my M1 Mac Mini into an Ubuntu VM and began having issues with some images listed as "aarch64" no longer running. They all expected 32-bit support to be present, but it wasn't in the VM. These images, along with the modified |
Similar to what @rborkow says, in order for me to build Selenium docker container images for armhf (linux/arm/v7), I had to use the modified qemu-binfmt-conf.sh script when registering the architectures. Otherwise, I was only able to build for aarch64 and amd64. I'm on a Mac M1 as well. The folks using the armhf container images are running them on Raspberry Pi, which I believe wouldn't be able to run the aarch64 images. Hope this info helps, and thanks to all who contributed to the modified script. |
FTR, all qus images include the fix now; so, using the modified script should not be required anymore. |
Hello,
Coming here from multiarch/qemu-user-static#77, it looks like qus works for
i386
,x84_64
but notarm
:Any idea of what I should do? On https://askubuntu.com/questions/1090351/can-i-run-an-arm32-bit-app-on-an-arm64bit-platform-which-is-running-ubuntu-16-04 they suggest adding
armhf
as a foreign architecure but it looks random, I prefer to ask here first.The text was updated successfully, but these errors were encountered: