-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Building Wasm image with specific tags makes podman looks for (potentially non-existent) registry instead of picking the locally available image #18485
Comments
@flouthoc PTAL |
This looks like an issue in |
Any news on this @flouthoc ? Did you find the origin of the bug ? |
@mh4ck-Thales I know where it is but i was not able to work on it last week. I'll try checking it this week 😄 |
A friendly reminder that this issue had no activity for 30 days. |
@flouthoc What is going on with this one? |
I'll check this missed this one last week. |
Hi @mh4ck-Thales , I checked after #18542 we don't support annotations based builds anymore, I suggest building image with I have verified and it will work just fine with new |
Hi @flouthoc , thanks for your answer. I have some questions to better understand the decisions and the situation if you may. I stumbled on this issue when working on listing, comparing and mixing the different ways I found to build and run a Wasm image. I used the doc you mentioned and updated to remove the legacy Wasm annotations. Is deprecating the Also, #18542 mentions that "propagating annotations may have security consequences". I've never heard of that and I'd like to know more. I'd be glad if you could point me on some content on the topic that prompted podman to not include image annotations at all. |
Hi @mh4ck-Thales , Sure I'll try to answer your concerns
I don't think this is any global decision but as per the discussion happened in past a more standard way to classify an OCI image as
There is no security consequences for wasm annotation specifically it was in general where image is changing behavior of runtime via propagating annotations ( runtime-spec does not documents this) , in PR itself it is written that we might do exception for wasm annotations but I am just not sure if there are enough old users who are using But of-course if there are more reports of breaking users using |
Issue Description
When trying to run a wasm container with podman, a specific combination of flags for the build and the run command makes podman looks for the non-existent localhost registry instead of picking the image available locally. This bug seems close of #7699 or #12509 in the behavior. This does not only impact simple tags like
-t mycontainer
but also remote tags like-t myregistry.corp.net/mycontainer
, which means you either are not able to run images (because the localhost registry does not exist) or you need to be logged into the specified registry and the image must be present (instead of picking the locally available image which have the same name).Steps to reproduce the issue
App will then be in
target/wasm32-wasi/debug/app.wasm
and you can check it works with running it with a Wasm runtime, e.g :Build the Wasm container image using this Containerfile (adapt if you're not using the Rust demo app) :
to clean your podman environment. See why this step is needed in the "Additional information" section.
crun --version
if you have the+WASM:wasmedge
(or other wasm runtime) flag, otherwise you need to get a version of crun supporting it, see How to build crun for wasm? crun#1108 (comment) or use Fedora which ships in its repos a podman / crun version already built with wasm. You can then run :podman image ls
Describe the results you received
podman tries to contact a non-existent localhost registry instead of using the existing image stored locally :
Describe the results you expected
Podman succeeds in starting the wasm container.
podman info output
I confirmed this bug on multiple setups and OSes, including Debian 11 with old (3.4.2) podman version, and Fedora 38 / Archlinux (rootless) running both the latest (4.5.0) version of podman. Below is the output of
podman info
for my Fedora setup.Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Bare metal on Archlinux, qemu/KVM VMs for Debian 11 and Fedora 38
Additional information
I had a lot of trouble reproducing this bug because the cache can make the bug reproduction fails. For example building the same image with flags that works and run it, and then do the bug reproduction makes the bug disappear and the container work correctly. But if you clear completely the cache and try to do only the bug reproduction, the bug will appear.
Reproduce the bug reproduction steps 0 and 1 (don't forget
podman system reset
).Try to build with :
(notice the added
--platform wasi/wasm
flag)Notice that it works.
Notice that it works.
Notice that it is now failing as described above.
I don't know if this problem is related or another unrelated bug. I noticed that when you build the 2 images (the good one and the bad one) one after the other, the same container image is tagged with both test
test
andtest2
as they are indeed the same image with the exact same content. However, they do not have the same configuration (one is using thewasi/wasm
platform, and the other the default one). The mix-up between the two is maybe the root cause for this problem of reproducibility, but I don't know if it's a real issue or if I did something incorrectly.The text was updated successfully, but these errors were encountered: