Bug 1216104 - Podman does not respect annotations
Summary: Podman does not respect annotations
Status: CONFIRMED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Containers (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Containers Team
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-10 17:28 UTC by Alexandre Vicenzi
Modified: 2023-10-12 07:28 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Vicenzi 2023-10-10 17:28:33 UTC
Executing an image that has the annotation "module.wasm.image/variant=compat" seems to have no effect on Podman.

The following command fails:

> podman run hello-wasm
> {"msg":"exec container process `/hello.wasm`: Exec format error","level":"error","time":"2023-10-10T17:19:12.215791Z"}

While the following command works:

> podman run --annotation module.wasm.image/variant=compat  hello-wasm
> Hello WebAssembly!

The image has the correct annotation, but Podman does not respect it. In my assumption, Podman should respect the annotation in the image.

The image was built with Buildah:

> buildah build --annotation "module.wasm.image/variant=compat" -t hello-wasm

Here is a snipped of the image object:

> podman image inspect hello-wasm
> [
>      {
>           // omitted data
>           "Annotations": {
>                "module.wasm.image/variant": "compact",
>                "org.opencontainers.image.base.digest": "",
>                "org.opencontainers.image.base.name": ""
>           },
>           // omitted data
>      }
> ]

This command seems to work on other distributions as it is documented in many places around the internet, for example: https://opensource.com/article/22/10/wasm-containers
Comment 1 Dan Čermák 2023-10-11 17:10:13 UTC
Try installing crun. The default runtime on opensuse Tumbleweed is runc, where running wasm binaries doesn't appear to work.
Comment 2 Alexandre Vicenzi 2023-10-12 07:23:49 UTC
(In reply to Dan Čermák from comment #1)
> Try installing crun. The default runtime on opensuse Tumbleweed is runc,
> where running wasm binaries doesn't appear to work.

I do have crun installed and Podman picks the correct runtime based on annotations.
Comment 3 Alexandre Vicenzi 2023-10-12 07:26:12 UTC
It fails even if I force to use crun.

> podman run hello-wasm
> {"msg":"exec container process `/hello.wasm`: Exec format error","level":"error","time":"2023-10-12T07:24:48.688437Z"}

> podman --runtime=/usr/bin/crun run hello-wasm
> {"msg":"exec container process `/hello.wasm`: Exec format error","level":"error","time":"2023-10-12T07:24:58.163032Z"}
Comment 4 Alexandre Vicenzi 2023-10-12 07:28:23 UTC
To my surprise, it works if I do:

> podman --runtime=/usr/bin/crun-wasm run hello-wasm
> Hello WebAssembly!

/usr/bin/crun-wasm is link to /usr/bin/crun, it is the same binary.

alexandre@localhost:~/workspace/hello> /usr/bin/crun -v
crun version 1.9
commit: a538ac4ea1ff319bcfe2bf81cb5c6f687e2dc9d3
rundir: /run/user/1000/crun
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL

alexandre@localhost:~/workspace/hello> /usr/bin/crun-wasm -v
crun version 1.9
commit: a538ac4ea1ff319bcfe2bf81cb5c6f687e2dc9d3
rundir: /run/user/1000/crun
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL