runwasi icon indicating copy to clipboard operation
runwasi copied to clipboard

Daemon cannot start under shared mode

Open chenzhuofu opened this issue 1 year ago • 9 comments

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.

chenzhuofu avatar Aug 01 '23 09:08 chenzhuofu

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

Mossaka avatar Aug 02 '23 19:08 Mossaka

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/.

chenzhuofu avatar Aug 02 '23 19:08 chenzhuofu

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 avatar Aug 02 '23 22:08 Mossaka

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

Mossaka avatar Aug 02 '23 22:08 Mossaka

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?

chenzhuofu avatar Aug 03 '23 07:08 chenzhuofu

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

Mossaka avatar Aug 03 '23 20:08 Mossaka

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.

chenzhuofu avatar Aug 04 '23 07:08 chenzhuofu

@Mossaka any update on shared-mode?

macko99 avatar Jul 09 '24 23:07 macko99

@macko99 we have not had a ton of time to put toward shared-mode at this point, and have been looking to redesign the functionality using the containerd sandboxer APIs rather than the current design. If anyone is interested in hacking on the current shared-mode functionality, we'd gladly review PRs.

I think the next step for shared-mode is to create a new proposal for how we'd implement it using the containerd sandboxer APIs, then implement that proposal after we gain some consensus.

devigned avatar Jul 10 '24 13:07 devigned