Upgrade Go to 1.19 (#2204)

Upgrade Go to 1.19

* Use go install to install statik for CI/CD

* Switch from stretch to buster for idk

The stretch release doesn't exist anymore for go 1.19 docker images.

buster is a newer version of Debian anyway (v10 vs v9)

Co-authored-by: Fletcher Haynes <fletcher.haynes@molecula.com>
This commit is contained in:
Garrison Davis 2022-08-25 14:54:14 -06:00 • committed by GitHub
parent f03df56844
commit 123b20d2f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 26 additions and 27 deletions

View file

@ -24,7 +24,7 @@ gosec-sast:
- gosec convert gosec.json > gl-sast-report.json
variables:
GOVERSION: "1.17.8"
GOVERSION: "1.19"
stages:
- lint
@ -143,7 +143,7 @@ build for linux amd64:
script:
- rm -r lattice
- tar -xvf lattice.tar.gz
- go get -v -u github.com/rakyll/statik
- go install github.com/rakyll/statik@v0.1.7
- $GOPATH/bin/statik -src=lattice
- GOOS="linux" GOARCH="amd64" make build FLAGS="-o featurebase_linux_amd64"
- GOOS="linux" GOARCH="amd64" go build -o roaring-migrate_linux_amd64 ./cmd/roaring-migrate
@ -432,7 +432,7 @@ build for linux arm64:
script:
- rm -r lattice
- tar -xvf lattice.tar.gz
- go get -v -u github.com/rakyll/statik
- go install github.com/rakyll/statik@v0.1.7
- $GOPATH/bin/statik -src=lattice
- GOOS="linux" GOARCH="arm64" make build FLAGS="-o featurebase_linux_arm64"
- GOOS="linux" GOARCH="arm64" go build -o roaring-migrate_linux_arm64 ./cmd/roaring-migrate
@ -450,7 +450,7 @@ build for darwin amd64:
script:
- rm -r lattice
- tar -xvf lattice.tar.gz
- go get -v -u github.com/rakyll/statik
- go install github.com/rakyll/statik@v0.1.7
- $GOPATH/bin/statik -src=lattice
- GOOS="darwin" GOARCH="amd64" make build FLAGS="-o featurebase_darwin_amd64"
- GOOS="darwin" GOARCH="amd64" go build -o roaring-migrate_darwin_amd64 ./cmd/roaring-migrate
@ -468,7 +468,7 @@ build for darwin arm64:
script:
- rm -r lattice
- tar -xvf lattice.tar.gz
- go get -v -u github.com/rakyll/statik
- go install github.com/rakyll/statik@v0.1.7
- $GOPATH/bin/statik -src=lattice
- GOOS="darwin" GOARCH="arm64" make build FLAGS="-o featurebase_darwin_arm64"
- GOOS="darwin" GOARCH="arm64" go build -o roaring-migrate_darwin_arm64 ./cmd/roaring-migrate
@ -523,7 +523,7 @@ build plg for linux amd64:
script:
- rm -r lattice
- tar -xvf lattice.tar.gz
- go get -v -u github.com/rakyll/statik
- go install github.com/rakyll/statik@v0.1.7
- $GOPATH/bin/statik -src=lattice
- GOOS="linux" GOARCH="amd64" make plg FLAGS="-o single_node_featurebase_linux_amd64"
- GOOS="linux" GOARCH="amd64" go build -o roaring-migrate_linux_amd64 ./cmd/roaring-migrate
@ -541,7 +541,7 @@ build plg for linux arm64:
script:
- rm -r lattice
- tar -xvf lattice.tar.gz
- go get -v -u github.com/rakyll/statik
- go install github.com/rakyll/statik@v0.1.7
- $GOPATH/bin/statik -src=lattice
- GOOS="linux" GOARCH="arm64" make plg FLAGS="-o single_node_featurebase_linux_arm64"
- GOOS="linux" GOARCH="arm64" go build -o roaring-migrate_linux_arm64 ./cmd/roaring-migrate
@ -559,7 +559,7 @@ build plg for darwin amd64:
script:
- rm -r lattice
- tar -xvf lattice.tar.gz
- go get -v -u github.com/rakyll/statik
- go install github.com/rakyll/statik@v0.1.7
- $GOPATH/bin/statik -src=lattice
- GOOS="darwin" GOARCH="amd64" make plg FLAGS="-o single_node_featurebase_darwin_amd64"
- GOOS="darwin" GOARCH="amd64" go build -o roaring-migrate_darwin_amd64 ./cmd/roaring-migrate
@ -577,7 +577,7 @@ build plg for darwin arm64:
script:
- rm -r lattice
- tar -xvf lattice.tar.gz
- go get -v -u github.com/rakyll/statik
- go install github.com/rakyll/statik@v0.1.7
- $GOPATH/bin/statik -src=lattice
- GOOS="darwin" GOARCH="arm64" make plg FLAGS="-o single_node_featurebase_darwin_arm64"
- GOOS="darwin" GOARCH="arm64" go build -o roaring-migrate_darwin_arm64 ./cmd/roaring-migrate
@ -1057,8 +1057,8 @@ samsung-gauntlet:
- chmod 700 /root/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- apt update && apt -y install jq wget
- wget -q https://go.dev/dl/go1.17.8.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.17.8.linux-amd64.tar.gz
- wget -q https://go.dev/dl/go1.19.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin
- TF_VAR_cluster_prefix="pipeline-$CI_PIPELINE_ID-gauntlet-$CI_JOB_ID"
- echo "Cluster Prefix --> $TF_VAR_cluster_prefix"
@ -1119,8 +1119,8 @@ backup-restore-gauntlet:
- chmod 700 /root/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- apt update && apt -y install jq wget
- wget -q https://go.dev/dl/go1.17.8.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.17.8.linux-amd64.tar.gz
- wget -q https://go.dev/dl/go1.19.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin
- TF_VAR_cluster_prefix="pipeline-$CI_PIPELINE_ID-gauntlet-$CI_JOB_ID"
- echo "Cluster Prefix --> $TF_VAR_cluster_prefix"
@ -1244,8 +1244,8 @@ perf_delete:
- chmod 700 /root/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- apt update && apt -y install jq wget
- wget -q https://go.dev/dl/go1.17.8.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.17.8.linux-amd64.tar.gz
- wget -q https://go.dev/dl/go1.19.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin
- TF_VAR_cluster_prefix="pipeline-$CI_PIPELINE_ID-delete-$CI_JOB_ID"
- echo "Cluster Prefix --> $TF_VAR_cluster_prefix"
@ -1360,4 +1360,3 @@ cleanup_build_job:
needs:
- job: smoke test
- job: smoke test auth

View file

@ -1,5 +1,5 @@
variables:
GOVERSION: "1.17.8"
GOVERSION: "1.19"
stages:
- performance

View file

@ -1,7 +1,7 @@
# This Dockerfile is used for cluster testing - it produces a much larger image
# and includes all of Go as well as some utilities.
FROM golang:1.17
FROM golang:1.19
LABEL maintainer "dev@pilosa.com"

View file

@ -1,7 +1,7 @@
# This Dockerfile is used for cluster testing - it produces a much larger image
# and includes all of Go as well as some utilities.
FROM golang:1.17
FROM golang:1.19
LABEL maintainer "dev@pilosa.com"

View file

@ -13,7 +13,7 @@ BUILD_TIME := $(shell date -u +%FT%T%z)
SHARD_WIDTH = 20
COMMIT := $(shell git describe --exact-match >/dev/null 2>&1 || git rev-parse --short HEAD)
LDFLAGS="-X github.com/molecula/featurebase/v3.Version=$(VERSION) -X github.com/molecula/featurebase/v3.BuildTime=$(BUILD_TIME) -X github.com/molecula/featurebase/v3.Variant=$(VARIANT) -X github.com/molecula/featurebase/v3.Commit=$(COMMIT) -X github.com/molecula/featurebase/v3.TrialDeadline=$(TRIAL_DEADLINE)"
GO_VERSION=1.17.8
GO_VERSION=1.19
DOCKER_BUILD= # set to 1 to use `docker-build` instead of `build` when creating a release
BUILD_TAGS += shardwidth$(SHARD_WIDTH)
TEST_TAGS = roaringparanoia

View file

@ -1,6 +1,6 @@
ARG GO_VERSION=1.17.8
ARG GO_VERSION=1.19
FROM golang:1.17.8-stretch as builder
FROM golang:1.19-buster as builder
WORKDIR /
RUN apt-get update -y -qq && apt-get install -y -qq \

View file

@ -1,4 +1,4 @@
FROM golang:1.17.8
FROM golang:1.19
WORKDIR /
COPY fakeidp ./

View file

@ -1,4 +1,4 @@
ARG GO_VERSION=1.17.8
ARG GO_VERSION=1.19
FROM golang:${GO_VERSION} as build_base

View file

@ -2,7 +2,7 @@ GO ?= go
GOOS ?= $(shell $(GO) env GOOS)
GOARCH ?= $(shell $(GO) env GOARCH)
GOPATH ?= $(shell $(GO) env GOPATH)
GO_VERSION=1.17.8
GO_VERSION=1.19
GO_BUILD_FLAGS=
ODBC_ENABLED=
BINOUT ?= bin

View file

@ -23,10 +23,10 @@ ifErr "installing wget"
sudo yum install git -y
ifErr "installing git"
sudo wget -q https://go.dev/dl/go1.17.8.linux-arm64.tar.gz
sudo wget -q https://go.dev/dl/go1.19.linux-arm64.tar.gz
ifErr "downloading golang"
sudo tar -C /usr/local -xzf go1.17.8.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.19.linux-arm64.tar.gz
ifErr "unpacking golang"
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc