diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index 690d326ef7..ef83a6b70e 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -23,11 +23,11 @@ $(ALERTMANAGER): $(BINGO_DIR)/alertmanager.mod @echo "(re)installing $(GOBIN)/alertmanager-v0.20.0" @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=alertmanager.mod -o=$(GOBIN)/alertmanager-v0.20.0 "github.com/prometheus/alertmanager/cmd/alertmanager" -BINGO := $(GOBIN)/bingo-v0.4.3 +BINGO := $(GOBIN)/bingo-v0.5.2 $(BINGO): $(BINGO_DIR)/bingo.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)/bingo-v0.4.3" - @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.4.3 "github.com/bwplotka/bingo" + @echo "(re)installing $(GOBIN)/bingo-v0.5.2" + @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.5.2 "github.com/bwplotka/bingo" FAILLINT := $(GOBIN)/faillint-v1.8.0 $(FAILLINT): $(BINGO_DIR)/faillint.mod @@ -59,6 +59,12 @@ $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod @echo "(re)installing $(GOBIN)/golangci-lint-v1.39.1-0.20210330125642-6844f6abf817" @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.39.1-0.20210330125642-6844f6abf817 "github.com/golangci/golangci-lint/cmd/golangci-lint" +GOTESPLIT := $(GOBIN)/gotesplit-v0.1.2 +$(GOTESPLIT): $(BINGO_DIR)/gotesplit.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)/gotesplit-v0.1.2" + @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=gotesplit.mod -o=$(GOBIN)/gotesplit-v0.1.2 "github.com/Songmu/gotesplit/cmd/gotesplit" + HUGO := $(GOBIN)/hugo-v0.80.0 $(HUGO): $(BINGO_DIR)/hugo.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. diff --git a/.bingo/bingo.mod b/.bingo/bingo.mod index 0ef4a501e2..a9e1e6919f 100644 --- a/.bingo/bingo.mod +++ b/.bingo/bingo.mod @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT go 1.14 -require github.com/bwplotka/bingo v0.4.3 +require github.com/bwplotka/bingo v0.5.2 diff --git a/.bingo/gotesplit.mod b/.bingo/gotesplit.mod new file mode 100644 index 0000000000..2b84d2d23f --- /dev/null +++ b/.bingo/gotesplit.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.17 + +require github.com/Songmu/gotesplit v0.1.2 // cmd/gotesplit diff --git a/.bingo/variables.env b/.bingo/variables.env index c6f9a9f49e..0efc1f7b3e 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -10,7 +10,7 @@ fi ALERTMANAGER="${GOBIN}/alertmanager-v0.20.0" -BINGO="${GOBIN}/bingo-v0.4.3" +BINGO="${GOBIN}/bingo-v0.5.2" FAILLINT="${GOBIN}/faillint-v1.8.0" @@ -22,6 +22,8 @@ GOJSONTOYAML="${GOBIN}/gojsontoyaml-v0.0.0-20191212081931-bf2969bbd742" GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.39.1-0.20210330125642-6844f6abf817" +GOTESPLIT="${GOBIN}/gotesplit-v0.1.2" + HUGO="${GOBIN}/hugo-v0.80.0" JB="${GOBIN}/jb-v0.4.0" diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 6e9d95b658..a51b52dea7 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -55,6 +55,11 @@ jobs: - name: Linting & vetting. run: make go-lint e2e: + strategy: + fail-fast: true + matrix: + parallelism: [4] + index: [0,1,2,3] runs-on: ubuntu-latest name: Thanos end-to-end tests env: @@ -74,4 +79,4 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Run e2e docker-based tests. - run: make test-e2e + run: make test-e2e GH_PARALLEL=${{ matrix.parallelism }} GH_INDEX=${{ matrix.index }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 71cd969c87..1036b3fda8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#4970](https://github.com/thanos-io/thanos/pull/4970) Added a new flag `exclude-delete` to `tools bucket ls`, which excludes blocks marked for deletion. ### Added - +- [#4977](https://github.com/thanos-io/thanos/pull/4977) Build: Upgrade to `bingo v0.5.2` and implements `gotesplit` to allow for parallelism in our GitHub e2e tests. - [#4228](https://github.com/thanos-io/thanos/pull/4228) Tools `thanos bucket inspect`: Add flag `--output` to provide output method (table,csv,tsv). - [#4680](https://github.com/thanos-io/thanos/pull/4680) Query: add `exemplar.partial-response` flag to control partial response. - [#4679](https://github.com/thanos-io/thanos/pull/4679) Added `enable-feature` flag to enable negative offsets and @ modifier, similar to Prometheus. diff --git a/Makefile b/Makefile index 1248e75a1b..dd6fe675b1 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ DOCKER_IMAGE_REPO ?= quay.io/thanos/thanos DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))-$(shell date +%Y-%m-%d)-$(shell git rev-parse --short HEAD) DOCKER_CI_TAG ?= test +GH_PARALLEL ?= 1 +GH_INDEX ?= 0 + BASE_DOCKER_SHA='' arch = $(shell uname -m) # Run `DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect quay.io/prometheus/busybox:latest` to get SHA or @@ -276,15 +279,15 @@ test-local: .PHONY: test-e2e test-e2e: ## Runs all Thanos e2e docker-based e2e tests from test/e2e. Required access to docker daemon. -test-e2e: docker +test-e2e: docker $(GOTESPLIT) @echo ">> cleaning docker environment." @docker system prune -f --volumes @echo ">> cleaning e2e test garbage." @rm -rf ./test/e2e/e2e_* @echo ">> running /test/e2e tests." # NOTE(bwplotka): - # * If you see errors on CI (timeouts), but not locally, try to add -parallel 1 to limit to single CPU to reproduce small 1CPU machine. - @go test $(GOTEST_OPTS) ./test/e2e/... + # * If you see errors on CI (timeouts), but not locally, try to add -parallel 1 (Wiard note: to the GOTEST_OPTS arg) to limit to single CPU to reproduce small 1CPU machine. + @$(GOTESPLIT) -total ${GH_PARALLEL} -index ${GH_INDEX} ./test/e2e/... -- ${GOTEST_OPTS} .PHONY: test-e2e-local test-e2e-local: ## Runs all thanos e2e tests locally.