Skip to content

Commit

Permalink
rename build/ to build-tools/
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedanese committed Oct 24, 2016
1 parent dfe801d commit 27116c6
Show file tree
Hide file tree
Showing 69 changed files with 82 additions and 82 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ test-cmd: generated_files
# TODO(thockin): call clean_generated when we stop committing generated code.
.PHONY: clean
clean: clean_meta
build/make-clean.sh
build-tools/make-clean.sh
rm -rf $(OUT_DIR)
rm -rf Godeps/_workspace # Just until we are sure it is gone

Expand Down Expand Up @@ -236,15 +236,15 @@ vet:
# make release
.PHONY: release
release:
build/release.sh
build-tools/release.sh

# Build a release, but skip tests
#
# Example:
# make release-skip-tests
.PHONY: release-skip-tests quick-release
release-skip-tests quick-release:
KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh
KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build-tools/release.sh

# Cross-compile for all platforms
#
Expand Down
File renamed without changes.
File renamed without changes.
28 changes: 14 additions & 14 deletions build/README.md → build-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ While it is possible to build Kubernetes using a local golang installation, we h

## Key scripts

The following scripts are found in the `build/` directory. Note that all scripts must be run from the Kubernetes root directory.

* `build/run.sh`: Run a command in a build docker container. Common invocations:
* `build/run.sh make`: Build just linux binaries in the container. Pass options and packages as necessary.
* `build/run.sh make cross`: Build all binaries for all platforms
* `build/run.sh make test`: Run all unit tests
* `build/run.sh make test-integration`: Run integration test
* `build/run.sh make test-cmd`: Run CLI tests
* `build/copy-output.sh`: This will copy the contents of `_output/dockerized/bin` from the Docker container to the local `_output/dockerized/bin`. It will also copy out specific file patterns that are generated as part of the build process. This is run automatically as part of `build/run.sh`.
* `build/make-clean.sh`: Clean out the contents of `_output`, remove any locally built container images and remove the data container.
* `/build/shell.sh`: Drop into a `bash` shell in a build container with a snapshot of the current repo code.
The following scripts are found in the `build-tools/` directory. Note that all scripts must be run from the Kubernetes root directory.

* `build-tools/run.sh`: Run a command in a build docker container. Common invocations:
* `build-tools/run.sh make`: Build just linux binaries in the container. Pass options and packages as necessary.
* `build-tools/run.sh make cross`: Build all binaries for all platforms
* `build-tools/run.sh make test`: Run all unit tests
* `build-tools/run.sh make test-integration`: Run integration test
* `build-tools/run.sh make test-cmd`: Run CLI tests
* `build-tools/copy-output.sh`: This will copy the contents of `_output/dockerized/bin` from the Docker container to the local `_output/dockerized/bin`. It will also copy out specific file patterns that are generated as part of the build process. This is run automatically as part of `build-tools/run.sh`.
* `build-tools/make-clean.sh`: Clean out the contents of `_output`, remove any locally built container images and remove the data container.
* `/build-tools/shell.sh`: Drop into a `bash` shell in a build container with a snapshot of the current repo code.

## Basic Flow

The scripts directly under `build/` are used to build and test. They will ensure that the `kube-build` Docker image is built (based on `build/build-image/Dockerfile`) and then execute the appropriate command in that container. These scripts will both ensure that the right data is cached from run to run for incremental builds and will copy the results back out of the container.
The scripts directly under `build-tools/` are used to build and test. They will ensure that the `kube-build` Docker image is built (based on `build-tools/build-image/Dockerfile`) and then execute the appropriate command in that container. These scripts will both ensure that the right data is cached from run to run for incremental builds and will copy the results back out of the container.

The `kube-build` container image is built by first creating a "context" directory in `_output/images/build-image`. It is done there instead of at the root of the Kubernetes repo to minimize the amount of data we need to package up when building the image.

Expand Down Expand Up @@ -92,7 +92,7 @@ Look at `docker-machine stop`, `docker-machine start` and `docker-machine rm` to

## Releasing

The `build/release.sh` script will build a release. It will build binaries, run tests, (optionally) build runtime Docker images.
The `build-tools/release.sh` script will build a release. It will build binaries, run tests, (optionally) build runtime Docker images.

The main output is a tar file: `kubernetes.tar.gz`. This includes:
* Cross compiled client utilities.
Expand All @@ -109,4 +109,4 @@ In addition, there are some other tar files that are created:

When building final release tars, they are first staged into `_output/release-stage` before being tar'd up and put into `_output/release-tars`.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build/README.md?pixel)]()
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build-tools/README.md?pixel)]()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions build/common.sh → build-tools/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ readonly KUBE_BUILD_PPC64LE="${KUBE_BUILD_PPC64LE:-n}"

# Constants
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-tools/build-image/cross/VERSION)"

# This version number is used to cause everyone to rebuild their data containers
# and build image. This is especially useful for automated build systems like
# Jenkins.
#
# Increment/change this number if you change the build image (anything under
# build/build-image) or change the set of volumes in the data container.
readonly KUBE_BUILD_IMAGE_VERSION_BASE="$(cat ${KUBE_ROOT}/build/build-image/VERSION)"
# build-tools/build-image) or change the set of volumes in the data container.
readonly KUBE_BUILD_IMAGE_VERSION_BASE="$(cat ${KUBE_ROOT}/build-tools/build-image/VERSION)"
readonly KUBE_BUILD_IMAGE_VERSION="${KUBE_BUILD_IMAGE_VERSION_BASE}-${KUBE_BUILD_IMAGE_CROSS_TAG}"

# Here we map the output directories across both the local and remote _output
Expand Down Expand Up @@ -421,8 +421,8 @@ function kube::build::build_image() {

cp /etc/localtime "${LOCAL_OUTPUT_BUILD_CONTEXT}/"

cp build/build-image/Dockerfile "${LOCAL_OUTPUT_BUILD_CONTEXT}/Dockerfile"
cp build/build-image/rsyncd.sh "${LOCAL_OUTPUT_BUILD_CONTEXT}/"
cp build-tools/build-image/Dockerfile "${LOCAL_OUTPUT_BUILD_CONTEXT}/Dockerfile"
cp build-tools/build-image/rsyncd.sh "${LOCAL_OUTPUT_BUILD_CONTEXT}/"
dd if=/dev/urandom bs=512 count=1 2>/dev/null | LC_ALL=C tr -dc 'A-Za-z0-9' | dd bs=32 count=1 2>/dev/null > "${LOCAL_OUTPUT_BUILD_CONTEXT}/rsyncd.password"
chmod go= "${LOCAL_OUTPUT_BUILD_CONTEXT}/rsyncd.password"

Expand Down Expand Up @@ -640,7 +640,7 @@ function kube::build::start_rsyncd_container() {
return 0
fi

kube::log::error "Could not connect to rsync container. See build/README.md for setting up remote Docker engine."
kube::log::error "Could not connect to rsync container. See build-tools/README.md for setting up remote Docker engine."
return 1
}

Expand Down
2 changes: 1 addition & 1 deletion build/copy-output.sh → build-tools/copy-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/build/common.sh"
source "${KUBE_ROOT}/build-tools/common.sh"

kube::build::verify_prereqs
kube::build::copy_output
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ $ make push ARCH=ppc64le
If you don't want to push the images, run `make` or `make build` instead


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build/debian-iptables/README.md?pixel)]()
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build-tools/debian-iptables/README.md?pixel)]()
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Tim Hockin <thockin@google.com>

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build/kube-dns/MAINTAINERS.md?pixel)]()
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build-tools/kube-dns/MAINTAINERS.md?pixel)]()
2 changes: 1 addition & 1 deletion build/kube-dns/Makefile → build-tools/kube-dns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ all: container
container:
# Copy the content in this dir to the temp dir
cp $(KUBE_ROOT)/_output/dockerized/bin/$(PLATFORM)/$(ARCH)/kube-dns $(TEMP_DIR)
cp $(KUBE_ROOT)/build/kube-dns/Dockerfile $(TEMP_DIR)
cp $(KUBE_ROOT)/build-tools/kube-dns/Dockerfile $(TEMP_DIR)

# Replace BASEIMAGE with the real base image
cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,4 @@ of the version number for the `kube-dns` replication controller and well as the
`version` label. This will permit a rolling update of `kube-dns`.


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build/kube-dns/README.md?pixel)]()
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build-tools/kube-dns/README.md?pixel)]()
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ are ready, not on every PR.

```
make release
cd build/kube-dns
cd build-tools/kube-dns
make container PREFIX=<your-docker-hub> TAG=rc
```

Expand Down Expand Up @@ -45,4 +45,4 @@ make container PREFIX=<your-docker-hub> TAG=rc
8. Allow the PR to be merged.


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build/kube-dns/RELEASES.md?pixel)]()
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build-tools/kube-dns/RELEASES.md?pixel)]()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set -o nounset
set -o pipefail

KUBE_ROOT="$(dirname "${BASH_SOURCE}")/.."
source "${KUBE_ROOT}/build/common.sh"
source "${KUBE_ROOT}/build-tools/common.sh"

kube::build::verify_prereqs
kube::build::build_image
2 changes: 1 addition & 1 deletion build/make-clean.sh → build-tools/make-clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/build/common.sh"
source "${KUBE_ROOT}/build-tools/common.sh"

kube::build::verify_prereqs
kube::build::clean
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..

source "${KUBE_ROOT}/build/util.sh"
source "${KUBE_ROOT}/build-tools/util.sh"

source "${KUBE_ROOT}/federation/cluster/common.sh"

Expand Down
6 changes: 3 additions & 3 deletions build/release.sh → build-tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/build/common.sh"
source "${KUBE_ROOT}/build/lib/release.sh"
source "${KUBE_ROOT}/build-tools/common.sh"
source "${KUBE_ROOT}/build-tools/lib/release.sh"

KUBE_RELEASE_RUN_TESTS=${KUBE_RELEASE_RUN_TESTS-y}

Expand All @@ -44,7 +44,7 @@ kube::build::copy_output

if [[ "${FEDERATION:-}" == "true" ]];then
(
source "${KUBE_ROOT}/build/util.sh"
source "${KUBE_ROOT}/build-tools/util.sh"
# Write federated docker image tag to workspace
kube::release::semantic_image_tag_version > "${KUBE_ROOT}/federation/manifests/federated-image.tag"
)
Expand Down
2 changes: 1 addition & 1 deletion build/run.sh → build-tools/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "$KUBE_ROOT/build/common.sh"
source "$KUBE_ROOT/build-tools/common.sh"

kube::build::verify_prereqs
kube::build::build_image
Expand Down
4 changes: 2 additions & 2 deletions build/shell.sh → build-tools/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/build/common.sh"
source "${KUBE_ROOT}/build/lib/release.sh"
source "${KUBE_ROOT}/build-tools/common.sh"
source "${KUBE_ROOT}/build-tools/lib/release.sh"

kube::build::verify_prereqs
kube::build::build_image
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cluster/aws/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ function kube-push {
# KUBE_ROOT
function test-build-release {
# Make a release
"${KUBE_ROOT}/build/release.sh"
"${KUBE_ROOT}/build-tools/release.sh"
}

# Execute prior to running tests to initialize required structure. This is
Expand Down
2 changes: 1 addition & 1 deletion cluster/azure-legacy/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ function kube-down {
# KUBE_ROOT
function test-build-release {
# Make a release
"${KUBE_ROOT}/build/release.sh"
"${KUBE_ROOT}/build-tools/release.sh"
}

# SSH to a node by name ($1) and run a command ($2).
Expand Down
4 changes: 2 additions & 2 deletions cluster/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ source "${KUBE_ROOT}/cluster/lib/util.sh"
source "${KUBE_ROOT}/cluster/lib/logging.sh"
# KUBE_RELEASE_VERSION_REGEX matches things like "v1.2.3" or "v1.2.3-alpha.4"
#
# NOTE This must match the version_regex in build/common.sh
# NOTE This must match the version_regex in build-tools/common.sh
# kube::release::parse_and_validate_release_version()
KUBE_RELEASE_VERSION_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-(beta|alpha)\\.(0|[1-9][0-9]*))?$"
KUBE_RELEASE_VERSION_DASHED_REGEX="v(0|[1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)(-(beta|alpha)-(0|[1-9][0-9]*))?"

# KUBE_CI_VERSION_REGEX matches things like "v1.2.3-alpha.4.56+abcdefg" This
#
# NOTE This must match the version_regex in build/common.sh
# NOTE This must match the version_regex in build-tools/common.sh
# kube::release::parse_and_validate_ci_version()
KUBE_CI_VERSION_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)-(beta|alpha)\\.(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*)\\+[-0-9a-z]*)?$"
KUBE_CI_VERSION_DASHED_REGEX="^v(0|[1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)-(beta|alpha)-(0|[1-9][0-9]*)(-(0|[1-9][0-9]*)\\+[-0-9a-z]*)?"
Expand Down
2 changes: 1 addition & 1 deletion cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ function kube-push() {
# KUBE_ROOT
function test-build-release() {
# Make a release
"${KUBE_ROOT}/build/release.sh"
"${KUBE_ROOT}/build-tools/release.sh"
}

# Execute prior to running tests to initialize required structure. This is
Expand Down
2 changes: 1 addition & 1 deletion cluster/gke/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function detect-project() {
# KUBE_ROOT
function test-build-release() {
echo "... in gke:test-build-release()" >&2
"${KUBE_ROOT}/build/release.sh"
"${KUBE_ROOT}/build-tools/release.sh"
}

# Verify needed binaries exist.
Expand Down
2 changes: 1 addition & 1 deletion cluster/images/hyperkube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ See https://github.com/kubernetes/kubernetes/blob/master/docs/devel/local-cluste

```console
# First, build the binaries
$ build/run.sh make cross
$ build-tools/run.sh make cross

# Build for linux/amd64 (default)
$ make push VERSION={target_version} ARCH=amd64
Expand Down
2 changes: 1 addition & 1 deletion cluster/images/kube-discovery/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Build the kube-discovery image.
#
# Requires a pre-built kube-discovery binary:
# build/run.sh /bin/bash -c "KUBE_BUILD_PLATFORMS=linux/ARCH make WHAT=cmd/kube-discovery"
# build-tools/run.sh /bin/bash -c "KUBE_BUILD_PLATFORMS=linux/ARCH make WHAT=cmd/kube-discovery"
#
# Usage:
# [ARCH=amd64] [REGISTRY="gcr.io/google_containers"] make (build|push) VERSION={some_released_version_of_kubernetes}
Expand Down
2 changes: 1 addition & 1 deletion cluster/images/kube-discovery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ cat token-map.json
## Build And Run From Source

```
$ build/run.sh /bin/bash -c "KUBE_BUILD_PLATFORMS=linux/amd64 make WHAT=cmd/kube-discovery"
$ build-tools/run.sh /bin/bash -c "KUBE_BUILD_PLATFORMS=linux/amd64 make WHAT=cmd/kube-discovery"
$ _output/dockerized/bin/linux/amd64/kube-discovery
2016/08/23 19:17:28 Listening for requests on port 9898.
Expand Down
2 changes: 1 addition & 1 deletion cluster/kubectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ if [[ -z "${KUBECTL_PATH:-}" ]]; then
echo "It looks as if you don't have a compiled kubectl binary"
echo
echo "If you are running from a clone of the git repo, please run"
echo "'./build/run.sh make cross'. Note that this requires having"
echo "'./build-tools/run.sh make cross'. Note that this requires having"
echo "Docker installed."
echo
echo "If you are running from a binary release tarball, something is wrong. "
Expand Down
2 changes: 1 addition & 1 deletion cluster/mesos/docker/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function prepare-e2e {
function test-build-release {
# Make a release
export KUBE_RELEASE_RUN_TESTS=N
"${KUBE_ROOT}/build/release.sh"
"${KUBE_ROOT}/build-tools/release.sh"
}

# Must ensure that the following ENV vars are set
Expand Down
2 changes: 1 addition & 1 deletion cluster/ubuntu/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NODE_IPS=""
# KUBE_ROOT
function test-build-release() {
# Make a release
"${KUBE_ROOT}/build/release.sh"
"${KUBE_ROOT}/build-tools/release.sh"
}

# From user input set the necessary k8s and etcd configuration information
Expand Down
2 changes: 1 addition & 1 deletion cluster/vagrant/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function kube-push {
# Execute prior to running tests to build a release if required for env
function test-build-release {
# Make a release
"${KUBE_ROOT}/build/release.sh"
"${KUBE_ROOT}/build-tools/release.sh"
}

# Execute prior to running tests to initialize required structure
Expand Down
4 changes: 2 additions & 2 deletions docs/devel/bazel.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ can be found [here](https://www.bazel.io/versions/master/docs/install.html).
To build docker images for the components, run:

```
$ bazel build //build/...
$ bazel build //build-tools/...
```

To run many of the unit tests, run:

```
$ bazel test //cmd/... //build/... //pkg/... //federation/... //plugin/...
$ bazel test //cmd/... //build-tools/... //pkg/... //federation/... //plugin/...
```

To update automanaged build files, run:
Expand Down
4 changes: 2 additions & 2 deletions docs/devel/cherry-picks.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ tracking the tool to automate the batching procedure.
#### Cherrypicking a doc change

If you are cherrypicking a change which adds a doc, then you also need to run
`build/versionize-docs.sh` in the release branch to versionize that doc.
`build-tools/versionize-docs.sh` in the release branch to versionize that doc.
Ideally, just running `hack/cherry_pick_pull.sh` should be enough, but we are
not there yet: [#18861](https://github.com/kubernetes/kubernetes/issues/18861)

Expand All @@ -89,7 +89,7 @@ running `hack/cherry_pick_pull.sh` and before merging the PR:
```
$ git checkout -b automated-cherry-pick-of-#123456-upstream-release-3.14
origin/automated-cherry-pick-of-#123456-upstream-release-3.14
$ ./build/versionize-docs.sh release-3.14
$ ./build-tools/versionize-docs.sh release-3.14
$ git commit -a -m "Running versionize docs"
$ git push origin automated-cherry-pick-of-#123456-upstream-release-3.14
```
Expand Down
Loading

0 comments on commit 27116c6

Please sign in to comment.