diff --git a/build/common.sh b/build/common.sh index 42c8af73de6..b74e824d06d 100644 --- a/build/common.sh +++ b/build/common.sh @@ -51,7 +51,7 @@ readonly RELEASE_DIR="${KUBE_REPO_ROOT}/_output/release" # Basic setup functions # Verify that the right utilities and such are installed for building Kube. -function verify-prereqs() { +function kube::build::verify-prereqs() { if [[ -z "$(which docker)" ]]; then echo "Can't find 'docker' in PATH, please fix and retry." >&2 echo "See https://docs.docker.com/installation/#installation for installation instructions." >&2 @@ -83,7 +83,7 @@ function verify-prereqs() { } # Verify things are set up for uploading to GCS -function verify-gcs-prereqs() { +function kube::build::verify-gcs-prereqs() { if [[ -z "$(which gsutil)" || -z "$(which gcloud)" ]]; then echo "Releasing Kubernetes requires gsutil and gcloud. Please download," echo "install and authorize through the Google Cloud SDK: " @@ -115,7 +115,7 @@ function verify-gcs-prereqs() { # Building # Set up the context directory for the kube-build image and build it. -function build-image() { +function kube::build::build-image() { local -r BUILD_CONTEXT_DIR="${KUBE_REPO_ROOT}/_output/images/${KUBE_BUILD_IMAGE}" local -r SOURCE=" api @@ -125,20 +125,20 @@ function build-image() { Godeps hack LICENSE - README.md pkg plugin + README.md third_party " mkdir -p ${BUILD_CONTEXT_DIR} tar czf ${BUILD_CONTEXT_DIR}/kube-source.tar.gz ${SOURCE} cp build/build-image/Dockerfile ${BUILD_CONTEXT_DIR}/Dockerfile - docker-build "${KUBE_BUILD_IMAGE}" "${BUILD_CONTEXT_DIR}" + kube::build::docker-build "${KUBE_BUILD_IMAGE}" "${BUILD_CONTEXT_DIR}" } # Builds the runtime image. Assumes that the appropriate binaries are already # built and in _output/build/. -function run-image() { +function kube::build::run-image() { local -r BUILD_CONTEXT_BASE="${KUBE_REPO_ROOT}/_output/images/${KUBE_RUN_IMAGE_BASE}" # First build the base image. This one brings in all of the binaries. @@ -147,20 +147,20 @@ function run-image() { -C "_output/build/linux/amd64" \ ${KUBE_RUN_BINARIES} cp -R build/run-images/base/* "${BUILD_CONTEXT_BASE}/" - docker-build "${KUBE_RUN_IMAGE_BASE}" "${BUILD_CONTEXT_BASE}" + kube::build::docker-build "${KUBE_RUN_IMAGE_BASE}" "${BUILD_CONTEXT_BASE}" for b in $KUBE_RUN_BINARIES ; do local SUB_CONTEXT_DIR="${BUILD_CONTEXT_BASE}-$b" mkdir -p "${SUB_CONTEXT_DIR}" cp -R build/run-images/$b/* "${SUB_CONTEXT_DIR}/" - docker-build "${KUBE_RUN_IMAGE_BASE}-$b" "${SUB_CONTEXT_DIR}" + kube::build::docker-build "${KUBE_RUN_IMAGE_BASE}-$b" "${SUB_CONTEXT_DIR}" done } # Build a docker image from a Dockerfile. # $1 is the name of the image to build # $2 is the location of the "context" directory, with the Dockerfile at the root. -function docker-build() { +function kube::build::docker-build() { local -r IMAGE=$1 local -r CONTEXT_DIR=$2 local -r BUILD_CMD="docker build -t ${IMAGE} ${CONTEXT_DIR}" @@ -185,7 +185,7 @@ function docker-build() { # Run a command in the kube-build image. This assumes that the image has # already been built. This will sync out all output data from the build. -function run-build-command() { +function kube::build::run-build-command() { [[ -n "$@" ]] || { echo "Invalid input." >&2; return 4; } local -r DOCKER="docker run --rm --name=${DOCKER_CONTAINER_NAME} -it ${DOCKER_MOUNT} ${KUBE_BUILD_IMAGE}" @@ -196,7 +196,7 @@ function run-build-command() { } # If the Docker server is remote, copy the results back out. -function copy-output() { +function kube::build::copy-output() { if [[ "$OSTYPE" == "darwin"* ]]; then # When we are on the Mac with boot2docker we need to copy the results back # out. Ideally we would leave the container around and use 'docker cp' to @@ -232,7 +232,7 @@ function copy-output() { # Release # Create a unique bucket name for releasing Kube and make sure it exists. -function ensure-gcs-release-bucket() { +function kube::build::ensure-gcs-release-bucket() { if which md5 > /dev/null 2>&1; then HASH=$(md5 -q -s "$GCLOUD_PROJECT") else @@ -249,7 +249,7 @@ function ensure-gcs-release-bucket() { fi } -function ensure-gcs-docker-registry() { +function kube::build::ensure-gcs-docker-registry() { local -r REG_CONTAINER_NAME="gcs-registry" local -r RUNNING=$(docker inspect ${REG_CONTAINER_NAME} 2>/dev/null \ @@ -283,8 +283,8 @@ function ensure-gcs-docker-registry() { sleep 5 } -function push-images-to-gcs() { - ensure-gcs-docker-registry +function kube::build::push-images-to-gcs() { + kube::build::ensure-gcs-docker-registry # Tag each of our run binaries with the right registry and push for b in ${KUBE_RUN_BINARIES} ; do @@ -296,7 +296,7 @@ function push-images-to-gcs() { } # Package up all of the cross compiled clients -function package-tarballs() { +function kube::build::package-tarballs() { mkdir -p "${RELEASE_DIR}" # Find all of the built kubecfg binaries @@ -318,7 +318,7 @@ function package-tarballs() { done } -function copy-release-to-gcs() { +function kube::build::copy-release-to-gcs() { # TODO: This isn't atomic. There will be points in time where there will be # no active release. Also, if something fails, the release could be half- # copied. The real way to do this would perhaps to have some sort of release diff --git a/build/copy-output.sh b/build/copy-output.sh index 8ba6b187d84..e9c4f889d74 100755 --- a/build/copy-output.sh +++ b/build/copy-output.sh @@ -23,5 +23,5 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -copy-output +kube::build::verify-prereqs +kube::build::copy-output diff --git a/build/make-binaries.sh b/build/make-binaries.sh index 15bc65dee87..4b9d835ea6a 100755 --- a/build/make-binaries.sh +++ b/build/make-binaries.sh @@ -23,6 +23,6 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -build-image -run-build-command build/build-image/make-binaries.sh "$@" +kube::build::verify-prereqs +kube::build::build-image +kube::build::run-build-command build/build-image/make-binaries.sh "$@" diff --git a/build/make-build-image.sh b/build/make-build-image.sh index 66c465fcfbe..6206da57eaa 100755 --- a/build/make-build-image.sh +++ b/build/make-build-image.sh @@ -25,5 +25,5 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -build-image +kube::build::verify-prereqs +kube::build::build-image diff --git a/build/make-clean.sh b/build/make-clean.sh index 9d58f691bfc..b596d857810 100755 --- a/build/make-clean.sh +++ b/build/make-clean.sh @@ -20,6 +20,6 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -build-image -run-build-command rm -rf _output/build/* +kube::build::verify-prereqs +kube::build::build-image +kube::build::run-build-command rm -rf _output/build/* diff --git a/build/make-cross.sh b/build/make-cross.sh index 815a9f8f6e2..a4b5fa15b11 100755 --- a/build/make-cross.sh +++ b/build/make-cross.sh @@ -23,6 +23,6 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -build-image -run-build-command build/build-image/make-cross.sh +kube::build::verify-prereqs +kube::build::build-image +kube::build::run-build-command build/build-image/make-cross.sh diff --git a/build/make-run-image.sh b/build/make-run-image.sh index 6e6ef7cfe95..90e334c2e64 100755 --- a/build/make-run-image.sh +++ b/build/make-run-image.sh @@ -23,8 +23,8 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -build-image -run-build-command build/build-image/make-binaries.sh "$@" -copy-output -run-image +kube::build::verify-prereqs +kube::build::build-image +kube::build::run-build-command build/build-image/make-binaries.sh "$@" +kube::build::copy-output +kube::build::run-image diff --git a/build/master-manifest.yaml b/build/master-manifest.yaml index b183f34dd9a..cf43a499acd 100644 --- a/build/master-manifest.yaml +++ b/build/master-manifest.yaml @@ -8,7 +8,7 @@ containers: - name: registry image: google/docker-registry ports: - - name: registry + - name: registry hostPort: 5000 containerPort: 5000 env: @@ -44,6 +44,6 @@ containers: value: http://127.0.0.1:4001 - key: API_SERVER value: 127.0.0.1:8090 - + volumes: - name: etcddata diff --git a/build/release.sh b/build/release.sh index 0d405eb2600..5abfe2067e7 100755 --- a/build/release.sh +++ b/build/release.sh @@ -22,16 +22,16 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -verify-gcs-prereqs -ensure-gcs-release-bucket -build-image -run-build-command build/build-image/make-binaries.sh -run-build-command build/build-image/make-cross.sh -run-build-command build/build-image/run-tests.sh -run-build-command build/build-image/run-integration.sh -copy-output -run-image -package-tarballs -push-images-to-gcs -copy-release-to-gcs +kube::build::verify-prereqs +kube::build::verify-gcs-prereqs +kube::build::ensure-gcs-release-bucket +kube::build::build-image +kube::build::run-build-command build/build-image/make-binaries.sh +kube::build::run-build-command build/build-image/make-cross.sh +kube::build::run-build-command build/build-image/run-tests.sh +kube::build::run-build-command build/build-image/run-integration.sh +kube::build::copy-output +kube::build::run-image +kube::build::package-tarballs +kube::build::push-images-to-gcs +kube::build::copy-release-to-gcs diff --git a/build/run-integration.sh b/build/run-integration.sh index c4a41ba04de..012c7134dfa 100755 --- a/build/run-integration.sh +++ b/build/run-integration.sh @@ -20,7 +20,7 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -build-image -run-build-command build/build-image/make-binaries.sh "integration" -run-build-command build/build-image/run-integration.sh +kube::build::verify-prereqs +kube::build::build-image +kube::build::run-build-command build/build-image/make-binaries.sh "integration" +kube::build::run-build-command build/build-image/run-integration.sh diff --git a/build/run-tests.sh b/build/run-tests.sh index 6accabc6241..b38bb1c1867 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -20,6 +20,6 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -build-image -run-build-command build/build-image/run-tests.sh "$@" +kube::build::verify-prereqs +kube::build::build-image +kube::build::run-build-command build/build-image/run-tests.sh "$@" diff --git a/build/shell.sh b/build/shell.sh index d1bd2a4be33..7a6253d49e9 100755 --- a/build/shell.sh +++ b/build/shell.sh @@ -22,6 +22,6 @@ set -e source $(dirname $0)/common.sh -verify-prereqs -build-image -run-build-command bash +kube::build::verify-prereqs +kube::build::build-image +kube::build::run-build-command bash