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

vendor dependencies and speedup container build #264

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ $(BINGO): $(BINGO_DIR)/bingo.mod
@echo "(re)installing $(GOBIN)/bingo-v0.5.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.5.1 "github.com/bwplotka/bingo"

GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.43.0
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.47.2
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v1.43.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.43.0 "github.com/golangci/golangci-lint/cmd/golangci-lint"
@echo "(re)installing $(GOBIN)/golangci-lint-v1.47.2"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.47.2 "github.com/golangci/golangci-lint/cmd/golangci-lint"

JB := $(GOBIN)/jb-v0.4.0
$(JB): $(BINGO_DIR)/jb.mod
Expand Down
2 changes: 1 addition & 1 deletion .bingo/golangci-lint.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.16

require github.com/golangci/golangci-lint v1.43.0 // cmd/golangci-lint
require github.com/golangci/golangci-lint v1.47.2 // cmd/golangci-lint
2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BENCHSTAT="${GOBIN}/benchstat-v0.0.0-20211012211434-03971e389cd3"

BINGO="${GOBIN}/bingo-v0.5.1"

GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.43.0"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.47.2"

JB="${GOBIN}/jb-v0.4.0"

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/flowlogs-pipeline
/confgenerator
/bin/
/vendor/

7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,19 @@ validate_go:

.PHONY: validate_go lint
lint: $(GOLANGCI_LINT) ## Lint the code
@go mod vendor
@current_ver=$$(go version | { read _ _ v _; echo $${v#go}; }); \
if [[ "$$current_ver" == *"1.18"* ]]; then echo "Linting is not fully supported for golang 1.18. Consider using golang 1.17";\
$(GOLANGCI_LINT) run --disable-all --enable goimports --enable gofmt --enable ineffassign --timeout 5m; else \
$(GOLANGCI_LINT) run --enable goimports --timeout 5m; \
fi

.PHONY: build_code
build_code: validate_go lint
@go mod vendor
build_code:
go build -ldflags "-X 'main.BuildVersion=$(BUILD_VERSION)' -X 'main.BuildDate=$(BUILD_DATE)'" "${CMD_DIR}${FLP_BIN_FILE}"
go build -ldflags "-X 'main.BuildVersion=$(BUILD_VERSION)' -X 'main.BuildDate=$(BUILD_DATE)'" "${CMD_DIR}${CG_BIN_FILE}"

.PHONY: build
build: build_code docs ## Build flowlogs-pipeline executable and update the docs
build: validate_go lint build_code docs ## Build flowlogs-pipeline executable and update the docs

# Note: To change dashboards, change `dashboards.jsonnet`. Do not change manually `dashboards.json`
.PHONY: dashboards
Expand Down Expand Up @@ -297,7 +295,6 @@ ocp-cleanup: undeploy undeploy-loki undeploy-prometheus undeploy-grafana ## Unde
dev-local-deploy: ## Deploy locally with simulated netflows
-pkill --oldest --full "${FLP_BIN_FILE}"
-pkill --oldest --full "${NETFLOW_GENERATOR}"
@go mod vendor
go build "${CMD_DIR}${FLP_BIN_FILE}"
go build "${CMD_DIR}${CG_BIN_FILE}"
./${CG_BIN_FILE} --log-level debug --srcFolder network_definitions \
Expand Down
11 changes: 5 additions & 6 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ WORKDIR /app
# Copy source code
COPY go.mod .
COPY go.sum .
COPY Makefile .
COPY .bingo/ .bingo/
COPY vendor/ vendor/
COPY .git/ .git/
COPY cmd/ cmd/
COPY pkg/ pkg/

# Download modules
RUN go mod download
RUN go mod download -modfile=.bingo/golangci-lint.mod

COPY . ./
RUN rm -rf bin
RUN git status --porcelain
RUN make build_code

Expand Down
28 changes: 28 additions & 0 deletions vendor/github.com/Knetic/govaluate/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vendor/github.com/Knetic/govaluate/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions vendor/github.com/Knetic/govaluate/CONTRIBUTORS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading