-
Notifications
You must be signed in to change notification settings - Fork 601
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
support arm64 / amd64 arch (#1300) #1463
Conversation
ce45dea
to
a0a0183
Compare
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.
This looks good to me. Do I need to do anything in particular to get buildx
or is this part of the docker basic install? And will this run on my intel mac? Also, Will this work on M1 & M2 macs? I guess I just need to get comfortable that I won't be able to test these versions?
buildx should be part of your default install: docker info:
This should run on intel macs, it does run on an amd64 platform. This should work on all arm64 platforms including M1, M2 and M3. We can ask the people in the #1300 to test that PR before merging it if it does work for them. I don't have arm64 myself to test the final arm64 image myself too (although cross-building it for arm64 does succeed) - but I'll try to get someone to test that before merging. |
@garris
|
M1 Mac here, the docker image built. Internally we use a custom docker image based off the backstop one to run the tests and it'll take me a while to try these changes in there. What's the best way to confirm the docker works, trying things like |
Build the image locally and use that one as your new base. You can use a custom tag to be sure you use your locally build one. Besides that, nothing changed imho from the backstopjs perspective. |
Sorry I'm really not very proficient with docker, none of that makes any sense to me. Our docker image for our project is based off
So if the image built OK then you don't need me to test anything else? |
Ah sorry - you said you used the image to build your custom one so I thought you used a FROM line with backstopjs as a source, which you did not like your wrote now, you just used parts of the Dockerfile, not the image itself ;). |
This is looking pretty good to me. If it works locally I'll push it out and we can ask a few people with m1 macs to just run the sanity check. |
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.
I am not a docker expert, but I tried to install this today and it failed because docker buildx
is only the command if you installed Docker Desktop. If you installed docker via the command line (such as using brew on macOS), you need to use docker-buildx
instead of docker buildx
.
Doesn't matter for the issue here - although it looks weird that you don't have docker buildx syntax available. https://github.com/docker/buildx#building-with-buildx That's the official plugin syntax I used, what does a PS: If your docker install is too old that it does not have plugin support you need to call the binary directly, see the docs - so maybe it is just your dated docker installation. |
I'm pretty sure this is the most recent version of docker, just installed via colima instead of Docker Desktop. I'm using colima because it works better with ddev, and there are others who use something like colima to avoid the licensing restrictions on Docker Desktop. So this isn't a huge deal, but I would suggest consider noting that "docker buildx" is specific to Docker Desktop, which not everyone using docker has. |
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.
I can happily report that I built this image on macOS Ventura with an M1 Pro and successfully ran my backstop tests using the built image. Execution speed was good and all of my backstop tests succeeded or failed as expected (I tried with both passing and failing tests, and both were correctly assessed).
I previously tried with the amd64 image, which doesn't work on M1, so this is a great improvement. Many thanks!
That is wrong. It is not docker desktop specific. Please read: https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#docker-plugins-are-missing-buildx-scan You just need to install the plugins for colima like written in the FAQ. |
Thank you, I'm glad that it's way easier than I mistakenly thought. |
Thank you @tkrah for this update! Will test a bit and follow up. |
@tkrah I have a question -- what do I need to do to resolve this?
|
@garris Please do the first part of the readme section with the multi arch build. You need to use your own builder. |
@tkrah I assume you are talking about this? I am sorry -- i looked at this doc for details and had some trouble parsing how this tool works. Is there a TLDR version of how this step works? E.g. it possible to use a default context? Or -- is there a node script I can create to initialize the correct context? Looking for ways to encapsulate this part. |
@garris yeah that's the part. Just run that and it will work if you have no idea how it works ;-). You can't encapsulate the whole thing because it all depends on what the user wants to have for builder, names, defaults etc. in the used build environment. For example, my default builder is already multi platform capable and I don't need the first command, but if you just want a working builder, run that first one and be done with it ;-). It is usually a one time thing when you setup your build chain like installing docker, configuring networks etc. |
Thanks @tkrah -- that helps. I tried to run
Any thoughts? Here's the output...
|
@garris https://www.npmjs.com/package/backstopjs 6.1.4 still the latest one yet. ;-) |
Ok -- everything is done -- 6.2.0 is all published. Thanks again @tkrah ! |
Thanks for considering and merging it and I hope it's going to work well for all. |
Proposal to support amd64 / arm64 platform for the docker image, just a draft to discuss it.