Skip to content

Commit

Permalink
Merge pull request #482 from romoh/main
Browse files Browse the repository at this point in the history
rust toolchain version update
  • Loading branch information
romoh authored Jun 15, 2022
2 parents 4c6863f + e85367b commit 4de8bc8
Show file tree
Hide file tree
Showing 29 changed files with 120 additions and 177 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-component-per-arch/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function shell_cmd(cmd) {

if (core.getInput('build_rust') == '1') {
console.log(`Install Rust`)
child_process.execSync(`curl https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.58.1`);
child_process.execSync(`curl https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.61.0`);
const bindir = `${process.env.HOME}/.cargo/bin`;
process.env.PATH = `${process.env.PATH}:${bindir}`;

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-rust-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Rust install
uses: actions-rs/toolchain@v1
with:
toolchain: 1.58.1
toolchain: 1.61.0
override: true
components: clippy, rustfmt

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Rust install
uses: actions-rs/toolchain@v1
with:
toolchain: 1.58.1
toolchain: 1.61.0
override: true
components: clippy, rustfmt
- name: Install Linux requirements
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tarpaulin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
persist-credentials: false

- name: Create tarpaulin instance
run: docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.19.1 bash -c "echo 'sleep 600m; echo bye' > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt
run: docker create --network host --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.20.1 bash -c "echo 'sleep 600m; echo bye' > /tmp/keep_alive.sh; chmod 777 /tmp/keep_alive.sh; /tmp/keep_alive.sh" > container_id.txt
- name: Start tarpaulin instance
run: docker start $(cat container_id.txt)
- name: Install linux requirement in tarpaulin instance
Expand Down
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<p align="center"><img src="https://github.com/project-akri/akri-docs/blob/main/art/logo-horizontal/akri-logo-horizontal-light.svg" alt="Akri Logo" width="300"></p>

[![Slack channel #akri](https://img.shields.io/badge/slack-akri-blueviolet.svg?logo=slack)](https://kubernetes.slack.com/messages/akri)
[![Rust Version](https://img.shields.io/badge/rustc-1.58.1-blue.svg)](https://blog.rust-lang.org/2022/01/20/Rust-1.58.1.html)
[![Kubernetes Version](https://img.shields.io/badge/kubernetes-≥%201.16-blue.svg)](https://kubernetes.io/)
[![codecov](https://codecov.io/gh/project-akri/akri/branch/main/graph/badge.svg?token=V468HO7CDE)](https://codecov.io/gh/project-akri/akri)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5339/badge)](https://bestpractices.coreinfrastructure.org/projects/5339)

[![Check Rust](https://github.com/project-akri/akri/workflows/Check%20Rust/badge.svg?branch=main&event=push)](https://github.com/project-akri/akri/actions?query=workflow%3A%22Check+Rust%22)
[![Tarpaulin Code Coverage](https://github.com/project-akri/akri/workflows/Tarpaulin%20Code%20Coverage/badge.svg?branch=main&event=push)](https://github.com/project-akri/akri/actions?query=workflow%3A%22Tarpaulin+Code+Coverage%22)
[![Build Controller](https://github.com/project-akri/akri/workflows/Build%20Controller/badge.svg?branch=main&event=push)](https://github.com/project-akri/akri/actions?query=workflow%3A%22Build+Controller%22)
[![Slack channel #akri](https://img.shields.io/badge/slack-akri-blueviolet.svg?logo=slack)](https://kubernetes.slack.com/messages/akri)
[![Rust Version](https://img.shields.io/badge/rustc-1.61.0-blue.svg)](https://blog.rust-lang.org/2022/01/20/Rust-1.61.0.html)
[![Kubernetes Version](https://img.shields.io/badge/kubernetes-≥%201.16-blue.svg)](https://kubernetes.io/)
[![codecov](https://codecov.io/gh/project-akri/akri/branch/main/graph/badge.svg?token=V468HO7CDE)](https://codecov.io/gh/project-akri/akri)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5339/badge)](https://bestpractices.coreinfrastructure.org/projects/5339)

[![Check Rust](https://github.com/project-akri/akri/workflows/Check%20Rust/badge.svg?branch=main&event=push)](https://github.com/project-akri/akri/actions?query=workflow%3A%22Check+Rust%22)
[![Tarpaulin Code Coverage](https://github.com/project-akri/akri/workflows/Tarpaulin%20Code%20Coverage/badge.svg?branch=main&event=push)](https://github.com/project-akri/akri/actions?query=workflow%3A%22Tarpaulin+Code+Coverage%22)
[![Build Controller](https://github.com/project-akri/akri/workflows/Build%20Controller/badge.svg?branch=main&event=push)](https://github.com/project-akri/akri/actions?query=workflow%3A%22Build+Controller%22)
[![Build Agent](https://github.com/project-akri/akri/workflows/Build%20Agent/badge.svg?branch=main&event=push)](https://github.com/project-akri/akri/actions?query=workflow%3A%22Build+Agent%22)
[![Test K3s, Kubernetes, and MicroK8s](https://github.com/project-akri/akri/workflows/Test%20K3s,%20Kubernetes,%20and%20MicroK8s/badge.svg?branch=main&event=push)](https://github.com/project-akri/akri/actions?query=workflow%3A%22Test+K3s%2C+Kubernetes%2C+and+MicroK8s%22)


----
Akri is a [Cloud Native Computing Foundation (CNCF) Sandbox project](https://www.cncf.io/sandbox-projects/).

Akri lets you easily expose heterogeneous leaf devices (such as IP cameras and USB devices) as resources in a Kubernetes cluster, while also supporting the exposure of embedded hardware resources such as GPUs and FPGAs. Akri continually detects nodes that have access to these devices and schedules workloads based on them.
Akri lets you easily expose heterogeneous leaf devices (such as IP cameras and USB devices) as resources in a Kubernetes cluster, while also supporting the exposure of embedded hardware resources such as GPUs and FPGAs. Akri continually detects nodes that have access to these devices and schedules workloads based on them.

Simply put: you name it, Akri finds it, you use it.


----
## Why Akri
At the edge, there are a variety of sensors, controllers, and MCU class devices that are producing data and performing actions. For Kubernetes to be a viable edge computing solution, these heterogeneous “leaf devices” need to be easily utilized by Kubernetes clusters. However, many of these leaf devices are too small to run Kubernetes themselves. Akri is an open source project that exposes these leaf devices as resources in a Kubernetes cluster. It leverages and extends the Kubernetes [device plugin framework](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/), which was created with the cloud in mind and focuses on advertising static resources such as GPUs and other system hardware. Akri took this framework and applied it to the edge, where there is a diverse set of leaf devices with unique communication protocols and intermittent availability.
At the edge, there are a variety of sensors, controllers, and MCU class devices that are producing data and performing actions. For Kubernetes to be a viable edge computing solution, these heterogeneous “leaf devices” need to be easily utilized by Kubernetes clusters. However, many of these leaf devices are too small to run Kubernetes themselves. Akri is an open source project that exposes these leaf devices as resources in a Kubernetes cluster. It leverages and extends the Kubernetes [device plugin framework](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/), which was created with the cloud in mind and focuses on advertising static resources such as GPUs and other system hardware. Akri took this framework and applied it to the edge, where there is a diverse set of leaf devices with unique communication protocols and intermittent availability.

Akri is made for the edge, **handling the dynamic appearance and disappearance of leaf devices**. Akri provides an abstraction layer similar to [CNI](https://github.com/containernetworking/cni), but instead of abstracting the underlying network details, it is removing the work of finding, utilizing, and monitoring the availability of the leaf device. An operator simply has to apply a Akri Configuration to a cluster, specifying the Discovery Handler (say ONVIF) that should be used to discover the devices and the Pod that should be deployed upon discovery (say a video frame server). Then, Akri does the rest. An operator can also allow multiple nodes to utilize a leaf device, thereby **providing high availability** in the case where a node goes offline. Furthermore, Akri will automatically create a Kubernetes service for each type of leaf device (or Akri Configuration), removing the need for an application to track the state of pods or nodes.

Expand All @@ -39,21 +39,21 @@ margin-right: auto; display: block; margin-left: auto;"/>
Try the [end to end demo](https://docs.akri.sh/demos/usb-camera-demo) of Akri to see Akri discover mock video cameras and a streaming app display the footage from those cameras. It includes instructions on K8s cluster setup. If you would like to perform the demo on a cluster of Raspberry Pi 4's, see the [Raspberry Pi 4 demo](https://docs.akri.sh/demos/usb-camera-demo-rpi4).

## Documentation
See Akri's [documentation site](https://docs.akri.sh/), which includes:
- [User guide for deploying Akri using Helm](https://docs.akri.sh/user-guide/getting-started)
See Akri's [documentation site](https://docs.akri.sh/), which includes:
- [User guide for deploying Akri using Helm](https://docs.akri.sh/user-guide/getting-started)
- [Akri architecture](https://docs.akri.sh/architecture/architecture-overview)
- [How to build Akri](https://docs.akri.sh/development/building)
- [How to extend Akri for protocols that haven't been supported yet](https://docs.akri.sh/development/handler-development).
- [How to create a broker to leverage discovered devices](https://docs.akri.sh/development/broker-development).
To contribute to Akri's documentation, visit Akri's [docs repository](https://github.com/project-akri/akri-docs).
To contribute to Akri's documentation, visit Akri's [docs repository](https://github.com/project-akri/akri-docs).

## Roadmap
Akri is built to be extensible. We currently have ONVIF, udev, OPC UA Discovery Handlers, but as a community, we hope to continuously support more protocols. We have created a [Discovery Handler implementation roadmap](https://docs.akri.sh/community/roadmap#implement-additional-discovery-handlers) in order to prioritize development of Discovery Handlers. If there is a protocol you feel we should prioritize, please [create an issue](https://github.com/project-akri/akri/issues/new/choose), or better yet, contribute the implementation!

To see what else is in store for Akri, reference our [roadmap](https://docs.akri.sh/community/roadmap).

## Community, Contributing, and Support
You can reach the Akri community via the [#akri](https://kubernetes.slack.com/messages/akri) channel in [Kubernetes Slack](https://kubernetes.slack.com) or join our [community calls](https://hackmd.io/@akri/S1GKJidJd) on the first Tuesday of the month at 9:00 AM PT.
You can reach the Akri community via the [#akri](https://kubernetes.slack.com/messages/akri) channel in [Kubernetes Slack](https://kubernetes.slack.com) or join our [community calls](https://hackmd.io/@akri/S1GKJidJd) on the first Tuesday of the month at 9:00 AM PT.

Akri welcomes contributions, whether by [creating new issues](https://github.com/project-akri/akri/issues/new/choose) or pull requests. See our [contributing document](https://docs.akri.sh/community/contributing) on how to get started!

Expand Down
4 changes: 2 additions & 2 deletions agent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "agent"
version = "0.8.11"
version = "0.8.12"
authors = ["Kate Goldenring <[email protected]>", "<[email protected]>"]
edition = "2018"
rust-version = "1.58.1"
rust-version = "1.61.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
20 changes: 9 additions & 11 deletions agent/src/util/device_plugin_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@ pub async fn terminate_device_plugin_service(
/// This creates an Instance's unique name
pub fn get_device_instance_name(id: &str, config_name: &str) -> String {
format!("{}-{}", config_name, &id)
.replace(".", "-")
.replace("/", "-")
.replace('.', "-")
.replace('/', "-")
}

// Aggregate a Configuration and Device's properties so they can be displayed in an Instance and injected into brokers as environment variables.
Expand Down Expand Up @@ -918,11 +918,11 @@ mod device_plugin_service_tests {
let instance_name2: String = "10.1.2.3".to_string();
assert_eq!(
"usb-camera--dev-video0",
get_device_instance_name(&instance_name1, &"usb-camera".to_string())
get_device_instance_name(&instance_name1, "usb-camera")
);
assert_eq!(
"ip-camera-10-1-2-3".to_string(),
get_device_instance_name(&instance_name2, &"ip-camera".to_string())
get_device_instance_name(&instance_name2, "ip-camera")
);
}

Expand Down Expand Up @@ -1226,8 +1226,7 @@ mod device_plugin_service_tests {
}

// Test shared all healthy
let mut devices: Vec<v1beta1::Device> =
build_virtual_devices(&device_usage, true, &"nodeA".to_string());
let mut devices: Vec<v1beta1::Device> = build_virtual_devices(&device_usage, true, "nodeA");
for device in devices {
assert_eq!(
expected_devices_nodea.get(&device.id).unwrap(),
Expand All @@ -1236,7 +1235,7 @@ mod device_plugin_service_tests {
}

// Test unshared all healthy
devices = build_virtual_devices(&device_usage, false, &"nodeA".to_string());
devices = build_virtual_devices(&device_usage, false, "nodeA");
for device in devices {
assert_eq!(
expected_devices_nodea.get(&device.id).unwrap(),
Expand All @@ -1245,7 +1244,7 @@ mod device_plugin_service_tests {
}

// Test shared some unhealthy (taken by another node)
devices = build_virtual_devices(&device_usage, true, &"nodeB".to_string());
devices = build_virtual_devices(&device_usage, true, "nodeB");
for device in devices {
assert_eq!(
expected_devices_nodeb.get(&device.id).unwrap(),
Expand All @@ -1254,9 +1253,8 @@ mod device_plugin_service_tests {
}

// Test unshared panic. A different node should never be listed under any device usage slots
let result = std::panic::catch_unwind(|| {
build_virtual_devices(&device_usage, false, &"nodeB".to_string())
});
let result =
std::panic::catch_unwind(|| build_virtual_devices(&device_usage, false, "nodeB"));
assert!(result.is_err());
}

Expand Down
4 changes: 2 additions & 2 deletions build/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ then
if [ -x "$(command -v sudo)" ];
then
echo "Install rustup"
sudo curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=1.58.1
sudo curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=1.61.0
else
echo "Install rustup"
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=1.58.1
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=1.61.0
fi
else
echo "Found rustup"
Expand Down
4 changes: 2 additions & 2 deletions controller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "controller"
version = "0.8.11"
version = "0.8.12"
authors = ["<[email protected]>", "<[email protected]>"]
edition = "2018"
rust-version = "1.58.1"
rust-version = "1.61.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 3 additions & 3 deletions controller/src/util/instance_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ async fn handle_deletion_work(
&instance_name,
context_node_name,
instance_shared,
&"pod".to_string()
"pod"
);
let pod_app_name = pod::create_broker_app_name(
instance_name,
Some(context_node_name),
instance_shared,
&"pod".to_string(),
"pod",
);
trace!(
"handle_deletion_work - pod::remove_pod name={:?}, namespace={:?}",
Expand Down Expand Up @@ -360,7 +360,7 @@ async fn handle_addition_work(
instance_uid.to_string(),
),
&capability_id,
&new_node.to_string(),
new_node,
instance_shared,
podspec,
)?;
Expand Down
2 changes: 1 addition & 1 deletion controller/src/util/pod_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl BrokerPodWatcher {
let svc_name = service::create_service_app_name(
configuration_name,
instance_id,
&"svc".to_string(),
"svc",
handle_instance_svc,
);

Expand Down
4 changes: 2 additions & 2 deletions deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.8.11
version: 0.8.12

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.8.11
appVersion: 0.8.12
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "debug-echo-discovery-handler"
version = "0.8.11"
version = "0.8.12"
authors = ["Kate Goldenring <[email protected]>"]
edition = "2018"
rust-version = "1.58.1"
rust-version = "1.61.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
Loading

0 comments on commit 4de8bc8

Please sign in to comment.