diff --git a/build/common.sh b/build/common.sh index 97a5fc244fc..7081ef2235e 100755 --- a/build/common.sh +++ b/build/common.sh @@ -949,9 +949,9 @@ function kube::release::package_test_tarball() { cp "${test_bins[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \ "${release_stage}/platforms/${platform}" done - for platform in "${KUBE_NODE_TEST_PLATFORMS[@]}"; do + for platform in "${KUBE_TEST_SERVER_PLATFORMS[@]}"; do mkdir -p "${release_stage}/platforms/${platform}" - cp "${KUBE_NODE_TEST_BINARIES[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \ + cp "${KUBE_TEST_SERVER_BINARIES[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \ "${release_stage}/platforms/${platform}" done diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 752349848bc..979303f5957 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -36,7 +36,6 @@ kube::golang::server_targets() { cmd/kube-controller-manager cmd/kubelet cmd/kubeadm - cmd/kubemark cmd/hyperkube plugin/cmd/kube-scheduler ) @@ -147,14 +146,16 @@ readonly KUBE_TEST_PORTABLE=( hack/lib ) -# Node test has built-in etcd and kube-apiserver, it can only be built on the -# same platforms with kube-apiserver. -readonly KUBE_NODE_TEST_TARGETS=( +# Test targets which run on the Kubernetes clusters directly, so we only +# need to target server platforms. +# These binaries will be distributed in the kubernetes-test tarball. +readonly KUBE_TEST_SERVER_TARGETS=( + cmd/kubemark vendor/github.com/onsi/ginkgo/ginkgo test/e2e_node/e2e_node.test ) -readonly KUBE_NODE_TEST_BINARIES=("${KUBE_NODE_TEST_TARGETS[@]##*/}") -readonly KUBE_NODE_TEST_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]}") +readonly KUBE_TEST_SERVER_BINARIES=("${KUBE_TEST_SERVER_TARGETS[@]##*/}") +readonly KUBE_TEST_SERVER_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]}") # Gigabytes desired for parallel platform builds. 11 is fairly # arbitrary, but is a reasonable splitting point for 2015 @@ -171,7 +172,7 @@ readonly KUBE_ALL_TARGETS=( "${KUBE_SERVER_TARGETS[@]}" "${KUBE_CLIENT_TARGETS[@]}" "${KUBE_TEST_TARGETS[@]}" - "${KUBE_NODE_TEST_TARGETS[@]}" + "${KUBE_TEST_SERVER_TARGETS[@]}" ) readonly KUBE_ALL_BINARIES=("${KUBE_ALL_TARGETS[@]##*/}") diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 73d2aba0e85..46f5f52b7cb 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -164,19 +164,23 @@ kube::util::host_platform() { echo "${host_os}/${host_arch}" } -kube::util::find-binary() { - local lookfor="${1}" - local host_platform="$(kube::util::host_platform)" - local locations=( +kube::util::find-binary-for-platform() { + local -r lookfor="$1" + local -r platform="$2" + local -r locations=( "${KUBE_ROOT}/_output/bin/${lookfor}" - "${KUBE_ROOT}/_output/dockerized/bin/${host_platform}/${lookfor}" - "${KUBE_ROOT}/_output/local/bin/${host_platform}/${lookfor}" - "${KUBE_ROOT}/platforms/${host_platform}/${lookfor}" + "${KUBE_ROOT}/_output/dockerized/bin/${platform}/${lookfor}" + "${KUBE_ROOT}/_output/local/bin/${platform}/${lookfor}" + "${KUBE_ROOT}/platforms/${platform}/${lookfor}" ) - local bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 ) + local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 ) echo -n "${bin}" } +kube::util::find-binary() { + kube::util::find-binary-for-platform "$1" "$(kube::util::host_platform)" +} + # Run all known doc generators (today gendocs and genman for kubectl) # $1 is the directory to put those generated documents kube::util::gen-docs() { diff --git a/hack/make-rules/cross.sh b/hack/make-rules/cross.sh index f27df5f7677..08ae0d8da35 100755 --- a/hack/make-rules/cross.sh +++ b/hack/make-rules/cross.sh @@ -33,4 +33,4 @@ make all WHAT="${KUBE_CLIENT_TARGETS[*]}" KUBE_BUILD_PLATFORMS="${KUBE_CLIENT_PL make all WHAT="${KUBE_TEST_TARGETS[*]}" KUBE_BUILD_PLATFORMS="${KUBE_TEST_PLATFORMS[*]}" -make all WHAT="${KUBE_NODE_TEST_TARGETS[*]}" KUBE_BUILD_PLATFORMS="${KUBE_NODE_TEST_PLATFORMS[*]}" +make all WHAT="${KUBE_TEST_SERVER_TARGETS[*]}" KUBE_BUILD_PLATFORMS="${KUBE_TEST_SERVER_PLATFORMS[*]}" diff --git a/test/kubemark/common.sh b/test/kubemark/common.sh index 1367acc59dc..ba522e354ff 100644 --- a/test/kubemark/common.sh +++ b/test/kubemark/common.sh @@ -17,9 +17,11 @@ source "${KUBE_ROOT}/cluster/kubemark/config-default.sh" source "${KUBE_ROOT}/cluster/kubemark/util.sh" source "${KUBE_ROOT}/cluster/lib/util.sh" +source "${KUBE_ROOT}/hack/lib/init.sh" detect-project &> /dev/null export PROJECT +find-release-tars MASTER_NAME="${INSTANCE_PREFIX}-kubemark-master" MASTER_TAG="kubemark-master" diff --git a/test/kubemark/start-kubemark.sh b/test/kubemark/start-kubemark.sh index 1fc59626fe6..32fd3fb7676 100755 --- a/test/kubemark/start-kubemark.sh +++ b/test/kubemark/start-kubemark.sh @@ -46,25 +46,15 @@ sed -i'' -e "s/\"//g" "${RESOURCE_DIRECTORY}/controllers_flags" MAKE_DIR="${KUBE_ROOT}/cluster/images/kubemark" -echo "Copying kubemark to ${MAKE_DIR}" -if [[ -f "${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz" ]]; then - # Running from distro - SERVER_TARBALL="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz" - echo "Using server tarball: ${SERVER_TARBALL}" - cp "${KUBE_ROOT}/_output/release-stage/server/linux-amd64/kubernetes/server/bin/kubemark" "${MAKE_DIR}" -elif [[ -f "${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz" ]]; then - # Running from an extracted release tarball (kubernetes.tar.gz) - SERVER_TARBALL="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz" - echo "Using server tarball: ${SERVER_TARBALL}" - tar \ - --strip-components=3 \ - -xzf "${SERVER_TARBALL}" \ - -C "${MAKE_DIR}" 'kubernetes/server/bin/kubemark' || exit 1 -else - echo 'Cannot find kubernetes/server/bin/kubemark binary' +KUBEMARK_BIN="$(kube::util::find-binary-for-platform kubemark linux/amd64)" +if [[ -z "${KUBEMARK_BIN}" ]]; then + echo 'Cannot find cmd/kubemark binary' exit 1 fi +echo "Copying kubemark to ${MAKE_DIR}" +cp "${KUBEMARK_BIN}" "${MAKE_DIR}" + CURR_DIR=`pwd` cd "${MAKE_DIR}" RETRIES=3 @@ -146,7 +136,7 @@ gcloud compute ssh --zone="${ZONE}" --project="${PROJECT}" "${MASTER_NAME}" \ writeEnvironmentFiles gcloud compute copy-files --zone="${ZONE}" --project="${PROJECT}" \ - "${SERVER_TARBALL}" \ + "${SERVER_BINARY_TAR}" \ "${KUBEMARK_DIRECTORY}/start-kubemark-master.sh" \ "${KUBEMARK_DIRECTORY}/configure-kubectl.sh" \ "${RESOURCE_DIRECTORY}/apiserver_flags" \