-
Notifications
You must be signed in to change notification settings - Fork 312
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
crun and wasm example - could not load `libwasmedge.so.0 #1046
Comments
Hi @marcelo-modolo Could you please confirm which wasmedge version is installed on your host ? |
wasmedge version 0.11.1 |
I believe that I managed to understand the problem and maybe it can be useful to someone else. opt/crun/bin/crun -V crun is configured to make use of +WASM:wasmedge. By default the installation of wasmedge is in the home folder tree ~/.wasmedge With the following environment variables set: LD_LIBRARY_PATH=/home/modolo/.wasmedge/lib Testing with crun directly without creating the image there are no errors tree container cd container But trying to create a container with the same binary I end up with a load error in the libraries cat Dockerfile buildah build --annotation "module.wasm.image/variant=compat-smart" -t wasm-test-02 podman run --rm -it wasm-test-02 Error: could not load The problem was in the location of the libraries! I copied the libraries to /usr/local/lib/wasmedge/ ls -l /usr/local/lib/wasmedge/ I created the file /etc/ld.so.conf.d/wasmedge.conf cat /etc/ld.so.conf.d/wasmedge.conf And ran the command sudo ldconfig No errors after that! podman run --rm -it wasm-test-02 I apologize for the mistake made but maybe the solution can be useful. |
So is this not an issue? Or should crun have been smarter and set the LD_LIBRARY_PATH to point at the same directory? |
Honestly I don't know, maybe most people do the installation as root and with that the libraries end up where they can be accessed. |
Ok I will close then. |
Hi!
I compiled and installed crun with wasm support
/opt/crun/bin/crun -V
crun version 1.6.0.0.0.77-2c6e
commit: 2c6efdd
rundir: /run/user/1000/crun
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +WASM:wasmedge +YAJL
I also adjusted the ~/.config/containers/containers.conf file to use the new crun
podman info
host:
arch: amd64
buildahVersion: 1.23.1
cgroupControllers:
... ociRuntime:
name: crun
package: Unknown
path: /opt/crun/bin/crun
version: |-
crun version 1.6.0.0.0.77-2c6e
commit: 2c6efdd
rundir: /run/user/1000/crun
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +WASM:wasmedge +YAJL
Then follow the example in https://github.com/containers/crun/blob/main/docs/wasm-wasi-example.md.
cat Dockerfile
FROM scratch
COPY wasi-hello-world.rustc.wasm /
CMD ["/wasi-hello-world.rustc.wasm"]
buildah build --annotation "module.wasm.image/variant=compat-smart" -t mywasm-image
podman run --rm -it mywasm-image
Error: could not load
libwasmedge.so.0
: libwasmedge.so.0: cannot open shared object file: No such file or directory: OCI runtime attempted to invoke a command that was not foundDoes anyone have a tip that could help me?
Thanks
The text was updated successfully, but these errors were encountered: