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

Upgrade to Go 1.15 #3022

Merged
merged 4 commits into from
Sep 2, 2020
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 2
defaults: &defaults
docker:
# Built by Thanos make docker-ci
- image: &default-docker-image quay.io/thanos/thanos-ci:v1.2-go1.14.2-node
- image: &default-docker-image quay.io/thanos/thanos-ci:v1.2-go1.15-node

jobs:
test:
Expand All @@ -30,6 +30,7 @@ jobs:
- run:
name: "Run unit tests."
environment:
GOBIN: "/go/bin"
THANOS_TEST_OBJSTORE_SKIP: AZURE,COS,ALIYUNOSS
# Variables for Swift testing.
OS_AUTH_URL: http://127.0.0.1:5000/v2.0
Expand Down Expand Up @@ -66,6 +67,8 @@ jobs:
publish_master:
<<: *defaults
working_directory: /go/src/github.com/thanos-io/thanos
environment:
GOBIN: "/go/bin"
steps:
- checkout
- setup_remote_docker:
Expand Down
31 changes: 31 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/prometheus
/thanos
/vendor/
/mixin/vendor/
node_modules/

# Ignore minikube setup working dirs.
kube/bin
kube/.kube
kube/.minikube
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use Kubernetes in our tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have copied those from .gitignore. I haven't checked them to be honest.


# Ignore e2e working dirs.
data/
test/e2e/e2e_integration_test*

# Ignore promu artifacts.
/.build
/.release
/.tarballs

/.idea
/*.iml

website/public/
website/docs-pre-processed/
!website/data

# React build assets
pkg/ui/static/react

tmp/
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14.x
go-version: 1.15.x

- uses: actions/cache@v1
with:
Expand All @@ -30,4 +30,4 @@ jobs:
- name: Check docs
run: make check-docs
- name: Check examples
run: make check-examples
run: make check-examples
6 changes: 3 additions & 3 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Go.
uses: actions/setup-go@v1
with:
go-version: 1.14.2
go-version: 1.15.x

- name: Check out code into the Go module directory
uses: actions/checkout@v1
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14.x
go-version: 1.15.x

- uses: actions/cache@v1
with:
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Install Go.
uses: actions/setup-go@v1
with:
go-version: 1.14.2
go-version: 1.15.x

- name: Check out code into the Go module directory.
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.14.2
1.15
36 changes: 18 additions & 18 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
go:
version: 1.14.2
version: 1.15.0
repository:
path: github.com/thanos-io/thanos
path: github.com/thanos-io/thanos
build:
binaries:
- name: thanos
path: ./cmd/thanos
flags: -a -tags netgo
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
binaries:
- name: thanos
path: ./cmd/thanos
flags: -a -tags netgo
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
crossbuild:
platforms:
- linux/amd64
- darwin/amd64
- linux/arm64
- windows/amd64
- freebsd/amd64
platforms:
- linux/amd64
- darwin/amd64
- linux/arm64
- windows/amd64
- freebsd/amd64
2 changes: 1 addition & 1 deletion Dockerfile.multi-stage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14.2-alpine3.11 as builder
FROM golang:1.15-alpine3.12 as builder

WORKDIR $GOPATH/src/github.com/thanos-io/thanos
# Change in the docker context invalidates the cache so to leverage docker
Expand Down
13 changes: 10 additions & 3 deletions Dockerfile.thanos-ci
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Available from https://hub.docker.com/r/circleci/golang/
FROM circleci/golang:1.14.2-node
FROM circleci/golang:1.15 AS builder

ENV GOBIN=/home/circleci/.local/bin
ENV GOBIN=/go/bin
ENV BIN_DIR=/go/bin

COPY --chown=circleci tmp/bin/* ${GOBIN}/
WORKDIR opt
COPY Makefile .
COPY .bingo ./.bingo
RUN make install-deps

FROM circleci/golang:1.15-node
COPY --from=builder --chown=circleci /go/bin /go/bin/
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ deps: ## Ensures fresh go.mod and go.sum.
@go mod tidy
@go mod verify


.PHONY: docker
docker: ## Builds 'thanos' docker with no tag.
ifeq ($(OS)_$(ARCH), linux_x86_64)
Expand Down Expand Up @@ -238,10 +237,6 @@ install-deps: $(ALERTMANAGER) $(MINIO) $(PROMETHEUS_ARRAY)
.PHONY: docker-ci
docker-ci: ## Builds and pushes docker image used by our CI. This is done to cache our tools and dependencies. To be run by Thanos maintainer.
docker-ci: install-deps
# Copy all to tmp local dir as this is required by docker.
@rm -rf $(BIN_DIR)
@mkdir -p $(BIN_DIR)
@cp -r $(GOBIN)/* $(BIN_DIR)
@docker build -t thanos-ci -f Dockerfile.thanos-ci .
@echo ">> pushing thanos-ci image"
@docker tag "thanos-ci" "quay.io/thanos/thanos-ci:$(DOCKER_CI_TAG)"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cacheutil/memcached_server_selector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func BenchmarkMemcachedJumpHashSelector_PickServer(b *testing.B) {
b.ResetTimer()

for i := 0; i < b.N; i++ {
_, err := selector.PickServer(string(i))
_, err := selector.PickServer(fmt.Sprint(i))
if err != nil {
b.Error(err)
}
Expand Down