Commit 3897fc00 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38926 from luxas/update_cross_go18

Automatic merge from submit-queue Improve the multiarch situation; armel => armhf; reenable pcc64le; remove the patched golang **What this PR does / why we need it**: - Improves the multiarch situation as described in #38067 - Tries to bump to go1.8 for arm (and later enable ppc64le) - GOARM 6 => GOARM 7 - Remove the golang 1.7 patch - armel => armhf - Bump QEMU version to v2.7.0 **Release note**: ```release-note Improve the ARM builds and make hyperkube on ARM working again by upgrading the Go version for ARM to go1.8beta2 ``` @kubernetes/sig-testing-misc @jessfraz @ixdy @jbeda @david-mcmahon @pwittrock
parents e7950e6f 914824cc
...@@ -19,7 +19,7 @@ FROM gcr.io/google_containers/kube-cross:KUBE_BUILD_IMAGE_CROSS_TAG ...@@ -19,7 +19,7 @@ FROM gcr.io/google_containers/kube-cross:KUBE_BUILD_IMAGE_CROSS_TAG
RUN touch /kube-build-image RUN touch /kube-build-image
# To run as non-root we sometimes need to rebuild go stdlib packages. # 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 ${K8S_EDGE_GOROOT}/pkg
# For running integration tests /var/run/kubernetes is required # For running integration tests /var/run/kubernetes is required
# and should be writable by user # and should be writable by user
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
FROM golang:1.7.4 FROM golang:1.7.4
ENV GOARM 6 ENV GOARM 7
ENV KUBE_DYNAMIC_CROSSPLATFORMS \ ENV KUBE_DYNAMIC_CROSSPLATFORMS \
armel \ armhf \
arm64 \ arm64 \
s390x \ s390x \
ppc64el ppc64el
...@@ -78,16 +78,11 @@ RUN export ETCD_VERSION=v3.0.14; \ ...@@ -78,16 +78,11 @@ RUN export ETCD_VERSION=v3.0.14; \
&& curl -fsSL https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz | tar -xz \ && 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/ && ln -s ../src/etcd/etcd-${ETCD_VERSION}-linux-amd64/etcd /usr/local/bin/
# TODO: Remove the patched GOROOT when we have an official golang that has a working arm and ppc64le linker # TODO: Remove the need for two golang versions; when we use go1.8 for all other builds we can remove this
ENV K8S_PATCHED_GOLANG_VERSION=1.7.4 \ ENV K8S_GOLANG_EDGE_VERSION=1.8rc2 \
K8S_PATCHED_GOROOT=/usr/local/go_k8s_patched K8S_EDGE_GOROOT=/usr/local/go_k8s_edge
RUN mkdir -p ${K8S_PATCHED_GOROOT} \ RUN mkdir -p ${K8S_EDGE_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 && curl -sSL https://golang.org/dl/go${K8S_GOLANG_EDGE_VERSION}.linux-amd64.tar.gz | tar -xz -C ${K8S_EDGE_GOROOT} --strip-components=1
# We need a patched go1.7.1 for linux/arm (https://github.com/kubernetes/kubernetes/issues/29904) # Prebuild the standard library for those platforms that need the edge GOROOT
COPY golang-patches/CL28857-go1.7.1-luxas.patch ${K8S_PATCHED_GOROOT}/ RUN for platform in linux/arm linux/ppc64le; do GOOS=${platform%/*} GOARCH=${platform##*/} GOROOT=${K8S_EDGE_GOROOT} go install std; done
RUN cd ${K8S_PATCHED_GOROOT} \
&& patch -p1 < CL28857-go1.7.1-luxas.patch \
&& cd src \
&& GOROOT_FINAL=${K8S_PATCHED_GOROOT} GOROOT_BOOTSTRAP=/usr/local/go ./make.bash \
&& for platform in linux/arm; do GOOS=${platform%/*} GOARCH=${platform##*/} GOROOT=${K8S_PATCHED_GOROOT} go install std; done
...@@ -22,13 +22,14 @@ CNI_RELEASE?=07a8a28637e97b22eb8dfe710eeae1344f69d16e ...@@ -22,13 +22,14 @@ CNI_RELEASE?=07a8a28637e97b22eb8dfe710eeae1344f69d16e
CNI_TARBALL=cni-$(ARCH)-$(CNI_RELEASE).tar.gz CNI_TARBALL=cni-$(ARCH)-$(CNI_RELEASE).tar.gz
CUR_DIR=$(shell pwd) CUR_DIR=$(shell pwd)
OUTPUT_DIR=$(CUR_DIR)/output OUTPUT_DIR=$(CUR_DIR)/output
GOLANG_VERSION=1.7.4
all: build all: build
build: build:
mkdir -p $(OUTPUT_DIR) mkdir -p $(OUTPUT_DIR)
docker run -it -v $(OUTPUT_DIR):/output golang:1.6 /bin/bash -c "\ docker run -it -v $(OUTPUT_DIR):/output golang:$(GOLANG_VERSION) /bin/bash -c "\
git clone https://github.com/containernetworking/cni\ git clone https://github.com/containernetworking/cni\
&& cd cni \ && cd cni \
&& git checkout $(CNI_RELEASE) \ && git checkout $(CNI_RELEASE) \
......
...@@ -33,15 +33,6 @@ KUBE_ROOT=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd -P) ...@@ -33,15 +33,6 @@ KUBE_ROOT=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd -P)
source "${KUBE_ROOT}/hack/lib/init.sh" source "${KUBE_ROOT}/hack/lib/init.sh"
# Set KUBE_BUILD_PPC64LE to y to build for ppc64le in addition to other
# platforms.
# TODO(IBM): remove KUBE_BUILD_PPC64LE and reenable ppc64le compilation by
# default when
# https://github.com/kubernetes/kubernetes/issues/30384 and
# https://github.com/kubernetes/kubernetes/issues/25886 are fixed.
# The majority of the logic is in hack/lib/golang.sh.
readonly KUBE_BUILD_PPC64LE="${KUBE_BUILD_PPC64LE:-n}"
# Constants # Constants
readonly KUBE_BUILD_IMAGE_REPO=kube-build readonly KUBE_BUILD_IMAGE_REPO=kube-build
readonly KUBE_BUILD_IMAGE_CROSS_TAG="$(cat ${KUBE_ROOT}/build/build-image/cross/VERSION)" readonly KUBE_BUILD_IMAGE_CROSS_TAG="$(cat ${KUBE_ROOT}/build/build-image/cross/VERSION)"
...@@ -94,6 +85,7 @@ readonly KUBE_CONTAINER_RSYNC_PORT=8730 ...@@ -94,6 +85,7 @@ readonly KUBE_CONTAINER_RSYNC_PORT=8730
# #
# $1 - server architecture # $1 - server architecture
kube::build::get_docker_wrapped_binaries() { kube::build::get_docker_wrapped_binaries() {
debian_iptables_version=v6
case $1 in case $1 in
"amd64") "amd64")
local targets=( local targets=(
...@@ -101,7 +93,7 @@ kube::build::get_docker_wrapped_binaries() { ...@@ -101,7 +93,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,busybox kube-controller-manager,busybox
kube-scheduler,busybox kube-scheduler,busybox
kube-aggregator,busybox kube-aggregator,busybox
kube-proxy,gcr.io/google_containers/debian-iptables-amd64:v5 kube-proxy,gcr.io/google_containers/debian-iptables-amd64:${debian_iptables_version}
);; );;
"arm") "arm")
local targets=( local targets=(
...@@ -109,7 +101,7 @@ kube::build::get_docker_wrapped_binaries() { ...@@ -109,7 +101,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,armel/busybox kube-controller-manager,armel/busybox
kube-scheduler,armel/busybox kube-scheduler,armel/busybox
kube-aggregator,armel/busybox kube-aggregator,armel/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-arm:v5 kube-proxy,gcr.io/google_containers/debian-iptables-arm:${debian_iptables_version}
);; );;
"arm64") "arm64")
local targets=( local targets=(
...@@ -117,7 +109,7 @@ kube::build::get_docker_wrapped_binaries() { ...@@ -117,7 +109,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,aarch64/busybox kube-controller-manager,aarch64/busybox
kube-scheduler,aarch64/busybox kube-scheduler,aarch64/busybox
kube-aggregator,aarch64/busybox kube-aggregator,aarch64/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-arm64:v5 kube-proxy,gcr.io/google_containers/debian-iptables-arm64:${debian_iptables_version}
);; );;
"ppc64le") "ppc64le")
local targets=( local targets=(
...@@ -125,7 +117,7 @@ kube::build::get_docker_wrapped_binaries() { ...@@ -125,7 +117,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,ppc64le/busybox kube-controller-manager,ppc64le/busybox
kube-scheduler,ppc64le/busybox kube-scheduler,ppc64le/busybox
kube-aggregator,ppc64le/busybox kube-aggregator,ppc64le/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-ppc64le:v5 kube-proxy,gcr.io/google_containers/debian-iptables-ppc64le:${debian_iptables_version}
);; );;
"s390x") "s390x")
local targets=( local targets=(
...@@ -133,7 +125,7 @@ kube::build::get_docker_wrapped_binaries() { ...@@ -133,7 +125,7 @@ kube::build::get_docker_wrapped_binaries() {
kube-controller-manager,s390x/busybox kube-controller-manager,s390x/busybox
kube-scheduler,s390x/busybox kube-scheduler,s390x/busybox
kube-aggregator,s390x/busybox kube-aggregator,s390x/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-s390x:v5 kube-proxy,gcr.io/google_containers/debian-iptables-s390x:${debian_iptables_version}
);; );;
esac esac
...@@ -558,7 +550,6 @@ function kube::build::run_build_command_ex() { ...@@ -558,7 +550,6 @@ function kube::build::run_build_command_ex() {
docker_run_opts+=( docker_run_opts+=(
--env "KUBE_FASTBUILD=${KUBE_FASTBUILD:-false}" --env "KUBE_FASTBUILD=${KUBE_FASTBUILD:-false}"
--env "KUBE_BUILDER_OS=${OSTYPE:-notdetected}" --env "KUBE_BUILDER_OS=${OSTYPE:-notdetected}"
--env "KUBE_BUILD_PPC64LE=${KUBE_BUILD_PPC64LE}" # TODO(IBM): remove
--env "KUBE_VERBOSE=${KUBE_VERBOSE}" --env "KUBE_VERBOSE=${KUBE_VERBOSE}"
) )
......
...@@ -21,7 +21,8 @@ CROSS_BUILD_COPY qemu-ARCH-static /usr/bin/ ...@@ -21,7 +21,8 @@ CROSS_BUILD_COPY qemu-ARCH-static /usr/bin/
# All apt-get's must be in one run command or the # All apt-get's must be in one run command or the
# cleanup has no effect. # cleanup has no effect.
RUN DEBIAN_FRONTEND=noninteractive apt-get update \ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y iptables \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y ebtables \ iptables \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y conntrack \ ebtables \
conntrack \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
...@@ -16,15 +16,16 @@ ...@@ -16,15 +16,16 @@
REGISTRY?="gcr.io/google_containers" REGISTRY?="gcr.io/google_containers"
IMAGE=debian-iptables IMAGE=debian-iptables
TAG=v5 TAG=v6
ARCH?=amd64 ARCH?=amd64
TEMP_DIR:=$(shell mktemp -d) TEMP_DIR:=$(shell mktemp -d)
QEMUVERSION=v2.7.0
ifeq ($(ARCH),amd64) ifeq ($(ARCH),amd64)
BASEIMAGE?=debian:jessie BASEIMAGE?=debian:jessie
endif endif
ifeq ($(ARCH),arm) ifeq ($(ARCH),arm)
BASEIMAGE?=armel/debian:jessie BASEIMAGE?=armhf/debian:jessie
QEMUARCH=arm QEMUARCH=arm
endif endif
ifeq ($(ARCH),arm64) ifeq ($(ARCH),arm64)
...@@ -52,7 +53,7 @@ else ...@@ -52,7 +53,7 @@ else
# When cross-building, only the placeholder "CROSS_BUILD_" should be removed # When cross-building, only the placeholder "CROSS_BUILD_" should be removed
# Register /usr/bin/qemu-ARCH-static as the handler for ARM binaries in the kernel # Register /usr/bin/qemu-ARCH-static as the handler for ARM binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static:register --reset docker run --rm --privileged multiarch/qemu-user-static:register --reset
curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/v2.6.0/x86_64_qemu-$(QEMUARCH)-static.tar.gz | tar -xz -C $(TEMP_DIR) curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/$(QEMUVERSION)/x86_64_qemu-$(QEMUARCH)-static.tar.gz | tar -xz -C $(TEMP_DIR)
cd $(TEMP_DIR) && sed -i "s/CROSS_BUILD_//g" Dockerfile cd $(TEMP_DIR) && sed -i "s/CROSS_BUILD_//g" Dockerfile
endif endif
......
### Version 6.3 (Fri January 27 2017 Lucas Käldström <lucas.kaldstrom@hotmail.co.uk>)
- Updated the arm base image to `armhf/busybox` and now using qemu v2.7 for emulation.
### Version 6.2 (Thu January 12 2017 Zihong Zheng <zihongz@google.com>) ### Version 6.2 (Thu January 12 2017 Zihong Zheng <zihongz@google.com>)
- Update kubectl to the stable version. - Update kubectl to the stable version.
......
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
IMAGE=gcr.io/google-containers/kube-addon-manager IMAGE=gcr.io/google-containers/kube-addon-manager
ARCH?=amd64 ARCH?=amd64
TEMP_DIR:=$(shell mktemp -d) TEMP_DIR:=$(shell mktemp -d)
VERSION=v6.2 VERSION=v6.3
KUBECTL_VERSION?=v1.5.2 KUBECTL_VERSION?=v1.5.2
ifeq ($(ARCH),amd64) ifeq ($(ARCH),amd64)
BASEIMAGE?=bashell/alpine-bash BASEIMAGE?=bashell/alpine-bash
endif endif
ifeq ($(ARCH),arm) ifeq ($(ARCH),arm)
BASEIMAGE?=armel/debian BASEIMAGE?=armhf/debian
endif endif
ifeq ($(ARCH),arm64) ifeq ($(ARCH),arm64)
BASEIMAGE?=aarch64/debian BASEIMAGE?=aarch64/debian
......
...@@ -30,15 +30,15 @@ TAGS?=2.2.1 2.3.7 3.0.14 ...@@ -30,15 +30,15 @@ TAGS?=2.2.1 2.3.7 3.0.14
REGISTRY_TAG?=3.0.14 REGISTRY_TAG?=3.0.14
ARCH?=amd64 ARCH?=amd64
REGISTRY?=gcr.io/google_containers REGISTRY?=gcr.io/google_containers
GOLANG_VERSION?=1.6.3 GOLANG_VERSION?=1.7.4
GOARM=6 GOARM=7
TEMP_DIR:=$(shell mktemp -d) TEMP_DIR:=$(shell mktemp -d)
ifeq ($(ARCH),amd64) ifeq ($(ARCH),amd64)
BASEIMAGE?=busybox BASEIMAGE?=busybox
endif endif
ifeq ($(ARCH),arm) ifeq ($(ARCH),arm)
BASEIMAGE?=armel/busybox BASEIMAGE?=armhf/busybox
endif endif
ifeq ($(ARCH),arm64) ifeq ($(ARCH),arm64)
BASEIMAGE?=aarch64/busybox BASEIMAGE?=aarch64/busybox
......
...@@ -22,6 +22,7 @@ ARCH?=amd64 ...@@ -22,6 +22,7 @@ ARCH?=amd64
TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX) TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX)
CNI_RELEASE=07a8a28637e97b22eb8dfe710eeae1344f69d16e CNI_RELEASE=07a8a28637e97b22eb8dfe710eeae1344f69d16e
CACHEBUST?=1 CACHEBUST?=1
QEMUVERSION=v2.7.0
UNAME_S:=$(shell uname -s) UNAME_S:=$(shell uname -s)
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
...@@ -35,7 +36,7 @@ ifeq ($(ARCH),amd64) ...@@ -35,7 +36,7 @@ ifeq ($(ARCH),amd64)
BASEIMAGE?=debian:jessie BASEIMAGE?=debian:jessie
endif endif
ifeq ($(ARCH),arm) ifeq ($(ARCH),arm)
BASEIMAGE?=armel/debian:jessie BASEIMAGE?=armhf/debian:jessie
QEMUARCH=arm QEMUARCH=arm
endif endif
ifeq ($(ARCH),arm64) ifeq ($(ARCH),arm64)
...@@ -104,7 +105,7 @@ else ...@@ -104,7 +105,7 @@ else
# When cross-building, only the placeholder "CROSS_BUILD_" should be removed # When cross-building, only the placeholder "CROSS_BUILD_" should be removed
# Register /usr/bin/qemu-ARCH-static as the handler for ARM binaries in the kernel # Register /usr/bin/qemu-ARCH-static as the handler for ARM binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static:register --reset docker run --rm --privileged multiarch/qemu-user-static:register --reset
curl -sSL --retry 5 https://github.com/multiarch/qemu-user-static/releases/download/v2.5.0/x86_64_qemu-${QEMUARCH}-static.tar.xz | tar -xJ -C ${TEMP_DIR} curl -sSL --retry 5 https://github.com/multiarch/qemu-user-static/releases/download/$(QEMUVERSION)/x86_64_qemu-${QEMUARCH}-static.tar.gz | tar -xz -C ${TEMP_DIR}
endif endif
# Download CNI # Download CNI
curl -sSL --retry 5 https://storage.googleapis.com/kubernetes-release/network-plugins/cni-${ARCH}-${CNI_RELEASE}.tar.gz | tar -xz -C ${TEMP_DIR}/cni-bin curl -sSL --retry 5 https://storage.googleapis.com/kubernetes-release/network-plugins/cni-${ARCH}-${CNI_RELEASE}.tar.gz | tar -xz -C ${TEMP_DIR}/cni-bin
......
...@@ -29,7 +29,7 @@ ifeq ($(ARCH),amd64) ...@@ -29,7 +29,7 @@ ifeq ($(ARCH),amd64)
BASEIMAGE?=debian:jessie BASEIMAGE?=debian:jessie
endif endif
ifeq ($(ARCH),arm) ifeq ($(ARCH),arm)
BASEIMAGE?=armel/debian:jessie BASEIMAGE?=armhf/debian:jessie
endif endif
ifeq ($(ARCH),arm64) ifeq ($(ARCH),arm64)
BASEIMAGE?=aarch64/debian:jessie BASEIMAGE?=aarch64/debian:jessie
......
...@@ -74,47 +74,37 @@ if [[ "${KUBE_FASTBUILD:-}" == "true" ]]; then ...@@ -74,47 +74,37 @@ if [[ "${KUBE_FASTBUILD:-}" == "true" ]]; then
else else
# The server platform we are building on. # The server platform we are building on.
KUBE_SERVER_PLATFORMS=( readonly KUBE_SERVER_PLATFORMS=(
linux/amd64 linux/amd64
linux/arm linux/arm
linux/arm64 linux/arm64
linux/s390x linux/s390x
linux/ppc64le
) )
if [[ "${KUBE_BUILD_PPC64LE:-}" =~ ^[yY]$ ]]; then
KUBE_SERVER_PLATFORMS+=(linux/ppc64le)
fi
readonly KUBE_SERVER_PLATFORMS
# The node platforms we build for # The node platforms we build for
KUBE_NODE_PLATFORMS=( readonly KUBE_NODE_PLATFORMS=(
linux/amd64 linux/amd64
linux/arm linux/arm
linux/arm64 linux/arm64
linux/s390x linux/s390x
linux/ppc64le
windows/amd64 windows/amd64
) )
if [[ "${KUBE_BUILD_PPC64LE:-}" =~ ^[yY]$ ]]; then
KUBE_NODE_PLATFORMS+=(linux/ppc64le)
fi
readonly KUBE_NODE_PLATFORMS
# If we update this we should also update the set of golang compilers we build # If we update this we should also update the set of platforms whose standard library is precompiled for in build/build-image/cross/Dockerfile
# in 'build/build-image/cross/Dockerfile'. However, it's only a bit faster since go 1.5, not mandatory readonly KUBE_CLIENT_PLATFORMS=(
KUBE_CLIENT_PLATFORMS=(
linux/amd64 linux/amd64
linux/386 linux/386
linux/arm linux/arm
linux/arm64 linux/arm64
linux/s390x
linux/ppc64le
darwin/amd64 darwin/amd64
darwin/386 darwin/386
windows/amd64 windows/amd64
windows/386 windows/386
linux/s390x
) )
if [[ "${KUBE_BUILD_PPC64LE:-}" =~ ^[yY]$ ]]; then
KUBE_CLIENT_PLATFORMS+=(linux/ppc64le)
fi
readonly KUBE_CLIENT_PLATFORMS
# Which platforms we should compile test targets for. Not all client platforms need these tests # Which platforms we should compile test targets for. Not all client platforms need these tests
readonly KUBE_TEST_PLATFORMS=( readonly KUBE_TEST_PLATFORMS=(
...@@ -274,9 +264,9 @@ kube::golang::set_platform_envs() { ...@@ -274,9 +264,9 @@ kube::golang::set_platform_envs() {
case "${platform}" in case "${platform}" in
"linux/arm") "linux/arm")
export CGO_ENABLED=1 export CGO_ENABLED=1
export CC=arm-linux-gnueabi-gcc export CC=arm-linux-gnueabihf-gcc
# See https://github.com/kubernetes/kubernetes/issues/29904 # Use a special edge version of golang since the stable golang version used for everything else doesn't work
export GOROOT=${K8S_PATCHED_GOROOT} export GOROOT=${K8S_EDGE_GOROOT}
;; ;;
"linux/arm64") "linux/arm64")
export CGO_ENABLED=1 export CGO_ENABLED=1
...@@ -285,6 +275,8 @@ kube::golang::set_platform_envs() { ...@@ -285,6 +275,8 @@ kube::golang::set_platform_envs() {
"linux/ppc64le") "linux/ppc64le")
export CGO_ENABLED=1 export CGO_ENABLED=1
export CC=powerpc64le-linux-gnu-gcc export CC=powerpc64le-linux-gnu-gcc
# Use a special edge version of golang since the stable golang version used for everything else doesn't work
export GOROOT=${K8S_EDGE_GOROOT}
;; ;;
"linux/s390x") "linux/s390x")
export CGO_ENABLED=1 export CGO_ENABLED=1
...@@ -513,7 +505,13 @@ kube::golang::build_binaries_for_platform() { ...@@ -513,7 +505,13 @@ kube::golang::build_binaries_for_platform() {
local -a nonstatics=() local -a nonstatics=()
local -a tests=() local -a tests=()
V=2 kube::log::info "Env for ${platform}: GOOS=${GOOS-} GOARCH=${GOARCH-} GOROOT=${GOROOT-} CGO_ENABLED=${CGO_ENABLED-} CC=${CC-}" # Temporary workaround while we have two GOROOT's (which we'll get rid of as soon as we upgrade to go1.8 for amd64 as well)
local GO=go
if [[ "${GOROOT}" == "${K8S_EDGE_GOROOT:-}" ]]; then
GO="${K8S_EDGE_GOROOT}/bin/go"
fi
V=2 kube::log::info "Env for ${platform}: GOOS=${GOOS-} GOARCH=${GOARCH-} GOROOT=${GOROOT-} CGO_ENABLED=${CGO_ENABLED-} CC=${CC-} GO=${GO}"
for binary in "${binaries[@]}"; do for binary in "${binaries[@]}"; do
...@@ -530,16 +528,11 @@ kube::golang::build_binaries_for_platform() { ...@@ -530,16 +528,11 @@ kube::golang::build_binaries_for_platform() {
kube::golang::fallback_if_stdlib_not_installable; kube::golang::fallback_if_stdlib_not_installable;
fi fi
# TODO: Remove this temporary workaround when we have the official golang linker working
if [[ ${platform} == "linux/arm" ]]; then
gogcflags="${gogcflags} -largemodel"
fi
if [[ -n ${use_go_build:-} ]]; then if [[ -n ${use_go_build:-} ]]; then
kube::log::progress " " kube::log::progress " "
for binary in "${statics[@]:+${statics[@]}}"; do for binary in "${statics[@]:+${statics[@]}}"; do
local outfile=$(kube::golang::output_filename_for_binary "${binary}" "${platform}") local outfile=$(kube::golang::output_filename_for_binary "${binary}" "${platform}")
CGO_ENABLED=0 go build -o "${outfile}" \ CGO_ENABLED=0 "${GO}" build -o "${outfile}" \
"${goflags[@]:+${goflags[@]}}" \ "${goflags[@]:+${goflags[@]}}" \
-gcflags "${gogcflags}" \ -gcflags "${gogcflags}" \
-ldflags "${goldflags}" \ -ldflags "${goldflags}" \
...@@ -548,7 +541,7 @@ kube::golang::build_binaries_for_platform() { ...@@ -548,7 +541,7 @@ kube::golang::build_binaries_for_platform() {
done done
for binary in "${nonstatics[@]:+${nonstatics[@]}}"; do for binary in "${nonstatics[@]:+${nonstatics[@]}}"; do
local outfile=$(kube::golang::output_filename_for_binary "${binary}" "${platform}") local outfile=$(kube::golang::output_filename_for_binary "${binary}" "${platform}")
go build -o "${outfile}" \ "${GO}" build -o "${outfile}" \
"${goflags[@]:+${goflags[@]}}" \ "${goflags[@]:+${goflags[@]}}" \
-gcflags "${gogcflags}" \ -gcflags "${gogcflags}" \
-ldflags "${goldflags}" \ -ldflags "${goldflags}" \
...@@ -559,13 +552,13 @@ kube::golang::build_binaries_for_platform() { ...@@ -559,13 +552,13 @@ kube::golang::build_binaries_for_platform() {
else else
# Use go install. # Use go install.
if [[ "${#nonstatics[@]}" != 0 ]]; then if [[ "${#nonstatics[@]}" != 0 ]]; then
go install "${goflags[@]:+${goflags[@]}}" \ "${GO}" install "${goflags[@]:+${goflags[@]}}" \
-gcflags "${gogcflags}" \ -gcflags "${gogcflags}" \
-ldflags "${goldflags}" \ -ldflags "${goldflags}" \
"${nonstatics[@]:+${nonstatics[@]}}" "${nonstatics[@]:+${nonstatics[@]}}"
fi fi
if [[ "${#statics[@]}" != 0 ]]; then if [[ "${#statics[@]}" != 0 ]]; then
CGO_ENABLED=0 go install -installsuffix cgo "${goflags[@]:+${goflags[@]}}" \ CGO_ENABLED=0 "${GO}" install -installsuffix cgo "${goflags[@]:+${goflags[@]}}" \
-gcflags "${gogcflags}" \ -gcflags "${gogcflags}" \
-ldflags "${goldflags}" \ -ldflags "${goldflags}" \
"${statics[@]:+${statics[@]}}" "${statics[@]:+${statics[@]}}"
...@@ -598,13 +591,13 @@ kube::golang::build_binaries_for_platform() { ...@@ -598,13 +591,13 @@ kube::golang::build_binaries_for_platform() {
# doing a staleness check on k8s.io/kubernetes/test/e2e package always # doing a staleness check on k8s.io/kubernetes/test/e2e package always
# returns true (always stale). And that's why we need to install the # returns true (always stale). And that's why we need to install the
# test package. # test package.
go install "${goflags[@]:+${goflags[@]}}" \ "${GO}" install "${goflags[@]:+${goflags[@]}}" \
-gcflags "${gogcflags}" \ -gcflags "${gogcflags}" \
-ldflags "${goldflags}" \ -ldflags "${goldflags}" \
"${testpkg}" "${testpkg}"
mkdir -p "$(dirname ${outfile})" mkdir -p "$(dirname ${outfile})"
go test -i -c \ "${GO}" test -i -c \
"${goflags[@]:+${goflags[@]}}" \ "${goflags[@]:+${goflags[@]}}" \
-gcflags "${gogcflags}" \ -gcflags "${gogcflags}" \
-ldflags "${goldflags}" \ -ldflags "${goldflags}" \
......
...@@ -26,7 +26,7 @@ BIN_DIR?=../../../../_output/dockerized/bin/linux/${ARCH} ...@@ -26,7 +26,7 @@ BIN_DIR?=../../../../_output/dockerized/bin/linux/${ARCH}
TEMP_DIR:=$(shell mktemp -d) TEMP_DIR:=$(shell mktemp -d)
BASEIMAGE_amd64=debian:jessie BASEIMAGE_amd64=debian:jessie
BASEIMAGE_arm=armel/debian:jessie BASEIMAGE_arm=armhf/debian:jessie
BASEIMAGE_arm64=aarch64/debian:jessie BASEIMAGE_arm64=aarch64/debian:jessie
BASEIMAGE_ppc64le=ppc64le/debian:jessie BASEIMAGE_ppc64le=ppc64le/debian:jessie
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
# Cross-build the serve_hostname image # Cross-build the serve_hostname image
# #
# Usage: # Usage:
# [TAG=v1.5] [PREFIX=gcr.io/google_containers] [TEST_REGISTRY=gcr.io/k8s-authenticated-test] [ARCH=amd64] [BASEIMAGE=busybox] make all # [TAG=v1.6] [PREFIX=gcr.io/google_containers] [TEST_REGISTRY=gcr.io/k8s-authenticated-test] [ARCH=amd64] [BASEIMAGE=busybox] make all
.PHONY: all push container clean .PHONY: all push container clean
TAG ?= v1.5 TAG ?= v1.6
REGISTRY ?= gcr.io/google-containers REGISTRY ?= gcr.io/google-containers
TEST_REGISTRY ?= gcr.io/k8s-authenticated-test TEST_REGISTRY ?= gcr.io/k8s-authenticated-test
...@@ -29,9 +29,9 @@ ARCH ?= amd64 ...@@ -29,9 +29,9 @@ ARCH ?= amd64
ALL_ARCH = amd64 arm arm64 ppc64le s390x ALL_ARCH = amd64 arm arm64 ppc64le s390x
GOARM=6 GOARM=7
TEMP_DIR := $(shell mktemp -d) TEMP_DIR := $(shell mktemp -d)
GOLANG_VERSION = 1.6.3 GOLANG_VERSION=1.7.4
BIN = serve_hostname BIN = serve_hostname
SRCS = serve_hostname.go SRCS = serve_hostname.go
...@@ -44,7 +44,7 @@ ifeq ($(ARCH),amd64) ...@@ -44,7 +44,7 @@ ifeq ($(ARCH),amd64)
BASEIMAGE?=busybox BASEIMAGE?=busybox
endif endif
ifeq ($(ARCH),arm) ifeq ($(ARCH),arm)
BASEIMAGE?=armel/busybox BASEIMAGE?=armhf/busybox
endif endif
ifeq ($(ARCH),arm64) ifeq ($(ARCH),arm64)
BASEIMAGE?=aarch64/busybox BASEIMAGE?=aarch64/busybox
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment