project-akri / akri-on-krustlet

WebAssembly Systems Interface version for akri
Apache License 2.0
11 stars 5 forks source link

Add krustlet devices demo and improve docs #2

Closed rodz closed 3 years ago

rodz commented 3 years ago

This PR adds a new demo and improves the documentation from the previous specs.

rodz commented 3 years ago

Is there any way that reading and writing to the in/out files could be put into library where the functions handle generics? How is the proxy going to be easily ported to handle ONVIF DH?

We have the gRPC limitations as we need to implement the service in order to receive the requests. Since all Discovery Handler uses the same we dont need to change anything to make the proxy compatible with onvif or any other DH.

kate-goldenring commented 3 years ago

@rodz krustlet recently moved their documentation to a separate doc site. Can you fix the links?

kate-goldenring commented 3 years ago

After running the grpc proxy, I get the error:

input: {"descriptions":["foo0","foo1"]}
thread 'tokio-runtime-worker' panicked at 'Failed to write input!: Os { code: 2, kind: NotFound, message: "No such file or directory" }', dh-grpc-proxy/src/discovery_handler.rs:105:34

I think it is because the input file does not exist as i checked and the following directories do not exist for me:

pub const OUTPUT_FILE_PATH: &str = "/tmp/wde-dir/out.out";
pub const INPUT_FILE_PATH: &str = "/tmp/wde-dir/in.in";

Add steps to create the input and output directories. After mkdir /tmp/wde-dir it runs. Ideally, these directories should also be configurable via environment variables during execution. Also this error should bubble up and end the program rather than looping and reoccuring

kate-goldenring commented 3 years ago

After applying the wasi discovery handler, the Agent errors when trying to build the device plugins for the foo devices:

2021-08-04T17:18:55Z INFO  agent::util::device_plugin_builder] serve - creating a device plugin server that will listen at: /var/lib/kubelet/device-plugins/akri-debug-echo-43beb5-1628097535.sock
thread 'tokio-runtime-worker' panicked at 'Failed to bind to socket path: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', agent/src/util/device_plugin_builder.rs:135:53

However, right now, the device plugin path in Akri is not configurable -- can you put up an issue on Akri for this (and maybe a fix :) )? It should be so that when running it matches the krustlet one $HOME/.krustlet/device_plugins. I believe you have a local fix you are using right now @rods right? For now, you can specify that krustlet also use the /var/lib/kubelet/device-plugins directory by setting KRUSTLET_DEVICE_PLUGINS_DIR=/var/lib/kubelet/device-plugins when running, and make sure both kruslet and the agent have perms by running as sudo or changing the directory permissions.