Skip to content

Commit

Permalink
Merge pull request kubernetes#32517 from luxas/fix_arm_ppc64le
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Use a patched golang version for building linux/arm

Fixes: kubernetes#29904

Right now, linux/arm is broken because of an internal limitation in Go.
I've filed an issue for it here: golang/go#17028

The affected binaries of this limitation are hyperkube and kube-apiserver, which are the largest binaries.

And when we now have a patched go 1.7.1 version for building "unsupported" but important architectures (ref: https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/multi-platform.md), we should also include the patch for ppc64le and start building ppc64le again. 

As soon as @laboger has the patch I need up on Github, I'll include ppc64le to this PR and we'll merge it

TODO:
 - [ ] ~~Update the PR with patches for ppc64le at the same time @luxas~~
 - [x] Push the new kube-cross image @ixdy 
 - [x] Run a full `make release` before to verify nothing breaks @luxas + @ixdy 
 - [ ] Cherrypick into the 1.4 branch @luxas + (who?)

@lavalamp @smarterclayton @ixdy @rsc @davecheney @wojtek-t @jfrazelle @bradfitz @david-mcmahon @pwittrock
  • Loading branch information
Kubernetes Submit Queue committed Sep 16, 2016
2 parents 32ba581 + aa045f7 commit 9bc7e36
Show file tree
Hide file tree
Showing 6 changed files with 416 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build/build-image/Dockerfile
Expand Up @@ -18,8 +18,8 @@ FROM gcr.io/google_containers/kube-cross:KUBE_BUILD_IMAGE_CROSS_TAG
# Mark this as a kube-build container
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
# 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

# The kubernetes source is expected to be mounted here. This will be the base
# of operations.
Expand Down
15 changes: 14 additions & 1 deletion build/build-image/cross/Dockerfile
Expand Up @@ -35,7 +35,7 @@ RUN for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${plat

# Install g++, then download and install protoc for generating protobuf output
RUN apt-get update \
&& apt-get install -y g++ rsync apt-utils file \
&& apt-get install -y g++ rsync apt-utils file patch \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /usr/local/src/protobuf \
Expand Down Expand Up @@ -77,3 +77,16 @@ RUN export ETCD_VERSION=v2.2.1; \
&& 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/

# TODO: Remove the patched GOROOT when we have an official golang that has a working arm and ppc64le linker
ENV K8S_PATCHED_GOLANG_VERSION=1.7.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 golang-patches/CL28857-go1.7.1-luxas.patch ${K8S_PATCHED_GOROOT}/
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
2 changes: 1 addition & 1 deletion build/build-image/cross/VERSION
@@ -1 +1 @@
v1.6.3-6
v1.6.3-7

0 comments on commit 9bc7e36

Please sign in to comment.