There's a problem with always updating the multi-arch container manifests, if the relevant image fails to build on some arches. Say in the last compose we built x86_64 and aarch64. The current manifest will have both arches. Now say in the current compose, aarch64 fails and we only get an x86_64 image. If we go ahead and generate a new manifest and publish it, the aarch64 image is essentially "lost". The one from the previous compose would still be available under the arch specific name, as "fedora:40-aarch64" or whatever, but most use cases don't use that name, they just request "fedora:40" and expect the manifest to point to an image. If someone did that on aarch64 in this scenario, it would fail.
On advice from @nalin in #17, this addresses that problem by refusing to publish an updated multi-arch manifest at all if any arch that is in the current manifest failed in the compose being processed. This runs the risk of our manifests going stale if we do not fix failing arches promptly, but nalin felt this is preferable to the alternatives:
Just go ahead and "lose" failed arches
Generate a "hybrid" manifest containing successful images from the new compose along with existing images from the current manifest for arches that failed
If this turns out to be a big problem, we ought to be able to tweak this code to alternative #2 quite easily.
This also includes an important fix as a precursor, which I worked out while working on it: we need to allow buildah rmi commands to fail, because they will if the image/manifest does not exist, but that's totally fine.
There's a problem with always updating the multi-arch container manifests, if the relevant image fails to build on some arches. Say in the last compose we built x86_64 and aarch64. The current manifest will have both arches. Now say in the current compose, aarch64 fails and we only get an x86_64 image. If we go ahead and generate a new manifest and publish it, the aarch64 image is essentially "lost". The one from the previous compose would still be available under the arch specific name, as "fedora:40-aarch64" or whatever, but most use cases don't use that name, they just request "fedora:40" and expect the manifest to point to an image. If someone did that on aarch64 in this scenario, it would fail.
On advice from @nalin in #17, this addresses that problem by refusing to publish an updated multi-arch manifest at all if any arch that is in the current manifest failed in the compose being processed. This runs the risk of our manifests going stale if we do not fix failing arches promptly, but nalin felt this is preferable to the alternatives:
If this turns out to be a big problem, we ought to be able to tweak this code to alternative #2 quite easily.
This also includes an important fix as a precursor, which I worked out while working on it: we need to allow
buildah rmicommands to fail, because they will if the image/manifest does not exist, but that's totally fine.