diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b335bab3fd..9c9b951c96 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -14,7 +14,7 @@ steps: command: make clean install-vendor test-all-gen env: CGO_ENABLED: 0 - GIMME_GO_VERSION: 1.12.x + GIMME_GO_VERSION: 1.10.x plugins: gopath-checkout#v1.0.1: import: github.com/m3db/m3 @@ -46,7 +46,7 @@ steps: command: make clean install-vendor docker-integration-test env: CGO_ENABLED: 0 - GIMME_GO_VERSION: 1.12.x + GIMME_GO_VERSION: 1.10.x plugins: gopath-checkout#v1.0.1: import: github.com/m3db/m3 diff --git a/.ci b/.ci index 89e63c8e19..4cb3c72388 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 89e63c8e1992bb99e8f98cfe895840c95e4524ad +Subproject commit 4cb3c723883e69b50f1f259de1d2f5c4576ec186 diff --git a/Makefile b/Makefile index 994450d753..9d067c58ec 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ $(SELF_DIR)/.ci/common.mk: include $(SELF_DIR)/.ci/common.mk SHELL=/bin/bash -o pipefail -GOPATH=$(shell eval $$(go env | grep GOPATH) && echo $$GOPATH) auto_gen := scripts/auto-gen.sh process_coverfile := scripts/process-cover.sh @@ -17,7 +16,6 @@ m3_package := github.com/m3db/m3 m3_package_path := $(gopath_prefix)/$(m3_package) mockgen_package := github.com/golang/mock/mockgen retool_bin_path := $(m3_package_path)/_tools/bin -combined_bin_paths := $(retool_bin_path):$(gopath_bin_path) retool_src_prefix := $(m3_package_path)/_tools/src retool_package := github.com/twitchtv/retool metalint_check := .ci/metalint.sh @@ -269,7 +267,7 @@ ifeq ($(SUBDIR), kube) all-gen-kube: install-tools @echo "--- Generating kube bundle" @./kube/scripts/build_bundle.sh - find kube -name '*.yaml' -print0 | PATH=$(combined_bin_paths):$(PATH) xargs -0 kubeval -v=1.12.0 + find kube -name '*.yaml' -print0 | PATH=$(retool_bin_path):$(PATH) xargs -0 kubeval -v=1.12.0 else @@ -277,37 +275,37 @@ else mock-gen-$(SUBDIR): install-tools @echo "--- Generating mocks $(SUBDIR)" @[ ! -d src/$(SUBDIR)/$(mocks_rules_dir) ] || \ - PATH=$(combined_bin_paths):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(mocks_output_dir) src/$(SUBDIR)/$(mocks_rules_dir) + PATH=$(retool_bin_path):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(mocks_output_dir) src/$(SUBDIR)/$(mocks_rules_dir) .PHONY: thrift-gen-$(SUBDIR) thrift-gen-$(SUBDIR): install-tools @echo "--- Generating thrift files $(SUBDIR)" @[ ! -d src/$(SUBDIR)/$(thrift_rules_dir) ] || \ - PATH=$(combined_bin_paths):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(thrift_output_dir) src/$(SUBDIR)/$(thrift_rules_dir) + PATH=$(retool_bin_path):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(thrift_output_dir) src/$(SUBDIR)/$(thrift_rules_dir) .PHONY: proto-gen-$(SUBDIR) proto-gen-$(SUBDIR): install-tools @echo "--- Generating protobuf files $(SUBDIR)" @[ ! -d src/$(SUBDIR)/$(proto_rules_dir) ] || \ - PATH=$(combined_bin_paths):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(proto_output_dir) src/$(SUBDIR)/$(proto_rules_dir) + PATH=$(retool_bin_path):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(proto_output_dir) src/$(SUBDIR)/$(proto_rules_dir) .PHONY: asset-gen-$(SUBDIR) asset-gen-$(SUBDIR): install-tools @echo "--- Generating asset files $(SUBDIR)" @[ ! -d src/$(SUBDIR)/$(assets_rules_dir) ] || \ - PATH=$(combined_bin_paths):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(assets_output_dir) src/$(SUBDIR)/$(assets_rules_dir) + PATH=$(retool_bin_path):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(assets_output_dir) src/$(SUBDIR)/$(assets_rules_dir) .PHONY: genny-gen-$(SUBDIR) genny-gen-$(SUBDIR): install-tools @echo "--- Generating genny files $(SUBDIR)" @[ ! -f $(SELF_DIR)/src/$(SUBDIR)/generated-source-files.mk ] || \ - PATH=$(combined_bin_paths):$(PATH) make -f $(SELF_DIR)/src/$(SUBDIR)/generated-source-files.mk genny-all - @PATH=$(combined_bin_paths):$(PATH) bash -c "source ./scripts/auto-gen-helpers.sh && gen_cleanup_dir '*_gen.go' $(SELF_DIR)/src/$(SUBDIR)/ && gen_cleanup_dir '*_gen_test.go' $(SELF_DIR)/src/$(SUBDIR)/" + PATH=$(retool_bin_path):$(PATH) make -f $(SELF_DIR)/src/$(SUBDIR)/generated-source-files.mk genny-all + @PATH=$(retool_bin_path):$(PATH) bash -c "source ./scripts/auto-gen-helpers.sh && gen_cleanup_dir '*_gen.go' $(SELF_DIR)/src/$(SUBDIR)/ && gen_cleanup_dir '*_gen_test.go' $(SELF_DIR)/src/$(SUBDIR)/" .PHONY: license-gen-$(SUBDIR) license-gen-$(SUBDIR): install-tools @echo "--- Updating license in files $(SUBDIR)" - @find $(SELF_DIR)/src/$(SUBDIR) -name '*.go' | PATH=$(combined_bin_paths):$(PATH) xargs -I{} update-license {} + @find $(SELF_DIR)/src/$(SUBDIR) -name '*.go' | PATH=$(retool_bin_path):$(PATH) xargs -I{} update-license {} .PHONY: all-gen-$(SUBDIR) # NB(prateek): order matters here, mock-gen needs to be after proto/thrift because we sometimes @@ -365,7 +363,7 @@ test-ci-integration-$(SUBDIR): .PHONY: metalint-$(SUBDIR) metalint-$(SUBDIR): install-gometalinter install-linter-badtime install-linter-importorder @echo "--- metalinting $(SUBDIR)" - @(PATH=$(combined_bin_paths):$(PATH) $(metalint_check) \ + @(PATH=$(retool_bin_path):$(PATH) $(metalint_check) \ $(metalint_config) $(metalint_exclude) src/$(SUBDIR)) endif @@ -438,7 +436,7 @@ endif metalint: install-gometalinter install-linter-badtime install-linter-importorder @echo "--- metalinting src/" @(PATH=$(retool_bin_path):$(PATH) $(metalint_check) \ - $(metalint_config) $(metalint_exclude) $(m3_package_path)/src/) + $(metalint_config) $(metalint_exclude) src/) # Tests that all currently generated types match their contents if they were regenerated .PHONY: test-all-gen @@ -449,12 +447,12 @@ test-all-gen: all-gen # Runs a fossa license report .PHONY: fossa fossa: install-tools - PATH=$(combined_bin_paths):$(PATH) fossa --option allow-nested-vendor:true --option allow-deep-vendor:true + PATH=$(retool_bin_path):$(PATH) fossa --option allow-nested-vendor:true --option allow-deep-vendor:true # Waits for the result of a fossa test and exits success if pass or fail if fails .PHONY: fossa-test fossa-test: fossa - PATH=$(combined_bin_paths):$(PATH) fossa test + PATH=$(retool_bin_path):$(PATH) fossa test .PHONY: clean clean: diff --git a/docker-compose.yml b/docker-compose.yml index 6105403495..ee63f56624 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ app: - image: golang:1.12.1-stretch + image: golang:1.10.4-stretch volumes: - .:/go/src/github.com/m3db/m3 - /usr/bin/buildkite-agent:/usr/bin/buildkite-agent diff --git a/docker/m3aggregator/Dockerfile b/docker/m3aggregator/Dockerfile index 38f8f55bdb..b4f2ad9828 100644 --- a/docker/m3aggregator/Dockerfile +++ b/docker/m3aggregator/Dockerfile @@ -1,5 +1,5 @@ # stage 1: build -FROM golang:1.12-alpine AS builder +FROM golang:1.10-alpine AS builder LABEL maintainer="The M3DB Authors " # Install Glide diff --git a/docker/m3collector/Dockerfile b/docker/m3collector/Dockerfile index 88b3056bfc..44bc4b9663 100644 --- a/docker/m3collector/Dockerfile +++ b/docker/m3collector/Dockerfile @@ -1,5 +1,5 @@ # stage 1: build -FROM golang:1.12-alpine AS builder +FROM golang:1.10-alpine AS builder LABEL maintainer="The M3DB Authors " # Install Glide diff --git a/docker/m3coordinator/Dockerfile b/docker/m3coordinator/Dockerfile index 1c500594be..d586d3dc07 100644 --- a/docker/m3coordinator/Dockerfile +++ b/docker/m3coordinator/Dockerfile @@ -1,5 +1,5 @@ # stage 1: build -FROM golang:1.12-alpine AS builder +FROM golang:1.10-alpine AS builder LABEL maintainer="The M3DB Authors " # Install Glide diff --git a/docker/m3dbnode/Dockerfile b/docker/m3dbnode/Dockerfile index 4f33bbf4a4..4f6134f422 100644 --- a/docker/m3dbnode/Dockerfile +++ b/docker/m3dbnode/Dockerfile @@ -1,5 +1,5 @@ -# stage 1: build -FROM golang:1.12-alpine AS builder +# Stage 1: build +FROM golang:1.10-alpine AS builder LABEL maintainer="The M3DB Authors " # Install Glide @@ -26,8 +26,8 @@ COPY --from=builder /go/src/github.com/m3db/m3/bin/m3dbnode /bin/ COPY --from=builder /go/src/github.com/m3db/m3/src/dbnode/config/m3dbnode-local-etcd.yml /etc/m3dbnode/m3dbnode.yml COPY --from=builder /go/src/github.com/m3db/m3/scripts/m3dbnode_bootstrapped.sh /bin/ -# Use setcap to set +e "effective" and +p "permitted" to adjust the -# SYS_RESOURCE so the process can raise the hard file limit with +# Use setcap to set +e "effective" and +p "permitted" to adjust the +# SYS_RESOURCE so the process can raise the hard file limit with # setrlimit RUN apk add libcap && \ setcap cap_sys_resource=+ep /bin/m3dbnode diff --git a/docker/m3nsch/Dockerfile b/docker/m3nsch/Dockerfile index 53c9a3fd47..3763a1e326 100644 --- a/docker/m3nsch/Dockerfile +++ b/docker/m3nsch/Dockerfile @@ -1,5 +1,5 @@ # stage 1: build -FROM golang:1.12-alpine AS builder +FROM golang:1.10-alpine AS builder LABEL maintainer="The M3DB Authors " # Install Glide diff --git a/docker/m3query/Dockerfile b/docker/m3query/Dockerfile index ee882d2373..9d3d298a15 100644 --- a/docker/m3query/Dockerfile +++ b/docker/m3query/Dockerfile @@ -1,5 +1,5 @@ # stage 1: build -FROM golang:1.12-alpine AS builder +FROM golang:1.10-alpine AS builder LABEL maintainer="The M3DB Authors " # Install Glide diff --git a/scripts/thriftgen.Dockerfile b/scripts/thriftgen.Dockerfile index b15cb238e5..a914385050 100644 --- a/scripts/thriftgen.Dockerfile +++ b/scripts/thriftgen.Dockerfile @@ -1,7 +1,7 @@ # built artifacts maintained externally at https://quay.io/repository/m3db/thrift-gen # stage 1: build thrift-gen binary -FROM golang:1.12-alpine AS thriftgen +FROM golang:1.10-alpine AS thriftgen LABEL maintainer="The M3DB Authors " # install git diff --git a/src/query/util/logging/log_test.go b/src/query/util/logging/log_test.go index d86cd185ba..4122bf0448 100644 --- a/src/query/util/logging/log_test.go +++ b/src/query/util/logging/log_test.go @@ -140,7 +140,7 @@ func TestPanicErrorResponder(t *testing.T) { } } - assert.Equal(t, 3, count) + assert.Equal(t, 4, count) // `log_test` should appear in the output twice, once for the call in the // deadbeef method, and once for the ServeHttp call. @@ -187,7 +187,7 @@ func assertPanicLogsWritten(t *testing.T, stdout, stderr *os.File) { } } - assert.Equal(t, 4, count) + assert.Equal(t, 5, count) // `log_test` should appear in the output twice, once for the call in the // deadbeef method, and once for the ServeHttp call. @@ -197,8 +197,6 @@ func assertPanicLogsWritten(t *testing.T, stdout, stderr *os.File) { count++ } } - - assert.Equal(t, 2, count) } func TestPanicErrorResponderOnlyIfNotWrittenRequest(t *testing.T) {