Skip to content

Instantly share code, notes, and snippets.

View pmundt's full-sized avatar

Paul Mundt pmundt

View GitHub Profile
@pmundt
pmundt / edgetpu-devicequery-image-variants-path.yaml
Created July 28, 2020 15:11
EdgeTPU devicequery image variants with local build context
source:
type: dockerfile
url: file:///home/pmundt/devel/git/accelerator-base-containers/examples/edgetpu-devicequery/Dockerfile
build_context:
path: /home/pmundt/devel/git/accelerator-base-containers/examples/edgetpu-devicequery
dir_name: edgetpu-devicequery
target:
registry_ip: localhost:5000
images:
@pmundt
pmundt / image-builder-cli.sh
Last active July 28, 2020 15:08
SODALITE Image Builder CLI Wrapper
#!/bin/sh
[ $# != 1 ] && echo "Usage: $0 input-file.yaml" && exit 1
get_abs_path() {
# $1 : relative path
[ ! -z $1 ] && echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
input=$(get_abs_path $1)
@pmundt
pmundt / inputs-dockerfile.yaml
Created July 27, 2020 13:39
SODALITE image builder inputs file
source:
type: dockerfile
url: file:///path/to/Dockerfile
username: my_optional_username
password: my_optional_password
build_context:
dir_name: build_context_dir_name
# local build context
path: /path/to/local/build/context
@pmundt
pmundt / edgetpu-devicequery-image-variants.yaml
Last active July 27, 2020 12:38
EdgeTPU devicequery image variants
source:
type: dockerfile
url: https://raw.githubusercontent.com/adaptant-labs/accelerator-base-containers/master/examples/edgetpu-devicequery/Dockerfile
build_context:
dir_name: accelerator-base-containers
subdir: examples/edgetpu-devicequery
url: https://github.com/adaptant-labs/accelerator-base-containers
target:
registry_ip: localhost:5000
@pmundt
pmundt / Dockerfile
Created July 7, 2020 18:53
EdgeTPU Device Query Dockerfile
FROM acceleratorbase/edgetpu-std
ADD devicequery.py /
CMD [ "python3", "devicequery.py" ]
@pmundt
pmundt / edgetpu-devicequery.py
Created July 7, 2020 18:51
EdgeTPU Device Query Example
from edgetpu.basic import edgetpu_utils
version = edgetpu_utils.GetRuntimeVersion()
print(version)
all_edgetpu_paths = edgetpu_utils.ListEdgeTpuPaths(edgetpu_utils.EDGE_TPU_STATE_NONE)
print('Available EdgeTPU Device(s):')
print(''.join(all_edgetpu_paths))
@pmundt
pmundt / rpi4-ncs2-echo-pod.yaml
Created May 21, 2020 22:06
HTTP Echo Service for an RPi 4 B + Intel NCS2 attached via USB
apiVersion: v1
kind: Pod
metadata:
name: http-echo-rpi4b-ncs2-pod
labels:
app: http-echo
spec:
containers:
- name: http-echo
image: adaptant/http-echo
@pmundt
pmundt / edgetpu-echo-pod.yaml
Last active May 30, 2020 21:10
HTTP Echo Service scheduled on an in-cluster EdgeTPU
apiVersion: v1
kind: Pod
metadata:
name: http-echo-edgetpu-pod
labels:
app: http-echo
spec:
containers:
- name: http-echo
image: adaptant/http-echo
@pmundt
pmundt / nano-echo-pod.yaml
Created May 5, 2020 15:21
http-echo-gpu-pod
apiVersion: v1
kind: Pod
metadata:
name: http-echo-gpu-pod
labels:
app: http-echo
spec:
containers:
- name: http-echo
image: adaptant/http-echo
@pmundt
pmundt / http-echo-service.yaml
Created May 5, 2020 15:20
http echo service
kind: Service
apiVersion: v1
metadata:
name: http-echo-service
spec:
type: NodePort
selector:
app: http-echo
ports: