Commit Graph

357 Commits (07d1a8cb0c89d70572560611ad37e8986e9b6ead)

Author SHA1 Message Date
Ismo Puustinen 231f79f89e build: fix building with spaces in directory names.
Fix kubernetes build scripts to work in case the source directory is in
a directory path which contains a space.

You can prepare such a directory like this:

    $ mkdir '/tmp/test dir/'
    $ cd '/tmp/test dir/'
    $ git clone https://github.com/kubernetes/kubernetes.git
    $ cd kubernetes

Then, without the fix:

$ KUBE_FASTBUILD=true KUBE_RELEASE_RUN_TESTS=n build/release.sh
cat: /tmp/test: No such file or directory
cat: dir/kubernetes/build/build-image/cross/VERSION: No such file or directory
cat: /tmp/test: No such file or directory
cat: dír/kubernetes/build/build-image/VERSION: No such file or directory
+++ [0307 18:10:33] Verifying Prerequisites....
cp: target '/tmp/test dir/kubernetes/_output/images/kube-build:build-7c7cd10a18--/Dockerfile' is not a directory
!!! [0307 18:10:33] Call tree:
!!! [0307 18:10:33]  1: build/release.sh:35
kube::build::build_image(...)
!!! Error in build/../build/common.sh:454
  Error in build/../build/common.sh:454. '((i<3-1))' exited with status 1
Call stack:
  1: build/../build/common.sh:454 kube::build::build_image(...)
  2: build/release.sh:35 main(...)
Exiting with status 1

With the fix the compilation succeeds. The fix is done adding double
quotes to required places (and also just in case to other places where
shellcheck recommended adding them).

Note that this fix doesn't help with the official make-based build:
it's tricky to make makefiles work with targets with spaces in their
names.
2018-03-12 09:12:47 +02:00
Kubernetes Submit Queue 5c86ef2150
Merge pull request #59207 from ipuustin/shell-bugfix
Automatic merge from submit-queue (batch tested with PRs 59705, 59207, 59677). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

build: fix a logic error in shell script.

**What this PR does / why we need it**: It looks like that there's a logic error in `build/common.sh`. The return value of a `docker inspect` command is not checked properly, since the value being assigned is actually the previous command's return value (a `0`, because `local` always returns `0` when used like this).

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**: 

```release-note
NONE
```
2018-02-13 12:29:31 -08:00
Tim Hockin 3586986416 Switch to k8s.gcr.io vanity domain
This is the 2nd attempt.  The previous was reverted while we figured out
the regional mirrors (oops).

New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest.  To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today).  For now the staging is an alias to
gcr.io/google_containers (the legacy URL).

When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.

We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it.  Nice and
visible, easy to keep track of.
2018-02-07 21:14:19 -08:00
Ismo Puustinen 7a67246d47 build: fix a logic error in shell script.
The right place to assign the "docker inspect" return value is outside
of the subshell. The last return value was coming from something else
than the expected command.
2018-02-05 11:21:59 +02:00
Kubernetes Submit Queue 0d9e247aaa
Merge pull request #54071 from HubSpot/kube-build-parent-cgroup
Automatic merge from submit-queue (batch tested with PRs 54071, 58393). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Optionally launch build containers inside a specific parent cgroup

**What this PR does / why we need it**: Adds support to the build process for launching containers inside a specific parent cgroup via the `--cgroup-parent` docker arg. We needed this to enforce resource usage when building Kubernetes in our CI environment.

**Special notes for your reviewer**: None

**Release note**:

```release-note
NONE
```
2018-01-23 16:41:30 -08:00
tpetr 4ec6e1288e update if statement 2018-01-23 11:24:08 -05:00
stewart-yu 0601916d78 add KUBE_ROOT in directory 2018-01-12 18:12:37 +08:00
Tim Hockin e9dd8a68f6 Revert k8s.gcr.io vanity domain
This reverts commit eba5b6092a.

Fixes https://github.com/kubernetes/kubernetes/issues/57526
2017-12-22 14:36:16 -08:00
Tim Hockin eba5b6092a Use k8s.gcr.io vanity domain for container images 2017-12-18 09:18:34 -08:00
m1093782566 787a55bb67 install ipset in debian-iptables docker image and bump tag to v10 2017-11-22 15:37:15 +08:00
Christoph Blecker 555b4215d6
Fix .git rsync filter 2017-11-11 10:02:02 -08:00
Ryan Phillips 66965daf56 bump base images to debian stretch 2017-11-10 09:54:10 -06:00
tpetr 0df8838d15 allow setting --cgroup-parent for docker run commands 2017-10-17 10:58:39 -04:00
Dr. Stefan Schimanski 4156ec979b build/common.sh: silence kube::build::has_ip on Mac 2017-10-16 14:44:39 +02:00
Kubernetes Submit Queue 2e6ccc3f98 Merge pull request #52959 from mattjmcnaughton/mattjmcnaughton/dynamically-determine-default-docker-machine-memory
Automatic merge from submit-queue (batch tested with PRs 52959, 53790). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Dynamically determine default docker machine memory

**What this PR does / why we need it**:

Currently, if using `docker-machine` for k8s docker operations on a Mac,
we'll create a VM with 4096MB of memory. The machine's RAM will be the
same regardless of the memory available on the local machine. For
example, if the user has 16GB on their local machine, the VM will still
only have 4GB of RAM.

Update the method for defining the `kube-dev` VM with `docker-machine`,
so we give it access to 50% of the total RAM.

**Release note**:
```release-note
NONE
```
2017-10-13 19:19:29 -07:00
Ryan Phillips de095385b9 common.sh fix to detect ip instead of ifconfig
* Some machines do not have ifconfig and rely on ip
2017-10-06 16:42:53 -05:00
mattjmcnaughton abee38cb4a Dynamically determine default docker machine memory
Currently, if using `docker-machine` for k8s docker operations on a Mac,
we'll create a VM with 4096MB of memory. The machine's RAM will be the
same regardless of the memory available on the local machine. For
example, if the user has 16GB on their local machine, the VM will still
only have 4GB of RAM.

Update the method for defining the `kube-dev` VM with `docker-machine`,
so we give it access to 50% of the total RAM.
2017-10-03 09:10:31 -04:00
Kubernetes Submit Queue e5fb3d7108 Merge pull request #50587 from CaoShuFeng/verify-staging-godeps
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

set proxy when build containers for users behind proxy

Fixes: https://github.com/kubernetes/kubernetes/issues/49921

**Release note**:

```
NONE
```
2017-09-24 22:32:39 -07:00
Christoph Blecker b6f6419423
make clean will remove all gitignored files 2017-09-04 11:04:09 -07:00
Kubernetes Submit Queue 5d72d5c31d Merge pull request #50602 from dixudx/user_arm64v8_instead_aarch64
Automatic merge from submit-queue (batch tested with PRs 50602, 51561, 51703, 51748, 49142)

Use arm32v7|arm64v8 images instead of the deprecated armhf|aarch64 image organizations

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #50601

**Special notes for your reviewer**:
/assign @ixdy @jbeda @zmerlynn
**Release note**:

```release-note
Use arm32v7|arm64v8 images instead of the deprecated armhf|aarch64 image organizations
```
2017-09-03 01:12:04 -07:00
Kubernetes Submit Queue a244a55c96 Merge pull request #51004 from zhouhaibing089/rsync-fix
Automatic merge from submit-queue (batch tested with PRs 51666, 49829, 51058, 51004, 50938)

add the caller ip into rsync hosts allow list

fixes https://github.com/kubernetes/kubernetes/issues/51003.

This patch allows running build in pods.

```release-note
NONE
```
2017-09-02 22:52:08 -07:00
Christoph Blecker 4f1106c8a5
Modify rsync filter to retain output across runs 2017-08-25 16:58:59 -07:00
zhouhaibing089 ca76002e89 add the caller ip into rsync hosts allow list 2017-08-23 09:58:32 +08:00
Di Xu ec2fbbc85d bump new version due to base image changed 2017-08-21 14:51:44 +08:00
Di Xu d4aa1611bd use more-specific arm64v8 instead of deprecated aarch64 organization 2017-08-21 10:18:19 +08:00
Di Xu 25a786f74d use more-specific arm32v7 instead of deprecated armhf organization 2017-08-21 10:17:43 +08:00
Cao Shufeng 6bc64dffe7 set proxy when build containers for users behind proxy
Fixes: https://github.com/kubernetes/kubernetes/issues/49921
2017-08-15 09:57:40 +08:00
Davanum Srinivas 827af63e72 Avoid rsync of .git directory
We don't really need the .git directory to be transferred. This
problem was introduced in the PR:
"Run the update-staging-godeps script inside a docker container"

Fixes #50272
2017-08-12 20:52:49 -04:00
Christoph Blecker 2ee8983daf
Dockerize update-staging-godeps 2017-07-25 12:26:57 -07:00
Christoph Blecker d3b838b608
rsync git directories into kube-build 2017-07-25 12:11:06 -07:00
Dr. Stefan Schimanski 1f40e75aa0 Workaround docker-wait freeze with 17.06.0 2017-07-11 16:22:53 +02:00
Davanum Srinivas 733bb2c31d Add git branch to make build short hash unique
KUBE_ROOT_HASH depends just on the host name and
directory path. So when working with branches, it could lead
to some confusion since the hash is the same even when
you switch from branch to branch. Let us use the git branch
information when we compute the short hash

Fixes #1801
2017-06-02 21:18:00 -04:00
bruceauyeung 396695af15 fix make release/quick-release doesn't respect go build flags 2017-05-25 17:05:09 +08:00
Jeff Grafton 37eb292bc0 Update bazel build to dockerize cloud-controller-manager 2017-05-02 12:07:13 -07:00
Lucas Käldström 4ee9d047fd
Create a docker image for the cloud controller manager 2017-04-30 10:28:56 +03:00
StevenYCChou 7985e2c374 fix typo in build/common.sh 2017-04-16 19:22:30 -04:00
Clayton Coleman 7d413fb53b
protobuf generation modifies types.go, which needs to be copied out
This was broken when we moved to the build container, but no one
noticed. We also likely have another bug, which is that protobuf should
hard fail when we have fields that aren't assigned a tag.
2017-03-17 00:29:13 -04:00
Tim St. Clair 8a5314fb6d
Rebase kube-proxy and debian-iptables on debian-base 2017-02-27 15:48:23 -08:00
Kubernetes Submit Queue 3897fc00db Merge pull request #38926 from luxas/update_cross_go18
Automatic merge from submit-queue

Improve the multiarch situation; armel => armhf; reenable pcc64le; remove the patched golang

**What this PR does / why we need it**: 
 - Improves the multiarch situation as described in #38067 
 - Tries to bump to go1.8 for arm (and later enable ppc64le)
 - GOARM 6 => GOARM 7
 - Remove the golang 1.7 patch
 - armel => armhf
 - Bump QEMU version to v2.7.0

**Release note**:

```release-note
Improve the ARM builds and make hyperkube on ARM working again by upgrading the Go version for ARM to go1.8beta2
```

@kubernetes/sig-testing-misc @jessfraz @ixdy @jbeda @david-mcmahon @pwittrock
2017-01-28 03:51:19 -08:00
Lucas Käldström 04bc44acf9
Remove the patched golang from the kube-cross image and upgrade to go1.8rc1 for arm and ppc64le instead. Reenable the ppc64le builds 2017-01-27 20:03:37 +02:00
Robert Bailey a6c65f3035 When calling chown, use : instead of . to separate the user and
group for cross platform compatibility.
2017-01-26 13:39:06 -08:00
Kubernetes Submit Queue d5d9a594d8 Merge pull request #39515 from xilabao/fix-rsync-err
Automatic merge from submit-queue

fix rsync err when make release

fix #39513
2017-01-24 19:46:29 -08:00
xilabao f6ae588207 fix rsync err when make release 2017-01-24 10:08:09 +08:00
Jeff Grafton 39217af9e9 Update amd64 kube-proxy base image to debian-iptables-amd64:v5 2017-01-11 00:49:13 -08:00
Jeff Grafton 9172bf63e5 Update to debian-iptables-*:v5 2017-01-10 16:23:01 -08:00
deads2k 453651cbfc rename kubernetes-discovery to kube-aggregator 2017-01-10 12:27:42 -05:00
deads2k 47073be356 create kuberentes-discovery image 2016-12-20 07:42:49 -05:00
Alejandro Escobar 7d9c06f82d local-up-cluster changes: added help option, added error message for why docker ps fails and how to recover, added test to check if etcd is in your path to fail fast when not found.
from etcd.sh split the start process into validate fucntion + start function so that the validate piece can be reused elsewhere. the up-cluster script has been changed to remove duplicate docker logic to the one used in buid-tools/common.sh and the validate etcd function is now used here.

moved docker daemon check function to util.sh and made function name changes and upstream changes.
2016-12-16 07:41:35 -08:00
xuxinkun 29dc75abc2 fix kube::log::error in `start_rsyncd_container`.
Signed-off-by: xuxinkun <xuxinkun@gmail.com>
2016-12-15 10:00:19 +08:00
Jeff Grafton 27d096d27d Rename build-tools/ back to build/ 2016-12-14 13:42:15 -08:00