11 releases (6 breaking)

0.12.20 Mar 18, 2024
0.12.9 Oct 2, 2023
0.10.4 Apr 18, 2023
0.8.23 Oct 25, 2022
0.0.35 Oct 16, 2020

#268 in Hardware support

1,114 stars & 43 watchers

Apache-2.0

415KB
9K SLoC

Introduction

This is the Akri Agent project. It is an implementation of a Kubernetes device plugin.

Design

Traits

Public

  • DiscoveryHandler - This provides an abstraction to allow protocol specific code to handle discovery and provide details for Instance creation. The trait is defined by Akri's discovery API. Implementations of this trait can be found in the discovery handlers directory.
#[async_trait]
pub trait DiscoveryHandler {
    async fn discover(
            &self,
            request: tonic::Request<akri_discovery_utils::discovery::v0::DiscoverRequest>,
        ) -> Result<tonic::Response<akri_discovery_utils::discovery::v0::DiscoverStream>, tonic::Status>;
}

Private

  • EnvVarQuery - This provides a mockable way to query for get_discovery_handler to query environment variables.
trait EnvVarQuery {
    fn get_env_var(&self, name: &'static str) -> Result<String, VarError>;
}

Dependencies

~67MB
~1M SLoC