Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .drone.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ steps:
- name: docker
image: plugins/docker
settings:
repo: quay.io/kkohtaka/edgetpu-device-plugin
repo: quay.io/revoman/edgetpu-device-plugin
tags: amd64
registry: quay.io
username:
Expand Down Expand Up @@ -41,7 +41,7 @@ steps:
- name: docker
image: plugins/docker
settings:
repo: quay.io/kkohtaka/edgetpu-device-plugin
repo: quay.io/revoman/edgetpu-device-plugin
tags: arm32
build_args:
- DEBIAN_BASE_SUFFIX=arm
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bak
38 changes: 27 additions & 11 deletions Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
ARG DEBIAN_BASE_SUFFIX=amd64
FROM k8s.gcr.io/debian-base-${DEBIAN_BASE_SUFFIX}:0.4.1 as builder
ARG GO_TARBALL=go1.11.linux-amd64.tar.gz
FROM debian:bullseye-slim as builder
ARG GO_TARBALL=go1.17.linux-amd64.tar.gz
ENV GOROOT=/usr/local/go
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
RUN apt-get update && apt-get install -y \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
RUN curl https://dl.google.com/go/${GO_TARBALL} | tar zxv -C /usr/local
WORKDIR $GOPATH/src/github.com/kkohtaka/edgetpu-device-plugin
WORKDIR $GOPATH/src/github.com/therevoman/edgetpu-device-plugin
COPY vendor vendor
COPY main.go .
COPY pkg pkg
COPY vendor vendor
COPY go.sum .
COPY go.mod .
#RUN go mod vendor \
# && go get -u golang.org/x/xerrors \
# && go get -u k8s.io/client-go@v0.18.19
RUN CGO_ENABLED=0 GOOS=linux go build -a -o /bin/edgetpu-device-plugin
RUN curl http://storage.googleapis.com/cloud-iot-edge-pretrained-models/edgetpu_api.tar.gz | tar xzv -C /

FROM k8s.gcr.io/debian-base-${DEBIAN_BASE_SUFFIX}:0.4.1
FROM debian:bullseye-slim
ARG SO_SUFFIX=x86_64
ARG LIB_PATH=/lib/x86_64-linux-gnu
COPY --from=builder /python-tflite-source/libedgetpu/libedgetpu_${SO_SUFFIX}.so ${LIB_PATH}/libedgetpu.so
COPY --from=builder /python-tflite-source/99-edgetpu-accelerator.rules /etc/udev/rules.d/
COPY --from=builder /bin/edgetpu-device-plugin /bin/
RUN apt-get update && apt-get install -y \
libusb-1.0 \
RUN apt update && apt install -y \
curl \
libusb-dev \
udev \
gnupg \
&& rm -rf /var/lib/apt/lists/* \
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list \
&& echo "deb https://packages.cloud.google.com/apt coral-cloud-stable main" | tee /etc/apt/sources.list.d/coral-cloud.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
&& apt update && apt upgrade -y\
&& apt install -y \
python3-pycoral \
libedgetpu1-std \
gasket-dkms \
edgetpu-compiler \
&& rm -rf /var/lib/apt/lists/* \
&& udevadm trigger
&& (udevadm trigger || true)

ENTRYPOINT ["/bin/edgetpu-device-plugin"]
6 changes: 5 additions & 1 deletion Gopkg.toml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
name = "k8s.io/klog"
version = "0.2.0"

[[constraint]]
name = "k8s.io/client-go"
version = "v0.18.19"

[[constraint]]
name = "k8s.io/kubernetes"
version = "1.13.4"
version = "v1.18.19"

[prune]
go-tests = true
Expand Down
4 changes: 2 additions & 2 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REGISTRY=quay.io
PRODUCT=kkohtaka/edgetpu-device-plugin
PRODUCT=revoman/edgetpu-device-plugin

default: build

Expand Down Expand Up @@ -29,7 +29,7 @@ samples-arm32:
.PHONY: clean
clean:
$(MAKE) -C samples clean
kubectl delete --ignore-not-found -f edgetpu-device-plugin.yaml
kubectl delete --ignore-not-found -f edgetpu-device-plugin.amd64.yaml

.PHONY: push
push:
Expand Down
4 changes: 2 additions & 2 deletions edgetpu-device-plugin.amd64.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ spec:
# This, along with the annotation above marks this pod as a critical add-on.
- key: CriticalAddonsOnly
operator: Exists
- key: kkohtaka.org/edgetpu
- key: revoman.org/edgetpu
operator: Exists
effect: NoSchedule
containers:
- name: edgetpu-device-plugin
image: quay.io/kkohtaka/edgetpu-device-plugin:amd64
image: quay.io/revoman/edgetpu-device-plugin:amd64
imagePullPolicy: Always
command:
- /bin/edgetpu-device-plugin
Expand Down
4 changes: 2 additions & 2 deletions edgetpu-device-plugin.arm32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ spec:
# This, along with the annotation above marks this pod as a critical add-on.
- key: CriticalAddonsOnly
operator: Exists
- key: kkohtaka.org/edgetpu
- key: revoman.org/edgetpu
operator: Exists
effect: NoSchedule
containers:
- name: edgetpu-device-plugin
image: quay.io/kkohtaka/edgetpu-device-plugin:arm32
image: quay.io/revoman/edgetpu-device-plugin:arm32
imagePullPolicy: Always
command:
- /bin/edgetpu-device-plugin
Expand Down
21 changes: 21 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module github.com/therevoman/edgetpu-device-plugin

go 1.16

require (
github.com/fsnotify/fsnotify v1.4.9
github.com/golang/protobuf v1.4.2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/grpc v1.27.0
k8s.io/klog v1.0.0
k8s.io/kubelet v0.18.19
)

replace (
k8s.io/api => k8s.io/api v0.18.19
k8s.io/apimachinery => k8s.io/apimachinery v0.18.19
k8s.io/client-go => k8s.io/client-go v0.18.19
k8s.io/component-base => k8s.io/component-base v0.18.19
k8s.io/kubernetes => k8s.io/kubernetes v1.18.19
)
Loading