Skip to content

Commit

Permalink
k8s 1.31/go1.23 (#560)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Heilbron <[email protected]>
  • Loading branch information
tjons and sam-heilbron authored Sep 11, 2024
1 parent 1baf6de commit f03f859
Show file tree
Hide file tree
Showing 29 changed files with 495 additions and 227 deletions.
35 changes: 32 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,46 @@ update-all: mod-download update-deps update-code-generator
mod-download:
go mod download all

.PHONY: install-tools
install-tools: update-deps install-protoc

.PHONY: update-deps
update-deps:
mkdir -p $(DEPSGOBIN)
go install github.com/solo-io/protoc-gen-ext
go install github.com/solo-io/protoc-gen-ext@v0.0.18
go install github.com/solo-io/[email protected]
go install golang.org/x/tools/cmd/goimports
go install github.com/golang/protobuf/protoc-gen-go
go install github.com/envoyproxy/protoc-gen-validate
go install github.com/golang/protobuf/protoc-gen-go@v1.5.4
go install github.com/envoyproxy/protoc-gen-validate@v1.0.4
go install github.com/golang/mock/gomock
go install github.com/golang/mock/mockgen

# proto compiler installation
# no explicit arm build, but x86_64 build works on arm macs
PROTOC_VERSION:=3.6.1
PROTOC_URL:=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}
.PHONY: install-protoc
install-protoc:
mkdir -p $(DEPSGOBIN)
if [ $(shell ${DEPSGOBIN}/protoc --version | grep -c ${PROTOC_VERSION}) -ne 0 ]; then \
echo expected protoc version ${PROTOC_VERSION} already installed ;\
else \
if [ "$(shell uname)" == "Darwin" ]; then \
echo "downloading protoc for osx" ;\
wget $(PROTOC_URL)-osx-x86_64.zip -O $(DEPSGOBIN)/protoc-${PROTOC_VERSION}.zip ;\
elif [ "$(shell uname -m)" == "aarch64" ]; then \
echo "downloading protoc for linux aarch64" ;\
wget $(PROTOC_URL)-linux-aarch_64.zip -O $(DEPSGOBIN)/protoc-${PROTOC_VERSION}.zip ;\
else \
echo "downloading protoc for linux x86-64" ;\
wget $(PROTOC_URL)-linux-x86_64.zip -O $(DEPSGOBIN)/protoc-${PROTOC_VERSION}.zip ;\
fi ;\
unzip $(DEPSGOBIN)/protoc-${PROTOC_VERSION}.zip -d $(DEPSGOBIN)/protoc-${PROTOC_VERSION} ;\
mv $(DEPSGOBIN)/protoc-${PROTOC_VERSION}/bin/protoc $(DEPSGOBIN)/protoc ;\
chmod +x $(DEPSGOBIN)/protoc ;\
rm -rf $(DEPSGOBIN)/protoc-${PROTOC_VERSION} $(DEPSGOBIN)/protoc-${PROTOC_VERSION}.zip ;\
fi

.PHONY: update-code-generator
update-code-generator:
chmod +x $(shell go list -f '{{ .Dir }}' -m k8s.io/code-generator)/generate-groups.sh
Expand Down
13 changes: 10 additions & 3 deletions api/v1/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,26 @@ SOLO_KIT=${ROOT}/solo-kit
IN=${SOLO_KIT}/api/v1/
VENDOR_ROOT=vendor_any/github.com

# Scripts are a legacy component of our CI, and ideally would be converted to go code,
# since the functionality is available in code-generator/collector/compiler.go
# However, since this library is rarely modified, we do not want to make sweeping changes to the code generation step.
# To improve the debuggability of these scripts, we include some identifier so that we can more easily triage issues.
SCRIPT_ID="api/v1/generate.sh"

TEMP_DIR=$(mktemp -d)
cleanup() {
echo ">> Removing ${TEMP_DIR}"
rm -rf ${TEMP_DIR}
}
trap "cleanup" EXIT SIGINT
trap "cleanup ${SCRIPT_ID}" EXIT SIGINT

echo ">> Temporary output directory ${TEMP_DIR}"
echo ">> Invoking ${SCRIPT_ID}: temporary output directory ${TEMP_DIR}"

IMPORTS="\
-I=${IN} \
-I=${ROOT} \
-I=${VENDOR_ROOT}/solo-io/protoc-gen-ext"
-I=${VENDOR_ROOT}/solo-io/protoc-gen-ext \
-I=${VENDOR_ROOT}/solo-io/protoc-gen-ext/external"

GO_FLAG="--go_out=${TEMP_DIR}"
HASH_FLAG="--ext_out=${TEMP_DIR}"
Expand Down
90 changes: 90 additions & 0 deletions changelog/v0.36.0/9683-go-k8s-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
changelog:
- type: BREAKING_CHANGE
description: >
Bump dependencies to support Kubernetes 1.31
issueLink: https://github.com/solo-io/gloo/issues/9683
resolvesIssue: false
- type: DEPENDENCY_BUMP
dependencyOwner: envoyproxy
dependencyRepo: go-control-plane
dependencyTag: v0.12.0
- type: DEPENDENCY_BUMP
dependencyOwner: envoyproxy
dependencyRepo: protoc-gen-validate
dependencyTag: v1.0.4
- type: DEPENDENCY_BUMP
dependencyOwner: golang
dependencyRepo: protobuf
dependencyTag: v1.5.4
- type: DEPENDENCY_BUMP
dependencyOwner: iancoleman
dependencyRepo: strcase
dependencyTag: v0.3.0
- type: DEPENDENCY_BUMP
dependencyOwner: onsi
dependencyRepo: ginkgo
dependencyTag: v2.19.0
- type: DEPENDENCY_BUMP
dependencyOwner: onsi
dependencyRepo: gomega
dependencyTag: v1.33.1
- type: DEPENDENCY_BUMP
dependencyOwner: solo-io
dependencyRepo: go-utils
dependencyTag: v0.26.0
- type: DEPENDENCY_BUMP
dependencyOwner: solo-io
dependencyRepo: k8s-utils
dependencyTag: v0.8.0
- type: DEPENDENCY_BUMP
dependencyOwner: golang
dependencyRepo: x/sync
dependencyTag: v0.8.0
- type: DEPENDENCY_BUMP
dependencyOwner: google
dependencyRepo: genproto/googleapis/apis
dependencyTag: v0.0.0-20240528184218-531527333157
- type: DEPENDENCY_BUMP
dependencyOwner: google
dependencyRepo: genproto/googleapis/rpc
dependencyTag: v0.0.0-20240701130421-f6361c86f094
- type: DEPENDENCY_BUMP
dependencyOwner: google
dependencyRepo: genproto/googleapis/rpc
dependencyTag: v0.0.0-20240701130421-f6361c86f094
- type: DEPENDENCY_BUMP
dependencyOwner: google
dependencyRepo: grpc
dependencyTag: v1.65.0
- type: DEPENDENCY_BUMP
dependencyOwner: google
dependencyRepo: protobuf
dependencyTag: v1.34.2
- type: DEPENDENCY_BUMP
dependencyOwner: k8s.io
dependencyRepo: api
dependencyTag: v0.31.0
- type: DEPENDENCY_BUMP
dependencyOwner: k8s.io
dependencyRepo: apiextensions-apiserver
dependencyTag: v0.31.0
- type: DEPENDENCY_BUMP
dependencyOwner: k8s.io
dependencyRepo: apimachinery
dependencyTag: v0.31.0
- type: DEPENDENCY_BUMP
dependencyOwner: k8s.io
dependencyRepo: client-go
dependencyTag: v0.31.0
- type: DEPENDENCY_BUMP
dependencyOwner: k8s.io
dependencyRepo: code-generator
dependencyTag: v0.31.0
- type: DEPENDENCY_BUMP
dependencyOwner: k8s.io
dependencyRepo: utils
dependencyTag: v0.0.0-20240711033017-18e509b52bc8
- type: DEPENDENCY_BUMP
dependencyOwner: solo-io
dependencyRepo: cloud-builders
dependencyTag: v0.10.1
32 changes: 16 additions & 16 deletions ci/oss_compliance/osa_provided.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@ Name|Version|License
[cuelang.org/go](https://cuelang.org/go)|v0.3.2|Apache License 2.0
[Masterminds/sprig](https://github.com/Masterminds/sprig)|v2.22.0+incompatible|MIT License
[bugsnag/bugsnag-go](https://github.com/bugsnag/bugsnag-go)|v1.5.0|MIT License
[envoyproxy/go-control-plane](https://github.com/envoyproxy/go-control-plane)|v0.11.1|Apache License 2.0
[envoyproxy/protoc-gen-validate](https://github.com/envoyproxy/protoc-gen-validate)|v1.0.2|Apache License 2.0
[envoyproxy/go-control-plane](https://github.com/envoyproxy/go-control-plane)|v0.12.0|Apache License 2.0
[envoyproxy/protoc-gen-validate](https://github.com/envoyproxy/protoc-gen-validate)|v1.0.4|Apache License 2.0
[fgrosse/zaptest](https://github.com/fgrosse/zaptest)|v1.1.0|MIT License
[getkin/kin-openapi](https://github.com/getkin/kin-openapi)|v0.80.0|MIT License
[ghodss/yaml](https://github.com/ghodss/yaml)|v1.0.1-0.20190212211648-25d852aebe32|MIT License
[go-test/deep](https://github.com/go-test/deep)|v1.0.2|MIT License
[golang/protobuf](https://github.com/golang/protobuf)|v1.5.3|BSD 3-clause "New" or "Revised" License
[golang/protobuf](https://github.com/golang/protobuf)|v1.5.4|BSD 3-clause "New" or "Revised" License
[grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware)|v1.3.0|Apache License 2.0
[iancoleman/strcase](https://github.com/iancoleman/strcase)|v0.0.0-20191112232945-16388991a334|MIT License
[mitchellh/hashstructure](https://github.com/mitchellh/hashstructure)|v1.0.0|MIT License
[ginkgo/v2](https://github.com/onsi/ginkgo)|v2.14.0|MIT License
[onsi/gomega](https://github.com/onsi/gomega)|v1.30.0|MIT License
[ginkgo/v2](https://github.com/onsi/ginkgo)|v2.19.0|MIT License
[onsi/gomega](https://github.com/onsi/gomega)|v1.33.1|MIT License
[pkg/errors](https://github.com/pkg/errors)|v0.9.1|BSD 2-clause "Simplified" License
[pseudomuto/protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc)|v1.5.0|MIT License
[pseudomuto/protokit](https://github.com/pseudomuto/protokit)|v0.2.0|MIT License
[radovskyb/watcher](https://github.com/radovskyb/watcher)|v1.0.2|BSD 3-clause "New" or "Revised" License
[rotisserie/eris](https://github.com/rotisserie/eris)|v0.1.1|MIT License
[go.opencensus.io](https://go.opencensus.io)|v0.24.0|Apache License 2.0
[go.uber.org/zap](https://go.uber.org/zap)|v1.26.0|MIT License
[x/sync](https://golang.org/x/sync)|v0.5.0|BSD 3-clause "New" or "Revised" License
[googleapis/api](https://google.golang.org/genproto/googleapis/api)|v0.0.0-20230726155614-23370e0ffb3e|Apache License 2.0
[googleapis/rpc](https://google.golang.org/genproto/googleapis/rpc)|v0.0.0-20230822172742-b8732ec3820d|Apache License 2.0
[google.golang.org/grpc](https://google.golang.org/grpc)|v1.58.3|Apache License 2.0
[google.golang.org/protobuf](https://google.golang.org/protobuf)|v1.31.0|BSD 3-clause "New" or "Revised" License
[x/sync](https://golang.org/x/sync)|v0.8.0|BSD 3-clause "New" or "Revised" License
[googleapis/api](https://google.golang.org/genproto/googleapis/api)|v0.0.0-20240528184218-531527333157|Apache License 2.0
[googleapis/rpc](https://google.golang.org/genproto/googleapis/rpc)|v0.0.0-20240701130421-f6361c86f094|Apache License 2.0
[google.golang.org/grpc](https://google.golang.org/grpc)|v1.65.0|Apache License 2.0
[google.golang.org/protobuf](https://google.golang.org/protobuf)|v1.34.2|BSD 3-clause "New" or "Revised" License
[gopkg.in/yaml.v2](https://gopkg.in/yaml.v2)|v2.4.0|Apache License 2.0
[k8s.io/api](https://k8s.io/api)|v0.29.2|Apache License 2.0
[k8s.io/apiextensions-apiserver](https://k8s.io/apiextensions-apiserver)|v0.29.2|Apache License 2.0
[k8s.io/apimachinery](https://k8s.io/apimachinery)|v0.29.2|Apache License 2.0
[k8s.io/client-go](https://k8s.io/client-go)|v0.29.2|Apache License 2.0
[k8s.io/code-generator](https://k8s.io/code-generator)|v0.29.2|Apache License 2.0
[k8s.io/utils](https://k8s.io/utils)|v0.0.0-20230726121419-3b25d923346b|Apache License 2.0
[k8s.io/api](https://k8s.io/api)|v0.31.0|Apache License 2.0
[k8s.io/apiextensions-apiserver](https://k8s.io/apiextensions-apiserver)|v0.31.0|Apache License 2.0
[k8s.io/apimachinery](https://k8s.io/apimachinery)|v0.31.0|Apache License 2.0
[k8s.io/client-go](https://k8s.io/client-go)|v0.31.0|Apache License 2.0
[k8s.io/code-generator](https://k8s.io/code-generator)|v0.31.0|Apache License 2.0
[k8s.io/utils](https://k8s.io/utils)|v0.0.0-20240711033017-18e509b52bc8|Apache License 2.0
[structured-merge-diff/v4](https://sigs.k8s.io/structured-merge-diff/v4)|v4.4.1|Apache License 2.0
[sigs.k8s.io/yaml](https://sigs.k8s.io/yaml)|v1.4.0|MIT License
[cmd/goimports](https://golang.org/x/tools/cmd/goimports)|latest|MIT License
Expand Down
6 changes: 3 additions & 3 deletions cloudbuild-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ steps:
path: /root/.ssh
id: 'untar-mod-cache'

- name: 'golang:1.20.1'
- name: 'golang:1.23.0'
args: ['go', 'mod', 'download', 'all']
volumes: *vol
id: 'download'

- name: 'golang:1.20.1'
- name: 'golang:1.23.0'
args: ['go', 'mod', 'tidy']
volumes: *vol
id: 'tidy'

- name: 'golang:1.20.1'
- name: 'golang:1.23.0'
entrypoint: 'bash'
volumes: *vol
args: ['-c', ' cd /go/pkg && tar -zvcf solo-kit-mod.tar.gz mod']
Expand Down
20 changes: 11 additions & 9 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ steps:
dir: &dir '/workspace/solo-kit'

# prepare-workspace to set up the project so it can be built and tested
- name: 'gcr.io/$PROJECT_ID/prepare-go-workspace:0.9.1'
- name: 'gcr.io/$PROJECT_ID/prepare-go-workspace:0.10.1'
args:
- "--repo-name"
- "$REPO_NAME"
Expand All @@ -20,14 +20,14 @@ steps:
id: 'prepare-workspace'

# download massive container in parallel
- name: 'gcr.io/$PROJECT_ID/e2e-go-mod-ginkgo:0.9.1'
- name: 'gcr.io/$PROJECT_ID/e2e-go-mod-ginkgo:0.10.1'
entrypoint: 'bash'
dir: *dir
args: ['-c', 'ls']
waitFor: ['-']

# Installs go executables required by codegen tests
- name: 'gcr.io/$PROJECT_ID/go-mod-make:0.9.1'
- name: 'gcr.io/$PROJECT_ID/go-mod-make:0.10.1'
args: ['update-all']
waitFor: ['prepare-workspace']
id: 'update-deps'
Expand All @@ -45,7 +45,7 @@ steps:

# check code gen for kubernetes custom resources
# this step passes if there is no generated diff, fails otherwise
- name: 'gcr.io/$PROJECT_ID/go-mod-make:0.9.1'
- name: 'gcr.io/$PROJECT_ID/go-mod-make:0.10.1'
entrypoint: 'bash'
args: ['ci/check-code-gen.sh']
waitFor: ['update-deps']
Expand All @@ -55,15 +55,17 @@ steps:
# e2e-go-mod-ginkgo is produced from https://github.com/solo-io/cloud-builders/tree/master/e2e-go-mod-ginkgo
# sets up redis, consul, kubectl, go with required environment variables
# need to use the provided entrypoint
- name: 'gcr.io/$PROJECT_ID/e2e-go-mod-ginkgo:0.9.1'
entrypoint: 'bash'
- name: 'gcr.io/$PROJECT_ID/e2e-go-mod-ginkgo:0.10.1'
dir: *dir
entrypoint: 'make'
args:
- 'test'
waitFor:
- 'check-code-and-docs-gen'
env:
- 'RUN_KUBE_TESTS=1'
- 'RUN_CONSUL_TESTS=1'
- 'RUN_VAULT_TESTS=1'
args: ['-c', 'make test']
waitFor: ['check-code-and-docs-gen']
dir: *dir
id: 'test'

timeout: 1500s
Expand Down
Loading

0 comments on commit f03f859

Please sign in to comment.