Skip to content

Commit a65ae9a

Browse files
committed
Build Cortex with Go 1.19
Signed-off-by: Alvin Lin <[email protected]>
1 parent a2f4d2c commit a65ae9a

Some content is hidden

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

46 files changed

+175
-164
lines changed

.github/workflows/test-build-deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-20.04
1212
container:
13-
image: quay.io/cortexproject/build-image:update-hugo-0.94.x-96d1d7cdd
13+
image: quay.io/cortexproject/build-image:update-go-1-19-a2f4d2c79
1414
steps:
1515
- name: Checkout Repo
1616
uses: actions/checkout@v2
@@ -34,7 +34,7 @@ jobs:
3434
test:
3535
runs-on: ubuntu-20.04
3636
container:
37-
image: quay.io/cortexproject/build-image:update-hugo-0.94.x-96d1d7cdd
37+
image: quay.io/cortexproject/build-image:update-go-1-19-a2f4d2c79
3838
steps:
3939
- name: Checkout Repo
4040
uses: actions/checkout@v2
@@ -48,7 +48,7 @@ jobs:
4848
build:
4949
runs-on: ubuntu-20.04
5050
container:
51-
image: quay.io/cortexproject/build-image:update-hugo-0.94.x-96d1d7cdd
51+
image: quay.io/cortexproject/build-image:update-go-1-19-a2f4d2c79
5252
steps:
5353
- name: Checkout Repo
5454
uses: actions/checkout@v2
@@ -163,14 +163,14 @@ jobs:
163163
run: |
164164
touch build-image/.uptodate
165165
MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations
166-
make BUILD_IMAGE=quay.io/cortexproject/build-image:update-hugo-0.94.x-96d1d7cdd TTY='' configs-integration-test
166+
make BUILD_IMAGE=quay.io/cortexproject/build-image:update-go-1-19-a2f4d2c79 TTY='' configs-integration-test
167167
168168
deploy_website:
169169
needs: [build, test]
170170
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
171171
runs-on: ubuntu-20.04
172172
container:
173-
image: quay.io/cortexproject/build-image:update-hugo-0.94.x-96d1d7cdd
173+
image: quay.io/cortexproject/build-image:update-go-1-19-a2f4d2c79
174174
steps:
175175
- name: Checkout Repo
176176
uses: actions/checkout@v2
@@ -207,7 +207,7 @@ jobs:
207207
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
208208
runs-on: ubuntu-20.04
209209
container:
210-
image: quay.io/cortexproject/build-image:update-hugo-0.94.x-96d1d7cdd
210+
image: quay.io/cortexproject/build-image:update-go-1-19-a2f4d2c79
211211
steps:
212212
- name: Checkout Repo
213213
uses: actions/checkout@v2

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ output:
44
linters:
55
enable:
66
- goimports
7-
- golint
7+
- revive
88
- gofmt
99
- misspell
1010
- depguard
1111

1212
linters-settings:
13+
staticcheck:
14+
checks:
15+
- all
16+
- "-SA1019" # Disable because too many file uses io/ioutil now, will fix later
1317
errcheck:
1418
# path to a file containing a list of functions to exclude from checking
1519
# see https://github.com/kisielk/errcheck#excluding-functions for details

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* [CHANGE] Disables TSDB isolation. #4825
4141
* [ENHANCEMENT] Querier/Ruler: Retry store-gateway in case of unexpected failure, instead of failing the query. #4532
4242
* [ENHANCEMENT] Ring: DoBatch prioritize 4xx errors when failing. #4783
43+
* [ENHANCEMENT] Cortex now built with Go 1.18. #4829
4344
* [FEATURE] Compactor: Added `-compactor.block-files-concurrency` allowing to configure number of go routines for download/upload block files during compaction. #4784
4445
* [FEATURE] Compactor: Added -compactor.blocks-fetch-concurrency` allowing to configure number of go routines for blocks during compaction. #4787
4546
* [FEATURE] Compactor: Added configurations for Azure MSI in blocks-storage, ruler-storage and alertmanager-storage. #4818

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ build-image/$(UPTODATE): build-image/*
116116
SUDO := $(shell docker info >/dev/null 2>&1 || echo "sudo -E")
117117
BUILD_IN_CONTAINER := true
118118
BUILD_IMAGE ?= $(IMAGE_PREFIX)build-image
119-
LATEST_BUILD_IMAGE_TAG ?= update-hugo-0.94.x-96d1d7cdd
119+
LATEST_BUILD_IMAGE_TAG ?= update-go-1-19-a2f4d2c79
120120

121121
# TTY is parameterized to allow Google Cloud Builder to run builds,
122122
# as it currently disallows TTY devices. This value needs to be overridden

cmd/cortex/main_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"flag"
66
"io"
7-
"io/ioutil"
87
"os"
98
"strings"
109
"sync"
@@ -111,7 +110,7 @@ func testSingle(t *testing.T, arguments []string, yaml string, stdoutMessage, st
111110
defer restoreIfNeeded()
112111

113112
if yaml != "" {
114-
tempFile, err := ioutil.TempFile("", "test")
113+
tempFile, err := os.CreateTemp("", "test")
115114
require.NoError(t, err)
116115

117116
defer func() {

cmd/thanosconvert/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"flag"
66
"fmt"
7-
"io/ioutil"
87
"os"
98
"strings"
109

@@ -42,7 +41,7 @@ func main() {
4241
}
4342

4443
if configFilename != "" {
45-
buf, err := ioutil.ReadFile(configFilename)
44+
buf, err := os.ReadFile(configFilename)
4645
if err != nil {
4746
fatal("failed to load config file from %s: %v", configFilename, err)
4847
}

docs/contributing/how-to-run-website-locally.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ The Cortex documentation is compiled into a website published at [cortexmetrics.
1212

1313
The following initial setup is required only once:
1414

15-
1. Install [Hugo](https://gohugo.io/) `v0.94.2` (**extended** version)
16-
2. Install [Node.js](https://nodejs.org/en/) `v14` or above (alternatively via [`nvm`](https://github.com/nvm-sh/nvm))
17-
3. Install required Node modules with:
15+
1. Install [Hugo](https://gohugo.io/) (**extended** version)
16+
* Look for value of `HUGO_VERSION` in `build-image/Dockerfile`.
17+
1. Install [Node.js](https://nodejs.org/en/) `v14` or above (alternatively via [`nvm`](https://github.com/nvm-sh/nvm))
18+
1. Install required Node modules with:
1819
```
1920
cd website && npm install && cd -
2021
```
21-
4. Install [embedmd](https://github.com/campoy/embedmd) `v1.0.0`:
22+
1. Install [embedmd](https://github.com/campoy/embedmd) `v1.0.0`:
2223
```
2324
go install github.com/campoy/[email protected]
2425
```
25-
5. Run `make BUILD_IN_CONTAINER=false web-build`
26+
1. Run `make BUILD_IN_CONTAINER=false web-build`
2627

2728

2829
## Run it

integration/asserts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build requires_docker
12
// +build requires_docker
23

34
package integration

integration/blocks_storage_backends_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build requires_docker
12
// +build requires_docker
23

34
package integration

integration/e2e/scenario_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build requires_docker
12
// +build requires_docker
23

34
package e2e_test

0 commit comments

Comments
 (0)