Skip to content

Commit b5ab6c7

Browse files
authored
feat: Create initial structure of Feast Go Operator (#4596)
* init feast-operator Signed-off-by: Tommy Hughes <tohughes@redhat.com> * add featurestore api Signed-off-by: Tommy Hughes <tohughes@redhat.com> * add spec.feastProject field Signed-off-by: Tommy Hughes <tohughes@redhat.com> * add bundle files Signed-off-by: Tommy Hughes <tohughes@redhat.com> * modify release and versioning scripts Signed-off-by: Tommy Hughes <tohughes@redhat.com> * add validation to feastProject field Signed-off-by: Tommy Hughes <tohughes@redhat.com> * add operator to Makefile Signed-off-by: Tommy Hughes <tohughes@redhat.com> * fixes Signed-off-by: Tommy Hughes <tohughes@redhat.com> --------- Signed-off-by: Tommy Hughes <tohughes@redhat.com>
1 parent 704fff6 commit b5ab6c7

File tree

64 files changed

+3472
-1
lines changed

Some content is hidden

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

64 files changed

+3472
-1
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
needs: [get-version, publish-python-sdk]
5050
strategy:
5151
matrix:
52-
component: [feature-server, feature-server-java, feature-transformation-server, feast-helm-operator]
52+
component: [feature-server, feature-server-java, feature-transformation-server, feast-helm-operator, feast-operator]
5353
env:
5454
MAVEN_CACHE: gs://feast-templocation-kf-feast/.m2.2020-08-19.tar
5555
REGISTRY: feastdev

.releaserc.js

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module.exports = {
6767
"java/pom.xml",
6868
"infra/charts/**/*.*",
6969
"infra/feast-helm-operator/**/*",
70+
"infra/feast-operator/**/*",
7071
"ui/package.json",
7172
"sdk/python/feast/ui/package.json",
7273
"sdk/python/feast/ui/yarn.lock"

Makefile

+12
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,18 @@ build-feast-helm-operator-docker:
442442
VERSION=$(VERSION) \
443443
$(MAKE) docker-build
444444

445+
push-feast-operator-docker:
446+
cd infra/feast-operator && \
447+
IMAGE_TAG_BASE=$(REGISTRY)/feast-operator \
448+
VERSION=$(VERSION) \
449+
$(MAKE) docker-push
450+
451+
build-feast-operator-docker:
452+
cd infra/feast-operator && \
453+
IMAGE_TAG_BASE=$(REGISTRY)/feast-operator \
454+
VERSION=$(VERSION) \
455+
$(MAKE) docker-build
456+
445457
# Dev images
446458

447459
build-feature-server-dev:

infra/feast-operator/.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2+
# Ignore build and test binaries.
3+
bin/

infra/feast-operator/.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
bin/*
8+
Dockerfile.cross
9+
10+
# Test binary, built with `go test -c`
11+
*.test
12+
13+
# Output of the go coverage tool, specifically when used with LiteIDE
14+
*.out
15+
16+
# Go workspace file
17+
go.work
18+
19+
# Kubernetes Generated files - skip generated files, except for vendored files
20+
!vendor/**/zz_generated.*
21+
22+
# editor and IDE paraphernalia
23+
.idea
24+
.vscode
25+
*.swp
26+
*.swo
27+
*~
28+
29+
# Installer file generated by Kustomize - skip 'dist/' directories within the Feast project except this one.
30+
!dist/

infra/feast-operator/.golangci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
run:
2+
timeout: 5m
3+
allow-parallel-runners: true
4+
5+
issues:
6+
# don't skip warning about doc comments
7+
# don't exclude the default set of lint
8+
exclude-use-default: false
9+
# restore some of the defaults
10+
# (fill in the rest as needed)
11+
exclude-rules:
12+
- path: "api/*"
13+
linters:
14+
- lll
15+
- path: "internal/*"
16+
linters:
17+
- dupl
18+
- lll
19+
linters:
20+
disable-all: true
21+
enable:
22+
- dupl
23+
- errcheck
24+
- exportloopref
25+
- goconst
26+
- gocyclo
27+
- gofmt
28+
- goimports
29+
- gosimple
30+
- govet
31+
- ineffassign
32+
- lll
33+
- misspell
34+
- nakedret
35+
- prealloc
36+
- staticcheck
37+
- typecheck
38+
- unconvert
39+
- unparam
40+
- unused

infra/feast-operator/Dockerfile

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Build the manager binary
2+
FROM golang:1.21 AS builder
3+
ARG TARGETOS
4+
ARG TARGETARCH
5+
6+
WORKDIR /workspace
7+
# Copy the Go Modules manifests
8+
COPY go.mod go.mod
9+
COPY go.sum go.sum
10+
# cache deps before building and copying source so that we don't need to re-download as much
11+
# and so that source changes don't invalidate our downloaded layer
12+
RUN go mod download
13+
14+
# Copy the go source
15+
COPY cmd/main.go cmd/main.go
16+
COPY api/ api/
17+
COPY internal/controller/ internal/controller/
18+
19+
# Build
20+
# the GOARCH has not a default value to allow the binary be built according to the host where the command
21+
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
22+
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
23+
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
24+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
25+
26+
# Use distroless as minimal base image to package the manager binary
27+
# Refer to https://github.com/GoogleContainerTools/distroless for more details
28+
FROM gcr.io/distroless/static:nonroot
29+
WORKDIR /
30+
COPY --from=builder /workspace/manager .
31+
USER 65532:65532
32+
33+
ENTRYPOINT ["/manager"]

0 commit comments

Comments
 (0)