Giter Club home page Giter Club logo

Comments (4)

jiria avatar jiria commented on June 9, 2024

Hello Chris,

If the card gets exposed through udev, you can certainly expose it to pods using Akri, no code change needed. This use case should be covered by Akri as is.

Let us know!

from akri.

kate-goldenring avatar kate-goldenring commented on June 9, 2024

Hi @cwoolum! As @jiria mentioned, our udev protocol supports discovering anything on the Linux device file system. You simply have to specify a udev rule that can be used to locate the device[s] in your Configuration. As to making your Akri Configuration, you can either modify our sample udevVideo Configuration or create your own. I'll walk you through both.

We will create a Configuration that will discover all devices in the sound subsytem and deploy an nginx broker pod. Your udev rule will probably be more specific. This rule will discover all devices listed when you run udevadm trigger --verbose --dry-run --type=devices --subsystem-match=sound

  1. Option 1: Modifying the udevVideo Configuration
    Simply run the following on your cluster. Be sure to initialize your cluster for Akri. Steps for this can be found at the beginning of the rpi4 demo.
helm repo add akri-helm-charts https://deislabs.github.io/akri/
helm install akri akri-helm-charts/akri \
    --set useLatestContainers=true \
    --set udevVideo.enabled=true \
    --set udevVideo.udevRules[0]='SUBSYSTEM=="sound"' \
    --set udevVideo.brokerPod.image.repository='nginx'

You will see nginx brokers deployed to every discovered sound device.

  1. Option 2: Create a Configuration
    It's easier to work off an existing Configuration, so download the udevVideo one by running:
helm template akri akri-helm-charts/akri \
    --set useLatestContainers=true \
    --set udevVideo.enabled=true \
    --set controller.enabled=false \
    --set agent.enabled=false > udevAudio.yaml

Open the yaml and remove all RBAC content (everything above line 79).
Feel free to change Configuration name:

metadata:
  name: my-udev-audio

Change the udev rule to fit your needs:

    udev:
      udevRules:
      - SUBSYSTEM=="sound"

Change brokerPodSpec. Make the broker pod container point to your broker -- nginx in this example. Delete all the environment variables, which were specific to the sample udevVideo broker.

  brokerPodSpec:
    containers:
    - name: my-broker
      image: "nginx:latest"
      imagePullPolicy: Always
      securityContext:
        privileged: true
      resources:
        limits:
          "{{PLACEHOLDER}}" : "1"

Now, install Akri (the controller, agent, and CRDs):

helm repo add akri-helm-charts https://deislabs.github.io/akri/
helm install akri akri-helm-charts/akri \
    --set useLatestContainers=true

Finally, apply your new udevAudio Configuration with kubectl apply -f udevAudio.yaml
You will see nginx brokers deployed to every discovered sound device.
Run microk8s kubectl get akric and you will see my-udev-audio. Delete the configuration and see the Controller automatically bring down the brokers by running kubectl delete akric my-udev-audio

Let me know if you have any questions or run into any problems.

from akri.

kate-goldenring avatar kate-goldenring commented on June 9, 2024

@cwoolum, we have updated our provided Configuration helm templates to be more generic rather than specific to one scenario, usb cameras for udev. Thank you for pointing out this needed change! We have provided documentation on how to customize that generic udev configuration, say to discover on-device audio. I am closing this, but feel free to re-open it if you have any other questions or feel like the documentation could be expanded upon.

from akri.

cwoolum avatar cwoolum commented on June 9, 2024

Thanks for the detailed response and the update to the docs! I can't wait to jump into this when I get a chance!

from akri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.