c3d / ociplex

An OCI runtime multiplexer
0 stars 0 forks source link

Error opening 'log' fifo #4

Closed c3d closed 1 year ago

c3d commented 1 year ago

Running the following command:

podman --runtime $PWD/run-kata run -it  fedora bash

There is an error in the output:

io.containerd.kata.v2: fifo error: stat log: no such file or directoryError: ShimV2 backend "/usr/local/bin/containerd-shim-koto-v2" failed with status code 1
c3d commented 1 year ago

The path for the log fifo is the current path for ociplex.

OpenLog with path /home/ddd/Work/ociplex/ociplex
c3d commented 1 year ago

According to the runtime shim-v2 spec:

A fifo on unix or named pipe on Windows will be provided to the shim. It can be located inside the cwd of the shim named "log". The shims can use the existing github.com/containerd/containerd/log package to log debug messages. Messages will automatically be output in the containerd's daemon logs with the correct fields and runtime set.

It is not very clear who actually provides this (which highlights the rule never use passive tense). Is ociplex supposed to create it? Chances are podman won't, since it does not know about the shimv2 protocol. And the Rust shimv2 crate does not mention it in the docs. Since that crate is really a really thin wrapper around RPC calls, it seems unlikely that it will do anything on its own.

c3d commented 1 year ago

According to this example it indeed seems relatively necessary to create the log file directly. See the following snippet:

Or manually:

$ touch log

# Run containerd in background
$ sudo TTRPC_ADDRESS="/var/run/containerd/containerd.sock.ttrpc" \
    cargo run --example skeleton -- \
    -namespace default \
    -id 1234 \
    -address /var/run/containerd/containerd.sock \
    -publish-binary ./bin/containerd \
    start
unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock

$ cargo build --example shim-proto-connect
$ sudo ./target/debug/examples/shim-proto-connect unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock
Connecting to unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock...
Sending `Connect` request...
Connect response: version: "example"
Sending `Shutdown` request...
Shutdown response: ""