Skip to content

Commit 66bb874

Browse files
committed
Migrate project to use latest operator-sdk(v1.0+) and kubebuilder style layout
Signed-off-by: Shiva Krishna, Merla <[email protected]>
1 parent 5a10b47 commit 66bb874

File tree

93 files changed

+15588
-16099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+15588
-16099
lines changed

.common-ci.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ helm-lint:
4949
go-lint:
5050
stage: lint
5151
allow_failure: true
52-
image: golang:1.13
52+
image: golang:1.15
5353
services:
5454
- docker:stable-dind
5555
script:
@@ -59,7 +59,7 @@ go-lint:
5959
go-fmt:
6060
stage: lint
6161
allow_failure: true
62-
image: golang:1.13
62+
image: golang:1.15
6363
services:
6464
- docker:stable-dind
6565
script:
@@ -68,15 +68,15 @@ go-fmt:
6868
ineffassign:
6969
stage: lint
7070
allow_failure: true
71-
image: golang:1.13
71+
image: golang:1.15
7272
script:
7373
- GO111MODULE=off go get -u github.com/gordonklaus/ineffassign
7474
- make assign
7575

7676
misspell:
7777
stage: lint
7878
allow_failure: true
79-
image: golang:1.13
79+
image: golang:1.15
8080
script:
8181
- GO111MODULE=off go get -u github.com/client9/misspell/cmd/misspell
8282
- make misspell
@@ -91,7 +91,7 @@ build-image:
9191
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
9292
- apk add --update make
9393

94-
- make prod-image IMAGE=$CI_REGISTRY_IMAGE TAG=$VERSION
94+
- make docker-build IMG=$CI_REGISTRY_IMAGE:$VERSION
9595
- docker push "$CI_REGISTRY_IMAGE:$VERSION"
9696

9797
unit-tests:
@@ -102,8 +102,8 @@ unit-tests:
102102

103103
script:
104104
- apk add --update make
105-
- make devel-image IMAGE=nvidia/gpu-operator TAG_DEVEL=devel
106-
- docker run -t nvidia/gpu-operator:devel make test
105+
- make devel-image IMG=nvidia/gpu-operator:devel
106+
- docker run -t nvidia/gpu-operator:devel make unit-test
107107
dependencies:
108108
- build-image
109109

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2+
# Ignore all files which are not go type
3+
!**/*.go
4+
!**/*.mod
5+
!**/*.sum

.gitignore

+23-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
cover.out
2-
/gpu-operator
3-
build/_output/
1+
2+
# Binaries for programs and plugins
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
bin
9+
testbin/*
10+
11+
# Test binary, build with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Kubernetes Generated files - skip generated files, except for vendored files
18+
19+
!vendor/**/zz_generated.*
20+
21+
# editor and IDE paraphernalia
22+
.idea
423
*.swp
524
*.swo
25+
*~

.osdk-scorecard.yaml

-19
This file was deleted.

CONTRIBUTING.md

-151
This file was deleted.

Dockerfile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Build the manager binary
2+
FROM golang:1.15 as builder
3+
4+
WORKDIR /workspace
5+
# Copy the Go Modules manifests
6+
COPY go.mod go.mod
7+
COPY go.sum go.sum
8+
# cache deps before building and copying source so that we don't need to re-download as much
9+
# and so that source changes don't invalidate our downloaded layer
10+
RUN go mod download
11+
12+
# Copy the go source
13+
COPY main.go main.go
14+
COPY api/ api/
15+
COPY controllers/ controllers/
16+
17+
# Build
18+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o gpu-operator main.go
19+
20+
FROM nvidia/cuda:11.2.1-base-ubi8
21+
22+
ENV NVIDIA_DISABLE_REQUIRE="true"
23+
ENV NVIDIA_VISIBLE_DEVICES=all
24+
ENV NVIDIA_DRIVER_CAPABILITIES=utility
25+
26+
ARG VERSION
27+
28+
LABEL io.k8s.display-name="NVIDIA GPU Operator"
29+
LABEL name="NVIDIA GPU Operator"
30+
LABEL vendor="NVIDIA"
31+
LABEL version="${VERSION}"
32+
LABEL release="N/A"
33+
LABEL summary="Automate the management and monitoring of NVIDIA GPUs."
34+
LABEL description="See summary"
35+
36+
WORKDIR /
37+
COPY --from=builder /workspace/gpu-operator /usr/bin/
38+
39+
RUN mkdir -p /opt/gpu-operator
40+
COPY assets /opt/gpu-operator/
41+
COPY ./LICENSE /licenses/LICENSE
42+
43+
RUN useradd gpu-operator
44+
USER gpu-operator
45+
46+
ENTRYPOINT ["/usr/bin/gpu-operator"]

docker/Dockerfile.devel Dockerfile.devel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.13 AS builder
1+
FROM golang:1.15 AS builder
22
WORKDIR /go/src/github.com/NVIDIA/gpu-operator
33

44
RUN go get -u golang.org/x/lint/golint && \

0 commit comments

Comments
 (0)