Skip to content

Commit 714ebeb

Browse files
CR-19527-add-metrics (#364)
* added taskQueue * expose qps and burst to cli * added k8s metrics * updated version to `1.10.0` * updated to golang `1.21` * updated mockery to `2.33.`` * updated venona-tester image to `1.21` * replaced golint with golangci-lint `1.54.2` * removed unused pipelines (the real ones are coming from `codefresh-io/pipelines` repository under `classic-runtime`) --------- Co-authored-by: danielm-codefresh <[email protected]>
1 parent a2e20f4 commit 714ebeb

Some content is hidden

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

42 files changed

+2459
-1850
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,7 @@ venona/venona
4242
**/*.tgz
4343
**/charts/**/charts
4444
**/dry-run.yaml
45-
**/values-dev.yaml
45+
**/values-dev.yaml
46+
47+
# coverage
48+
**/cover

venona/.mockery.boilerplate

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2023 The Codefresh Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.

venona/.mockery.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
boilerplate-file: ".mockery.boilerplate"
2+
dir: "{{.InterfaceDirRelative}}"
3+
filename: "{{.PackageName}}_mock.go"
4+
inpackage: true
5+
with-expecter: true
6+
packages:
7+
github.com/codefresh-io/go/venona/pkg/codefresh:
8+
interfaces:
9+
Codefresh: {}
10+
github.com/codefresh-io/go/venona/pkg/kubernetes:
11+
interfaces:
12+
Kubernetes: {}
13+
github.com/codefresh-io/go/venona/pkg/logger:
14+
interfaces:
15+
Logger: {}
16+
github.com/codefresh-io/go/venona/pkg/metrics:
17+
interfaces:
18+
Metrics: {}

venona/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.19-alpine3.17 as build
1+
FROM golang:1.21-alpine3.18 as build
22

33
RUN apk -U add --no-cache git make ca-certificates && update-ca-certificates
44

@@ -23,7 +23,7 @@ RUN go mod verify
2323
# compile
2424
RUN make build
2525

26-
FROM alpine:3.17
26+
FROM alpine:3.18
2727

2828
# copy ca-certs and user details
2929
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
@@ -40,4 +40,4 @@ USER venona:venona
4040

4141
ENTRYPOINT [ "venona" ]
4242

43-
CMD [ "start" ]
43+
CMD [ "start" ]

venona/Makefile

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
.PHONY: build
1+
ifndef GOBIN
2+
ifndef GOPATH
3+
$(error GOPATH is not set, please make sure you set your GOPATH correctly!)
4+
endif
5+
GOBIN=$(GOPATH)/bin
6+
ifndef GOBIN
7+
$(error GOBIN is not set, please make sure you set your GOBIN correctly!)
8+
endif
9+
endif
10+
11+
.PHONY: build
212
build:
313
@sh ./scripts/build.sh
414

@@ -35,8 +45,9 @@ gocyclo:
3545
@gocyclo -over 15 .
3646

3747
.PHONY: lint
38-
lint:
39-
@golint -set_exit_status ./...
48+
lint: $(GOBIN)/golangci-lint
49+
@echo linting go code...
50+
@$(GOBIN)/golangci-lint run --fix --timeout 10m
4051

4152
.PHONY: security-check
4253
security-check:
@@ -60,11 +71,18 @@ fmt:
6071
# Generate mock struct from interface
6172
# example: make mock PKG=./pkg/runtime NAME=Runtime
6273
.PHONY: mock
63-
mock:
64-
@sh ./scripts/mock.sh $(PKG) $(NAME)
74+
mock: $(GOBIN)/mockery
75+
@mockery
6576

66-
# Generate mock struct from interface
67-
# example: make mock PKG=./pkg/runtime NAME=Runtime
77+
# Runs cript to upload codecov coverage data
6878
.PHONY: upload-coverage
6979
upload-coverage:
7080
@./scripts/codecov.sh -t $(CODECOV_TOKEN)
81+
82+
$(GOBIN)/mockery:
83+
@go install github.com/vektra/mockery/[email protected]
84+
@mockery --version
85+
86+
$(GOBIN)/golangci-lint:
87+
@echo installing: golangci-lint
88+
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.54.2

venona/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Venona
22

3-
43
* venona - the agent process that is running on remote cluster
54
* cmd - entrypoints to the application
65
* pkg/agent - call Codefresh API every X ms to get new pipelines to run. Also, report status back to Codefresh

venona/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.17
1+
1.10.0

venona/build/Dockerfile.tester

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
FROM golang:1.19-alpine3.17 AS os
1+
# quay.io/codefresh/venona-tester
2+
FROM golang:1.21-alpine3.18
23

34
RUN apk -U add --no-cache ca-certificates git make gcc g++ bash && update-ca-certificates
4-
RUN go install github.com/client9/misspell/cmd/misspell@latest && \
5-
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest && \
6-
go install golang.org/x/lint/golint@latest && \
7-
go install github.com/securego/gosec/v2/cmd/gosec@latest && \
8-
go install github.com/google/addlicense@latest && \
9-
go install github.com/github/hub@latest
5+
RUN go install github.com/client9/misspell/cmd/[email protected] && \
6+
go install github.com/fzipp/gocyclo/cmd/[email protected] && \
7+
go install github.com/securego/gosec/v2/cmd/[email protected] && \
8+
go install github.com/google/[email protected] && \
9+
go install github.com/github/[email protected]+incompatible
1010

1111
RUN apk add curl
1212
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/master/contrib/install.sh | sh -s -- -b /usr/local/bin
13-
14-
# quay.io/codefresh/venona-tester

venona/build/arm-build.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)