Repository navigation
Attempt to fix buildx/multiarch build flakiness - #15386
Conversation
|
there is a ticket tracking the issue this is addressing here #14971 |
|
i have no objection to this change altho im not clear whether it will resolve anything reading the upstream docs (https://github.com/docker/buildx#building-multi-platform-images):
im wondering whether it would work at all if there was not binfmt_misc support esp given the command runs |
|
the |
|
rerunning probs wont help - as its a flake - its kinda random (or at least indeterminate) when it will fail also - the links posted here #14971 suggest it might be a memory issue, and specifically that rerunning is likely to make it work (if it is indeed the problem that is discussed in those links) |
|
in terms of tracking down the flake im wondering if we can dump state (mem/disk free ?) before/after running buildx ideally we want to know what is going wrong when it fails and this might show a difference it might be that it has nothing to do with memory etc and its just a network error that is exposed because buildx runs the build recipes multiple times and the upstream repos are flakey |
|
this is the command to check what is (already) installed, and the output on my local machine: |
|
try adding that command before/after your addition and see if anything changes |
|
docker/buildx#542 might be what we're hitting here and might need to add testing it out rn |
3ff9f51 to
be2ad68
Compare
|
here are the logs
removing
|
Hit this multiarch build issue on a seperate PR envoyproxy#15204 (comment) Fixes envoyproxy#14971 Most likely relates to docker/buildx#542 https://github.com/docker/buildx#building-multi-platform-images recommends running `docker run --privileged --rm tonistiigi/binfmt --install all` before setting up `buildx` Signed-off-by: Arko Dasgupta <[email protected]>
|
also |
that doesnt look like the issue then
that does seem to install support - not sure how it would work without this
not sure but is there anything in the error messages etc which aligns ? |
|
from docker/buildx#542 (comment) the issue is related to qemu 5.2 present in |
if its not installed already i think dont add it - its just going to muddy the water |
|
@arkodg im keen not to make changes unless it genuinely fixes something this flake is v annoying - its ~random, happens quite often and happens half way through the ci run i think once we find a ~fix for this we want to run the ci repeatedly with small changes to see if its really fixed |
|
also please dont force push once someone is reviewing your code |
Signed-off-by: Arko Dasgupta <[email protected]>
|
ok, ive reverted uninstalling qemu-aarch64 |
which bit ? if you think we have a fix im happy to test it further
yep defo my opinion too - and it would seem the facts on the ground i think dont revert tho as there were other reasons for moving the su-exec compile |
|
| # Qemu configurations | ||
| docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
| # Install QEMU emulators | ||
| docker run --rm --privileged tonistiigi/binfmt --install all |
There was a problem hiding this comment.
i need to understand better what is changed here
is tonistiigi/binfmt --install all a dropin replacement for multiarch/qemu-user-static --reset -p yes ?
There was a problem hiding this comment.
wfm - yep, reading https://github.com/multiarch/qemu-user-static afaict they are doing the same
| # Remove older build instance | ||
| docker buildx rm multi-builder || : | ||
| docker buildx create --use --name multi-builder --platform linux/arm64,linux/amd64 | ||
| docker buildx create --use --name multi-builder |
There was a problem hiding this comment.
does this not stop it from building for arm ?
There was a problem hiding this comment.
platforms can be autodetected - https://github.com/docker/buildx#--platform-platforms
Line 72 in 3bddd1a
buildx build for the ARCH specified
There was a problem hiding this comment.
platforms can be autodetected
lets keep this explicit
There was a problem hiding this comment.
fwiw manually setting it is not recommended unless you know what you are doing. This will override the detection meaning that if you don't actually have a proper setup build will still be attempted and will fail with some exec format error deeper in the stack. The main case where this flag is used is to set arch priorities for multi-node build clusters but that does not seem to be your use-case.
There was a problem hiding this comment.
👍 thanks for clarifying :)
There was a problem hiding this comment.
This will override the detection meaning that if you don't actually have a proper setup build will still be attempted and will fail with some exec format
which in a way we want as long as it fails so the setup can be fixed - these are the architectures we want and only want
not sure if the combination of doing --install all and not specifying this means it would create lots of images that dont get published, but lets see
There was a problem hiding this comment.
yah --install all would setup emulators for all supported architectures, not build all images, that is governed by the buildx bake cmd
If we want to have a more cautious and a fail fast and early approach, we should only install for linux/arm64
Signed-off-by: Arko Dasgupta <[email protected]>
|
@arkodg ive opened a PR to test possible fixes here #15428 atm it just starts the docker build more quickly im going to run it say 5 times (lets see) and watch for build failures once that is done, i will pick your fix and see what happens this is going to take a while - but be assured if we fix this others will be very happy i read more the issue you linked to and found the possible fix from (docker/buildx#542) its hard to say - but it does look like a possible candidate issue - lets see... |
|
after getting bored running the above PR without fail and reading here https://medium.com/@artur.klauser/building-multi-architecture-docker-images-with-buildx-27d80f7e2408 the following:
i understand a little better now how this is working, and that the image/command is ~equivalent |
|
@phlax sorry so you tested this and you think we should try it out? |
its tested in ci - so it works in terms of producing docker images and then running verify etc (im assuming that the arm builds are correct, but no reason to think otherwise) in terms of best approach to buildx - i think this PR is correct at time of commenting 8/ |
|
in terms of fixing the docker flake - lets hope so! it hits about 1 in 10 builds so we should see pretty quickly, i came to the conclusion - that @arkodg had already come to - that trying out these newer versions of binfmt tools may well fix the issue - but was a good idea anyway (edited) |
|
thanks for testing it out @phlax my conclusion is the opposite :), the latest |
i think my hesitation is that it seems unofficial - even if it is a core devs image etc not sure if thanks again for figuring out a way forward lets hope it resolves the immediate problem |
Hit this multiarch build issue on a seperate PR envoyproxy#15204 (comment) Fixes envoyproxy#14971 Most likely relates to docker/buildx#542 https://github.com/docker/buildx#building-multi-platform-images recommends running `docker run --privileged --rm tonistiigi/binfmt --install all` before setting up `buildx` Signed-off-by: Arko Dasgupta <[email protected]> Signed-off-by: Auni Ahsan <[email protected]>
Hit this multiarch build issue on a seperate PR
#15204 (comment)
Fixes #14971
Most likely relates to docker/buildx#542
https://github.com/docker/buildx#building-multi-platform-images
recommends running
docker run --privileged --rm tonistiigi/binfmt --install allbefore setting upbuildxSigned-off-by: Arko Dasgupta [email protected]
Risk Level: Low
Testing: CI