Skip to content

Commit

Permalink
Merge pull request #5 from hzxuzhonghu/rename
Browse files Browse the repository at this point in the history
rename binary and images
  • Loading branch information
k82cn authored Jul 5, 2020
2 parents 6dfb21b + fed235b commit 473e02d
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 23 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ VERSION ?= 1.0.0
all: ubuntu16.04 centos7

push:
$(DOCKER) push "$(REGISTRY)/k8s-device-plugin:$(VERSION)-ubuntu16.04"
$(DOCKER) push "$(REGISTRY)/k8s-device-plugin:$(VERSION)-centos7"
$(DOCKER) push "$(REGISTRY)/volcano-device-plugin:$(VERSION)-ubuntu16.04"
$(DOCKER) push "$(REGISTRY)/volcano-device-plugin:$(VERSION)-centos7"

push-short:
$(DOCKER) tag "$(REGISTRY)/k8s-device-plugin:$(VERSION)-ubuntu16.04" "$(REGISTRY)/k8s-device-plugin:$(VERSION)"
$(DOCKER) push "$(REGISTRY)/k8s-device-plugin:$(VERSION)"
$(DOCKER) tag "$(REGISTRY)/volcano-device-plugin:$(VERSION)-ubuntu16.04" "$(REGISTRY)/volcano-device-plugin:$(VERSION)"
$(DOCKER) push "$(REGISTRY)/volcano-device-plugin:$(VERSION)"

push-latest:
$(DOCKER) tag "$(REGISTRY)/k8s-device-plugin:$(VERSION)-ubuntu16.04" "$(REGISTRY)/k8s-device-plugin:latest"
$(DOCKER) push "$(REGISTRY)/k8s-device-plugin:latest"
$(DOCKER) tag "$(REGISTRY)/volcano-device-plugin:$(VERSION)-ubuntu16.04" "$(REGISTRY)/volcano-device-plugin:latest"
$(DOCKER) push "$(REGISTRY)/volcano-device-plugin:latest"

ubuntu16.04:
$(DOCKER) build --pull \
--tag $(REGISTRY)/k8s-device-plugin:$(VERSION)-ubuntu16.04 \
--tag $(REGISTRY)/volcano-device-plugin:$(VERSION)-ubuntu16.04 \
--file docker/amd64/Dockerfile.ubuntu16.04 .

centos7:
$(DOCKER) build --pull \
--tag $(REGISTRY)/k8s-device-plugin:$(VERSION)-centos7 \
--tag $(REGISTRY)/volcano-device-plugin:$(VERSION)-centos7 \
--file docker/amd64/Dockerfile.centos7 .

include Makefile.def
Expand All @@ -60,4 +60,4 @@ init:

gen_bin: init
go get github.com/mitchellh/gox
CGO_ENABLED=1 gox -osarch=${REL_OSARCH} -ldflags ${LD_FLAGS} -output ${BIN_DIR}/${REL_OSARCH}/k8s-device-plugin ./
CGO_ENABLED=1 gox -osarch=${REL_OSARCH} -ldflags ${LD_FLAGS} -output ${BIN_DIR}/${REL_OSARCH}/volcano-device-plugin ./
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ kind: Pod
metadata:
name: gpu-pod1
spec:
schedulerName: volcano
containers:
- name: cuda-container
image: nvidia/cuda:9.0-devel
Expand All @@ -97,6 +98,7 @@ kind: Pod
metadata:
name: gpu-pod2
spec:
schedulerName: volcano
containers:
- name: cuda-container
image: nvidia/cuda:9.0-devel
Expand Down Expand Up @@ -140,7 +142,7 @@ $ kubectl create -f nvidia-device-plugin.yml
# Issues and Contributing
[Checkout the Contributing document!](CONTRIBUTING.md)

* You can report a bug by [filing a new issue](https://github.com/volcano-sh/k8s-device-plugin/issues/new)
* You can report a bug by [filing a new issue](https://github.com/volcano-sh/devices)
* You can contribute by opening a [pull request](https://help.github.com/articles/using-pull-requests/)

## Versioning
Expand Down
8 changes: 4 additions & 4 deletions docker/amd64/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ RUN wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linu
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

WORKDIR /go/src/volcano.sh/k8s-device-plugin
WORKDIR /go/src/volcano.sh/devices
COPY . .

RUN export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
go build -ldflags="-s -w"
go build -ldflags="-s -w" -o volcano-device-plugin


FROM centos:7

ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=utility

COPY --from=build /go/bin/k8s-device-plugin /usr/bin/k8s-device-plugin
COPY --from=build /go/src/volcano.sh/devices/volcano-device-plugin /usr/bin/volcano-device-plugin

ENTRYPOINT ["k8s-device-plugin"]
ENTRYPOINT ["volcano-device-plugin"]
8 changes: 4 additions & 4 deletions docker/amd64/Dockerfile.ubuntu16.04
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ RUN wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linu
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

WORKDIR /go/src/volcano.sh/k8s-device-plugin
WORKDIR /go/src/volcano.sh/devices
COPY . .

RUN export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
go build -ldflags="-s -w"
go build -ldflags="-s -w" -o volcano-device-plugin


FROM debian:stretch-slim

ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=utility

COPY --from=build /go/src/volcano.sh/k8s-device-plugin/k8s-device-plugin /usr/bin/k8s-device-plugin
COPY --from=build /go/src/volcano.sh/devices/volcano-device-plugin /usr/bin/volcano-device-plugin

ENTRYPOINT ["k8s-device-plugin"]
ENTRYPOINT ["volcano-device-plugin"]
1 change: 1 addition & 0 deletions pod1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: pod1
spec:
restartPolicy: OnFailure
schedulerName: volcano
containers:
- image: nvidia/cuda:10.1-base-ubuntu18.04
name: pod1-ctr
Expand Down
46 changes: 41 additions & 5 deletions volcano-device-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,50 @@
# See the License for the specific language governing permissions and
# limitations under the License.

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: volcano-device-plugin
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: volcano-device-plugin
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get"]
- apiGroups: [""]
resources: ["nodes/status"]
verbs: ["patch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: volcano-device-plugin
subjects:
- kind: ServiceAccount
name: volcano-device-plugin
namespace: kube-system
roleRef:
kind: ClusterRole
name: volcano-device-plugin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nvidia-device-plugin-daemonset
name: volcano-device-plugin
namespace: kube-system
spec:
selector:
matchLabels:
name: nvidia-device-plugin-ds
name: volcano-device-plugin
updateStrategy:
type: RollingUpdate
template:
Expand All @@ -30,7 +65,7 @@ spec:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
labels:
name: nvidia-device-plugin-ds
name: volcano-device-plugin
spec:
tolerations:
# This toleration is deprecated. Kept here for backward compatibility
Expand All @@ -45,9 +80,10 @@ spec:
# be rescheduled after a failure.
# See https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/
priorityClassName: "system-node-critical"
serviceAccount: volcano-device-plugin
containers:
- image: nvidia/k8s-device-plugin:latest
name: nvidia-device-plugin-ctr
- image: volcanosh/volcano-device-plugin:latest
name: volcano-device-plugin
env:
- name: NODE_NAME
valueFrom:
Expand Down

0 comments on commit 473e02d

Please sign in to comment.