Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): cli as k8s deployment for debugging #6090

Merged
merged 42 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a3d7081
use ssl constant
sakoush Nov 21, 2024
12f7018
move oauth config to tls pkg
sakoush Nov 21, 2024
a627f2b
use tls module in cli
sakoush Nov 21, 2024
a4ce972
get cli to use tls package
sakoush Nov 21, 2024
ea9831c
adjust docs for changes to cli
sakoush Nov 22, 2024
3f9a1ff
add dockerfile for cli
sakoush Nov 22, 2024
bbae638
tidy up dockerfile for operator
sakoush Nov 22, 2024
9e0a28e
add kafka broker certs
sakoush Nov 22, 2024
70d254a
add makefile targets for deploy / undeploy cli
sakoush Nov 22, 2024
12c96d7
set scheduler port from existing envar
sakoush Nov 22, 2024
37b4a49
add kafka config component
sakoush Nov 22, 2024
72bed80
delete redundant kafka config sub package
sakoush Nov 22, 2024
a244a7b
use component kafka config
sakoush Nov 22, 2024
9bbb154
add dependabot for component kafka
sakoush Nov 22, 2024
88df4b0
add gh test for components (kafka and tls)
sakoush Nov 22, 2024
1a59250
build licenses for component kafka
sakoush Nov 22, 2024
3e3eb07
lint
sakoush Nov 22, 2024
1468a39
update license for component kafka
sakoush Nov 22, 2024
41dfd82
add docker push seldon cli
sakoush Nov 22, 2024
548ee2d
fix typo
sakoush Nov 22, 2024
5c2bcf5
refactor utility func to kafka component
sakoush Nov 25, 2024
10089b0
refactor consumer config into a separate func
sakoush Nov 25, 2024
4b5f7b3
refactor more logic into utility
sakoush Nov 25, 2024
ac806d4
use kafka config map in cli
sakoush Nov 25, 2024
9d66437
wire up kafka config to seldon-cli path
sakoush Nov 25, 2024
da07cd2
deal with kafka values as strings
sakoush Nov 25, 2024
52dc0be
fix envar
sakoush Nov 25, 2024
121cb47
remove print message
sakoush Nov 25, 2024
7ac8b79
build cli docker image as part of ci
sakoush Nov 25, 2024
7900982
add helper shell script
sakoush Nov 25, 2024
64d2941
add description
sakoush Nov 25, 2024
04e59d7
add copyright
sakoush Nov 25, 2024
26a748d
fix lint
sakoush Nov 25, 2024
5bc2015
go mod tidy hodometer
sakoush Nov 25, 2024
b90962b
add force flag for control plane load / unload
sakoush Nov 26, 2024
e1f5db9
add default for force in msg
sakoush Nov 26, 2024
87c62aa
add k6 image building to CI
sakoush Nov 26, 2024
3f83b10
add k8s in warning
sakoush Nov 26, 2024
95a4f74
Update docs
sakoush Nov 26, 2024
1ae294d
set user in cli docker image
sakoush Nov 27, 2024
46305c6
PR comments
sakoush Nov 27, 2024
69ad889
update readme
sakoush Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ updates:
- "dependencies"
reviewers:
- sakoush

- package-ecosystem: "gomod"
directory: "/components/kafka"
target-branch: "v2"
schedule:
interval: "weekly"
labels:
- "v2"
- "dependencies"
reviewers:
- sakoush

- package-ecosystem: "gradle"
directory: "/scheduler/data-flow"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,18 @@ jobs:
working-directory: ./operator
run: CUSTOM_IMAGE_TAG=${{ steps.docker-tag.outputs.value }} make docker-build docker-push

- name: Push Docker Image for Seldon Cli
working-directory: ./operator
run: CUSTOM_IMAGE_TAG=${{ steps.docker-tag.outputs.value }} make docker-build-cli docker-push-cli

- name: Push Docker Images for Scheduler
working-directory: ./scheduler
run: CUSTOM_IMAGE_TAG=${{ steps.docker-tag.outputs.value }} make docker-build-all docker-push-all

- name: Push Docker Images for Hodometer
working-directory: ./hodometer
run: BUILD_VERSION=${{ steps.docker-tag.outputs.value }} IMAGE_TAG=${{ steps.docker-tag.outputs.value }} make build-hodometer-docker push-hodometer-docker

- name: Push Docker Image for k6 Load Testing
working-directory: ./tests/k6
run: CUSTOM_IMAGE_TAG=${{ steps.docker-tag.outputs.value }} make docker-build docker-push
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ jobs:
run: make -C scheduler test
- name: test-hodometer
run: make -C hodometer test
- name: test-components-tls
run: make -C components/tls test
- name: test-components-kafka
run: make -C components/kafka test
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ update-3rd-party-licenses:
make -C operator licenses
make -C hodometer licenses
make -C components/tls licenses
make -C components/kafka licenses
make -C tests/integration licenses
make -C scheduler/data-flow licenses
{ (cat scheduler/licenses/license_info.csv operator/licenses/license_info.csv hodometer/licenses/license_info.csv components/tls/licenses/license_info.csv tests/integration/licenses/license_info.csv | cut -d, -f3) ; (cat scheduler/data-flow/licenses/dependency-license.json | jq .dependencies[].licenses[0].name) } | sed 's/\"//g' | sort | uniq -c > licenses/3rd-party-summary.txt
{ (cat scheduler/licenses/license_info.csv operator/licenses/license_info.csv hodometer/licenses/license_info.csv components/tls/licenses/license_info.csv components/kafka/licenses/license_info.csv tests/integration/licenses/license_info.csv | cut -d, -f3) ; (cat scheduler/data-flow/licenses/dependency-license.json | jq .dependencies[].licenses[0].name) } | sed 's/\"//g' | sort | uniq -c > licenses/3rd-party-summary.txt

docs-gitbook-update-code-references:
python hack/update_references.py
2 changes: 2 additions & 0 deletions components/kafka/.errcheck_excludes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fmt.Fprintln
fmt.Fprint
1 change: 1 addition & 0 deletions components/kafka/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cover.out
53 changes: 53 additions & 0 deletions components/kafka/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# options for analysis running
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 5m

# exit code when at least one issue was found, default is 1
issues-exit-code: 1

# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs: vendor

# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true

# print linter name in the end of issue text, default is true
print-linter-name: true

linters:
disable-all: true
enable:
# Sorted alphabetically.
- errcheck
- exportloopref
- gci
- goimports # Also includes gofmt style formatting
- gosimple
- govet
- misspell
- staticcheck
- structcheck
- typecheck
- varcheck

linters-settings:
errcheck:
exclude: ./.errcheck_excludes.txt
gci:
sections:
- standard
- default
- prefix(github.com/seldonio/seldon-core)
- prefix(github.com/seldonio/seldon-core/components/tls)
goconst:
min-occurrences: 5
38 changes: 38 additions & 0 deletions components/kafka/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
GO_LDFLAGS := -w $(patsubst %,-X %, $(GO_BUILD_VARS))

.PHONY: test
test:
go test ./pkg/... -coverprofile cover.out

.GOLANGCILINT_VERSION := v1.57.2
sakoush marked this conversation as resolved.
Show resolved Hide resolved
.GOLANGCILINT_PATH := $(shell go env GOPATH)/bin/golangci-lint/$(.GOLANGCILINT_VERSION)

${.GOLANGCILINT_PATH}/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b ${.GOLANGCILINT_PATH} ${.GOLANGCILINT_VERSION}

.PHONY: lint
lint: ${.GOLANGCILINT_PATH}/golangci-lint
gofmt -w pkg
${.GOLANGCILINT_PATH}/golangci-lint run --fix

.PHONY: build
build: test
go build -trimpath -ldflags="-w" ./pkg/...

.PHONY: licenses/dep.txt
licenses/dep.txt:
go list -m all | cut -d ' ' -f 1 > licenses/dep.txt

.PHONY: licenses
licenses: licenses/dep.txt
# NOTE: You need to create a file in ~/.github_api_token with a GitHub token.
get-github-repo \
-o licenses/repo.txt \
--manual-dep-repo-mapping ../../licenses/dep_repo.manual.csv \
licenses/dep.txt
get-github-license-info -o licenses/license_info.csv licenses/repo.txt --branch-refs ../../licenses/branch_refs.manual.csv
python -m 'patch_additional_license_info' \
licenses/license_info.csv \
../../licenses/additional_license_info.csv
concatenate-license -o licenses/license.txt licenses/license_info.csv
17 changes: 17 additions & 0 deletions components/kafka/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module github.com/seldonio/seldon-core/components/kafka/v2

go 1.22.7

toolchain go1.22.9

require (
github.com/confluentinc/confluent-kafka-go/v2 v2.6.1
github.com/onsi/gomega v1.35.1
)

require (
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/text v0.19.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
13 changes: 13 additions & 0 deletions components/kafka/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
github.com/confluentinc/confluent-kafka-go/v2 v2.6.1 h1:XFkytnGvk/ZcY2qU0ql4E4h+ftBaGqkLO7tlZ4kRbr4=
github.com/confluentinc/confluent-kafka-go/v2 v2.6.1/go.mod h1:hScqtFIGUI1wqHIgM3mjoqEou4VweGGGX7dMpcUKves=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading
Loading