Skip to content

Commit

Permalink
Add CoralTPU definition for generic-device-plugin (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
robarnold authored May 20, 2024
1 parent f6619d3 commit 6db443c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
15 changes: 15 additions & 0 deletions kustomization/components/gdp-coraltpu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# CoralTPU device definition for generic-device-plugin

This will add a definition for the [Coral TPU USB Accelerator](https://coral.ai/products/accelerator) to your [Generic Device Plugin](https://github.com/sdwilsh/ansible-playbooks/kustomization/components/generic-device-plugin).

# Example Usage

```yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- https://github.com/sdwilsh/ansible-playbooks/kustomization/components/generic-device-plugin
- https://github.com/marinatedconcrete/config/kustomization/components/gdp-coraltpu
```
18 changes: 18 additions & 0 deletions kustomization/components/gdp-coraltpu/add-coraltpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- op: add
path: /spec/template/spec/containers/0/args/-
value: --device
- op: add
path: /spec/template/spec/containers/0/args/-
# Note that the vendor and product start out as 1a64:089a until the first inference when they
# switch to 18d1:9302. See
# https://github.com/google-coral/edgetpu/issues/536#issuecomment-1033056048 as source of truth.
value: |
name: coraltpu
groups:
- usb:
- product: 089a
vendor: 1a6e
- usb:
- product: 9302
vendor: 18d1
8 changes: 8 additions & 0 deletions kustomization/components/gdp-coraltpu/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patches:
- path: add-coraltpu.yml
target:
kind: DaemonSet
name: generic-device-plugin

0 comments on commit 6db443c

Please sign in to comment.