From 9673ca16b208492b477930d711b6956e8a93b300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Wed, 15 Jun 2016 22:59:25 +0300 Subject: [PATCH] Enable builds for all ppc64le binaries except hyperkube --- build/common.sh | 31 +++++++++++++++++++------------ hack/lib/golang.sh | 16 +++++++++++++--- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/build/common.sh b/build/common.sh index 63b52865b39..b3d453ae7b2 100755 --- a/build/common.sh +++ b/build/common.sh @@ -126,7 +126,7 @@ kube::build::get_docker_wrapped_binaries() { kube-scheduler,ppc64le/busybox kube-proxy,gcr.io/google_containers/debian-iptables-ppc64le:v3 federation-apiserver,ppc64le/busybox - federation-controller-manager,ppc64lebusybox + federation-controller-manager,ppc64le/busybox );; esac @@ -691,8 +691,11 @@ function kube::release::package_hyperkube() { if [[ -n "${KUBE_DOCKER_IMAGE_TAG-}" && -n "${KUBE_DOCKER_REGISTRY-}" ]]; then for arch in "${KUBE_SERVER_PLATFORMS[@]##*/}"; do - kube::log::status "Building hyperkube image for arch: ${arch}" - REGISTRY="${KUBE_DOCKER_REGISTRY}" VERSION="${KUBE_DOCKER_IMAGE_TAG}" ARCH="${arch}" make -C cluster/images/hyperkube/ build + # TODO(IBM): Enable hyperkube builds for ppc64le again + if [[ ${arch} != "ppc64le" ]]; then + kube::log::status "Building hyperkube image for arch: ${arch}" + REGISTRY="${KUBE_DOCKER_REGISTRY}" VERSION="${KUBE_DOCKER_IMAGE_TAG}" ARCH="${arch}" make -C cluster/images/hyperkube/ build + fi done fi } @@ -1527,18 +1530,22 @@ function kube::release::docker::release() { for arch in "${KUBE_SERVER_PLATFORMS[@]##*/}"; do for binary in "${binaries[@]}"; do - local docker_target="${KUBE_DOCKER_REGISTRY}/${binary}-${arch}:${KUBE_DOCKER_IMAGE_TAG}" - kube::log::status "Pushing ${binary} to ${docker_target}" - "${docker_push_cmd[@]}" push "${docker_target}" + # TODO(IBM): Enable hyperkube builds for ppc64le again + if [[ ${binary} != "hyperkube" || ${arch} != "ppc64le" ]]; then - # If we have a amd64 docker image. Tag it without -amd64 also and push it for compatibility with earlier versions - if [[ ${arch} == "amd64" ]]; then - local legacy_docker_target="${KUBE_DOCKER_REGISTRY}/${binary}:${KUBE_DOCKER_IMAGE_TAG}" + local docker_target="${KUBE_DOCKER_REGISTRY}/${binary}-${arch}:${KUBE_DOCKER_IMAGE_TAG}" + kube::log::status "Pushing ${binary} to ${docker_target}" + "${docker_push_cmd[@]}" push "${docker_target}" - "${DOCKER[@]}" tag -f "${docker_target}" "${legacy_docker_target}" 2>/dev/null + # If we have a amd64 docker image. Tag it without -amd64 also and push it for compatibility with earlier versions + if [[ ${arch} == "amd64" ]]; then + local legacy_docker_target="${KUBE_DOCKER_REGISTRY}/${binary}:${KUBE_DOCKER_IMAGE_TAG}" - kube::log::status "Pushing ${binary} to ${legacy_docker_target}" - "${docker_push_cmd[@]}" push "${legacy_docker_target}" + "${DOCKER[@]}" tag -f "${docker_target}" "${legacy_docker_target}" 2>/dev/null + + kube::log::status "Pushing ${binary} to ${legacy_docker_target}" + "${docker_push_cmd[@]}" push "${legacy_docker_target}" + fi fi done done diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index eb45223147b..fbbf34b4de5 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -69,7 +69,7 @@ else linux/amd64 linux/arm linux/arm64 - #linux/ppc64le # temporarily disabled due to a linking error + linux/ppc64le # note: hyperkube is temporarily disabled due to a linking error ) # If we update this we should also update the set of golang compilers we build @@ -79,7 +79,7 @@ else linux/386 linux/arm linux/arm64 - #linux/ppc64le # temporarily disabled due to a linking error + linux/ppc64le darwin/amd64 darwin/386 windows/amd64 @@ -454,7 +454,16 @@ kube::golang::build_binaries_for_platform() { local -a nonstatics=() local -a tests=() for binary in "${binaries[@]}"; do - if [[ "${binary}" =~ ".test"$ ]]; then + + # TODO(IBM): Enable hyperkube builds for ppc64le again + # The current workaround creates a text file with help text instead of a binary + # We're doing it this way so the build system isn't affected so much + if [[ "${binary}" == *"hyperkube" && "${platform}" == "linux/ppc64le" ]]; then + echo "hyperkube build for ppc64le is disabled. Creating dummy text file instead." + local outfile=$(kube::golang::output_filename_for_binary "${binary}" "${platform}") + mkdir -p $(dirname ${outfile}) + echo "Not available at the moment. Please see: https://github.com/kubernetes/kubernetes/issues/25886 for more information." > ${outfile} + elif [[ "${binary}" =~ ".test"$ ]]; then tests+=($binary) elif kube::golang::is_statically_linked_library "${binary}"; then statics+=($binary) @@ -462,6 +471,7 @@ kube::golang::build_binaries_for_platform() { nonstatics+=($binary) fi done + if [[ "${#statics[@]}" != 0 ]]; then kube::golang::fallback_if_stdlib_not_installable; fi