-
Notifications
You must be signed in to change notification settings - Fork 115
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
modify container_build.sh to add capability to use podman farm for multi-arch images #736
Conversation
…lti-arch images Signed-off-by: Charro Gruver <[email protected]>
Reviewer's Guide by SourceryThis pull request introduces the capability to build multi-architecture container images using podman farm. It adds a new Sequence diagram for multi-arch build processsequenceDiagram
participant User
participant Script as container_build.sh
participant Podman as Podman Farm
participant Registry as Container Registry
User->>Script: ./container_build.sh multi-arch target
Note over Script: Validate command & environment
alt target == 'all'
Script->>Script: Process all targets with .multi-arch flag
else specific target
Script->>Script: Process single target
end
Script->>Podman: podman farm build
Note over Podman: Build for multiple architectures
Podman->>Registry: Push multi-arch image
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WDYT? |
Signed-off-by: Charro Gruver <[email protected]>
container_build.sh
Outdated
done | ||
} | ||
|
||
build_multi_arch() { |
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.
Can this be simplified by passing in "farm" to build_arch()
and then doing podman $2 build ...
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.
BTW This is a good idea, and potentially useful for automated builds.
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.
Let me see.
podman farm
does not like a tag on the image. So, this might be more complex.
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.
Ah, but the script does not explicitly add the latest
tag either. So this might work.
I'll tinker with it.
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.
@rhatdan I think I succeeded in simplifying based on your request.
Signed-off-by: Charro Gruver <[email protected]>
It's fine, but maybe the list should exclude certain targets rather than include certain targets. Ideally, everything should be built multi-arch except for "rocm" and "asahi" if they cause issues. Interestingly, "asahi" might build fine for x86_64, because the Asahi community do some GPU x86_64 stuff via muvm, so there's actually some rare use-cases for that. So maybe even just try and exclude "rocm" (no aarch64 rpms available for that platform). Generally multi-arch should always be built except in exceptional circumstances. (not taking s390 and ppc into account for a moment) A separate list file maybe isn't necessary either, but happy to leave that up to you. |
Intel probably doesn't make sense for multi-arch either. But, I like the idea of an exclude list too. I'll tinker with it. |
Yeah sorry intel too :) |
Signed-off-by: Charro Gruver <[email protected]>
Signed-off-by: Charro Gruver <[email protected]>
Signed-off-by: Charro Gruver <[email protected]>
@ericcurtin WDYT? I trigger the podman farm build based on the presence of a |
…e image folder to trigger podman farm build Signed-off-by: Charro Gruver <[email protected]>
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.
Hey @cgruver - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please document the purpose and requirements of the .multi-arch file in the script's usage information, as it's currently not clear why certain images might be skipped during multi-arch builds.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟡 Security: 1 issue found
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This is mergeable @cgruver but again, I'd flip it to be exclusive rather than inclusive, it's an exception when we don't do multi-arch with the exceptions being rocm, intel (and maybe asahi, but asahi actually use the x86_64 GPU drivers on muvm as I said before). |
@ericcurtin Do you prefer a |
If it was me I'd code it in, people are gonna wonder what the mystery files are about (and they are hidden), but I'll leave it upto you. I just want to get people into the habit of building multi-arch. Like it's very easy to think Nvidia is x86-only, as one example, but it's actually not. And an eGPU can connect to multiple arches also. |
Plus there's less platforms to skip than include, at present it's max 3 we should skip for multi-arch |
Signed-off-by: Charro Gruver <[email protected]>
Done and done. :-) I added a |
LGTM |
Modified container_build.sh -
multi-arch
as a commandmulti-arch-targets.list
to be processed if$target
==all
Usage:
./container_build.sh multi-arch all
- Usespodman farm
to build all of the images inmulti-arch-targets.list
./container_build.sh multi-arch vulkan
- Usespodman farm
to build quay.io/ramalama/vulkan.Summary by Sourcery
Add support for building multi-arch images using
podman farm
.New Features:
multi-arch
command incontainer_build.sh
script.Build:
multi-arch
command tocontainer_build.sh
to build multi-arch images usingpodman farm
.multi-arch-targets.list
.quay.io/ramalama
.