Closed leoluKL closed 2 years ago
Hi @leolumicrosoft! Good point that this section is missing steps to install the CRDs and create the discovery handler directory. Would you be interested in adding that?
PR is created. Please check
I am running in some issue to setup the local running dev environment. Any insight is appreciated. I setup as below steps.
Issue: locally running debug echo discovery handler can not register with also locally running Akri agent, though fully installed Akri by helm runs debug echo discovery correctly.
My steps of setup (in an empty microk8s cluster):
helm template akri akri-helm-charts/akri \
--set debugEcho.configuration.enabled=true \
--set debugEcho.configuration.brokerPod.image.repository=nginx \
--set debugEcho.configuration.shared=false \
--set rbac.enabled=false \
--set controller.enabled=false \
--set agent.enabled=false > debugechoconfiguration.yaml
cd akri/agent
sudo -E DEBUG_ECHO_INSTANCES_SHARED=false ENABLE_DEBUG_ECHO=1 RUST_LOG=info METRICS_PORT=8082 KUBECONFIG=~/.kube/config DISCOVERY_HANDLERS_DIRECTORY=~/tmp/akri AGENT_NODE_NAME=vm20 HOST_CRICTL_PATH=/usr/bin/crictl HOST_RUNTIME_ENDPOINT=/var/snap/microk8s/common/run/containerd.sock HOST_IMAGE_ENDPOINT=/var/snap/microk8s/common/run/containerd.sock ~/.cargo/bin/cargo run
cd akri/discovery-handler-modules/debug-echo-discovery-handler
RUST_LOG=info DEBUG_ECHO_INSTANCES_SHARED=false DISCOVERY_HANDLERS_DIRECTORY=~/tmp/akri AGENT_NODE_NAME=vm20 ~/.cargo/bin/cargo run
When I noticed that there was no akri instance created as foo1 foo2, I use trace to check. I found that debug echo discovery handler does not really pass registration to Akri agent, though I am sure both is using the same .sock UDS file. I can trace to that in discovery-utils/src/registration_client.rs, register_discovery_handler does not pass below async await so it repeatedly tries registering, what could be the problem for this locally dev environment setup?
if let Ok(channel) = Endpoint::try_from("dummy://[::]:50051")?
.connect_with_connector(tower::service_fn(move |_: Uri| {
tokio::net::UnixStream::connect(super::get_registration_socket())
}))
.await
Found the reason, it is because the discovery handler is running without sudo permission. I manage to print the tonic error from connect_with_connector as below panicked at 'tonic::transport::Error(Transport, hyper::Error(Connect, Os { code: 13, kind: PermissionDenied, message: "Permission denied" }))'
Then I tried running debug echo discovery handler locally with sudo, and it is successful now and two akri instances were created. I will modify the document as well that discovery handler should be runned using sudo.