Merge pull request #46429 from wojtek-t/bump_go_to_183

Automatic merge from submit-queue (batch tested with PRs 46429, 46308, 46395, 45867, 45492)

Bump Go version to 1.8.3

This PR also removed this patched version of Go 1.8.1 which we used to use to workaround performance problem of Go 1.8.1.

Fix https://github.com/kubernetes/kubernetes/issues/45216
Ref #46391

@timothysc @bradfitz
pull/6/head
Kubernetes Submit Queue 2017-05-25 22:42:01 -07:00 committed by GitHub
commit 59ee250ced
8 changed files with 10 additions and 58 deletions

View File

@ -19,7 +19,7 @@ FROM gcr.io/google_containers/kube-cross:KUBE_BUILD_IMAGE_CROSS_TAG
RUN touch /kube-build-image
# To run as non-root we sometimes need to rebuild go stdlib packages.
RUN chmod -R a+rwx /usr/local/go/pkg ${K8S_PATCHED_GOROOT}/pkg
RUN chmod -R a+rwx /usr/local/go/pkg
# For running integration tests /var/run/kubernetes is required
# and should be writable by user

View File

@ -15,7 +15,7 @@
# This file creates a standard build environment for building cross
# platform go binary for the architecture kubernetes cares about.
FROM golang:1.8.1
FROM golang:1.8.3
ENV GOARM 7
ENV KUBE_DYNAMIC_CROSSPLATFORMS \
@ -77,22 +77,3 @@ RUN export ETCD_VERSION=v3.0.17; \
&& cd /usr/local/src/etcd \
&& curl -fsSL https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz | tar -xz \
&& ln -s ../src/etcd/etcd-${ETCD_VERSION}-linux-amd64/etcd /usr/local/bin/
# There is a significant performance regression in Go 1.8 comparing to Go 1.7.
# Until this is solved in Go itself, we are patching 1.8.1 version of Go to
# reduce the impact of this regression - for more detailed discussion see:
# https://github.com/kubernetes/kubernetes/issues/45216
#
# TODO: Once this issue is fixed in Go itself, we can get rid of the code below.
ENV K8S_PATCHED_GOLANG_VERSION=1.8.1 \
K8S_PATCHED_GOROOT=/usr/local/go_k8s_patched
RUN mkdir -p ${K8S_PATCHED_GOROOT} \
&& curl -sSL https://github.com/golang/go/archive/go${K8S_PATCHED_GOLANG_VERSION}.tar.gz | tar -xz -C ${K8S_PATCHED_GOROOT} --strip-components=1
COPY go_181_performance_fix.patch ${K8S_PATCHED_GOROOT}/
RUN cd ${K8S_PATCHED_GOROOT} \
&& patch -p1 < go_181_performance_fix.patch \
&& cd src \
&& GOROOT_FINAL=${K8S_PATCHED_GOROOT} GOROOT_BOOTSTRAP=/usr/local/go ./make.bash \
&& for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} GOROOT=${K8S_PATCHED_GOROOT} go install std; done

View File

@ -1 +1 @@
v1.8.1-2
v1.8.3-1

View File

@ -1,24 +0,0 @@
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 4536b2ff5d..84e78534a9 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -3536,9 +3536,17 @@ func (sc *http2serverConn) serve() {
sc.idleTimerCh = sc.idleTimer.C
}
- var gracefulShutdownCh <-chan struct{}
+ var gracefulShutdownCh chan struct{}
if sc.hs != nil {
- gracefulShutdownCh = http2h1ServerShutdownChan(sc.hs)
+ ch := http2h1ServerShutdownChan(sc.hs)
+ gracefulShutdownCh = make(chan struct{})
+ go func() {
+ select {
+ case <-sc.doneServing:
+ case <-ch:
+ close(gracefulShutdownCh)
+ }
+ }()
}
go sc.readFrames()

View File

@ -1,8 +1,8 @@
http_archive(
name = "io_bazel_rules_go",
sha256 = "a1cae429e9d591017421150e3173478c46c693bc594322c7fa7e6cb5f672ef59",
strip_prefix = "rules_go-805fd1566500997379806373feb05e138a4dfe28",
urls = ["https://github.com/bazelbuild/rules_go/archive/805fd1566500997379806373feb05e138a4dfe28.tar.gz"],
sha256 = "64294fd0e74d2aafa03ec3a1f2f9c167e27d17c9a5cf393e8bf79e43258de73d",
strip_prefix = "rules_go-a9df110cf04e167b33f10473c7e904d780d921e6",
urls = ["https://github.com/bazelbuild/rules_go/archive/a9df110cf04e167b33f10473c7e904d780d921e6.tar.gz"],
)
http_archive(
@ -33,7 +33,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_repositories")
load("@io_bazel_rules_docker//docker:docker.bzl", "docker_repositories")
go_repositories(
go_version = "1.8.1",
go_version = "1.8.3",
)
docker_repositories()

View File

@ -15,10 +15,10 @@
# Build the etcd-version-monitor image
#
# Usage:
# [GOLANG_VERSION=1.8.1] [REGISTRY=gcr.io/google-containers] [TAG=test] make (build|push)
# [GOLANG_VERSION=1.8.3] [REGISTRY=gcr.io/google-containers] [TAG=test] make (build|push)
# TODO(shyamjvs): Support architectures other than amd64 if needed.
ARCH:=amd64
GOLANG_VERSION?=1.8.1
GOLANG_VERSION?=1.8.3
REGISTRY?=gcr.io/google-containers
TAG?=0.1.0
IMAGE:=$(REGISTRY)/etcd-version-monitor:$(TAG)

View File

@ -267,11 +267,6 @@ kube::golang::set_platform_envs() {
# Do not set CC when building natively on a platform, only if cross-compiling from linux/amd64
if [[ $(kube::golang::host_platform) == "linux/amd64" ]]; then
# We are currently using go 1.8.1, which has significant performance
# regression. Until this is fixed in Golang head, we are using patched
# version of Go that eliminates this problem.
export GOROOT=${K8S_PATCHED_GOROOT:-${GOROOT}}
# Dynamic CGO linking for other server architectures than linux/amd64 goes here
# If you want to include support for more server platforms than these, add arch-specific gcc names here
case "${platform}" in

View File

@ -31,7 +31,7 @@ ALL_ARCH = amd64 arm arm64 ppc64le s390x
GOARM=7
TEMP_DIR := $(shell mktemp -d)
GOLANG_VERSION=1.8.1
GOLANG_VERSION=1.8.3
BIN = serve_hostname
SRCS = serve_hostname.go