-
Notifications
You must be signed in to change notification settings - Fork 77
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
Nox session to build and push multiplatform images #3324
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3324 +/- ##
==========================================
- Coverage 87.22% 87.13% -0.09%
==========================================
Files 311 312 +1
Lines 18586 18659 +73
Branches 2368 2377 +9
==========================================
+ Hits 16212 16259 +47
- Misses 1958 1980 +22
- Partials 416 420 +4
☔ View full report in Codecov by Sentry. |
This is making me realize we shouldn't really be doing the https://www.thorsten-hans.com/how-to-build-multi-arch-docker-images-with-ease/ https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ Great finds here @SteveDMurphy ! Seems like I'll dig into this and clean it up a bit, but maybe this will finally solve our woes, at which point we can port it over to |
Awesome, thanks @ThomasLaPiana ! Let me know if you want to dabble together or need an M1 to test with 🙌🏽
I think the only reason we ended up with the |
@SteveDMurphy afaik Macs (M1, M2, soon to be M3) are the only ARM machines that really matter currently There is "ARM for windows" but it's, as I understand it, pretty much totally neglected. Otherwise there are some servers that use ARM but they're in the minority and very much more special use-cases |
…rameter to increase readability
Passing run #2229 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
@SteveDMurphy i'm digging into this deep today (got good vibes) and found this lol: docker/buildx#166 Apparently you can not build and push separately. Hence the refactor I did here, and will also be updating |
@SteveDMurphy I'm pretty satisfied with where I'm getting this, testing it now (which takes forever though because of emulation used during multiplat builds) Feel free to take a look and lmk if this route makes sense |
Yes the build/push requirement got me early on too ! I thought I had added something about it somewhere, my bad 😳 |
I ran this locally and everything seemed ok....I'm going to push a dev version for real to make sure everything works Feel free to start digging in! |
I ran a proper |
This issue came up when running I think it failed at this step with this error (I've removed some of the stacktrace)
Did you run into this issue on your M1 @SteveDMurphy? |
Interesting 🤔 As long as it runs in CI though, this doesn't really make a difference, but it is interesting to know that it might not work on M1 machines. CI runs amd/64 so I think it'd be ok there, but honestly it is hard to test without running it for real in CI |
@TheAndrewJackson I hadn't tested these in a bit (@ThomasLaPiana did all the real work!) but was able to confirm this morning that the commands ran for me on an M1. I'm pretty sure I have seen that same error message in the past however, but struggling to remember what I did to sort it out ![]() |
I tried again and I was able to successfully run the command after clearing my docker cache 🤷♂️ |
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 like the changes a lot! besides the obvious benefit of allowing us to build images for multiple architectures, the required refactors are sensible - they leave the touched pieces of the nox codebase more modular, easier to follow and test.
just left a couple of minor nits for cleanup of docstrings. i tested nox -s "push(dev)"
locally on my M1 and things worked well (though that did take a while!).
(one thing that may be nice as an additional manual confirmation step, if we haven't done it already -- we could push an alpha/feature tag to this branch with nox -s "tag(push)"
and just ensure that the git-tag
push job still works as it always has to push a tagged "feature" image. this would be a simple and low-impact way to be more certain the refactors haven't caused any regressions on this codepath.)
that's a great idea, I definitely don't want to break your awesome work 🙂 will test that now |
so the push job definitely takes forever, but all is working as expected! |
Closes tbd
Used this article for some guidance: https://www.thorsten-hans.com/how-to-build-multi-arch-docker-images-with-ease/#verify-multiple-architectures-in-docker-hub
Code Changes
push
to use discrete commands for each parameter (makes the function much more readable/maintainablepush
will now also handle builds, as this is a requirement when doing multiplatform images.buildx
command generation logicbuild
step from the image publication workflownox
tests to run with thestatic checks
for simplicitydocker buildx create
command in case CI needs itSteps to Confirm
nox -s "push(dev)"
and validate that two images are builtPre-Merge Checklist
CHANGELOG.md
Description Of Changes
This PR is a big overhaul of the
push
nox session that will allow us to publish multi-arch images and hopefully in a reasonably elegant way. It leveragesbuildx
(part of docker experimental features) to achieve this and led to cleaning up a lot of thepush
-related logic