containerd / runwasi

Facilitates running Wasm / WASI workloads managed by containerd
Apache License 2.0
1.01k stars 82 forks source link

Daemon cannot start under shared mode #218

Open chenzhuofu opened 11 months ago

chenzhuofu commented 11 months ago

I followed the building instructions and installed the runwasi tools locally. The make check and mae test executed successfully.

vagrant@vagrant:~/runwasi$ make check
cargo fmt --all -- --check
cargo clippy --all --all-targets -- -D warnings
    Finished dev [unoptimized + debuginfo] target(s) in 0.35s

Then I tried to use shared mode executing containerd-wasmedged to start daemon, but it errored as,

vagrant@vagrant:~/runwasi$ containerd-wasmedged
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Others("ENOENT: No such file or directory")', crates/containerd-shim-wasmedge/src/bin/containerd-wasmedged/main.rs:19:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is it my mistake in operation or are there indeed some bugs? Thanks for attention.

Mossaka commented 11 months ago

Could you please check the containerd log and paste them here?

chenzhuofu commented 11 months ago

Could you please check the containerd log and paste them here?

Hi Mossaka,

I hadn't used containerd to invoke containerd-wasmedged. The later is an executable in /usr/local/bin/.

Mossaka commented 11 months ago

Ah okay I misread it. I can verify that I could reproduce this error locally. Honestly I am not familiar with how the shared mode is implemented / used.

It looks like when you executed the binary, it tried to bind a socket at unix:///run/io.containerd.wasmwasi.v1/manager.sock which was not found.

@cpuguy83 do you know this issue?

Mossaka commented 11 months ago

Try mkdir /run/io.containerd.wasmwasi.v1/

chenzhuofu commented 11 months ago

Try mkdir /run/io.containerd.wasmwasi.v1/

That worked! I sucessfully started the containerd-wasmedged after mkdir.

But now another problem is that when I started the daemon and executeed sudo ctr run --rm --runtime=io.containerd.wasmedged.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello',

it will timeouted and errored like, ctr: failed to dial "/run/containerd/containerd.sock": context deadline exceeded

Could you please help me solve this?

Mossaka commented 11 months ago

Did you make sure that containerd is running in the background?

chenzhuofu commented 11 months ago

Sorry that I didn't start containerd by systemctl.

Then I started it and could execute sudo ctr run --rm --runtime=io.containerd.wasmedge.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello' in Normal mode and received the expected result ("hello\nexiting").

After that, I executed sudo containerd-wasmedged in one bash and sudo ctr run --rm --runtime=io.containerd.wasmedged.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm /wasi-demo-app.wasm echo 'hello' (for Shared mode) in another, but they all stuck.

Does Shared mode work well in your side? I don't know if I mistake something.