Community: Unable to build on OSX

Created on 14 Nov 2018  ·  6Comments  ·  Source: kubernetes/community

This is the output:

❯ kubetest --build
2018/11/14 16:55:03 process.go:153: Running: make -C /Users/andig/go/src/k8s.io/kubernetes quick-release
+++ [1114 16:55:04] Verifying Prerequisites....
+++ [1114 16:55:04] Using Docker for MacOS
+++ [1114 16:55:06] Building Docker image kube-build:build-5c4c19886b-5-v1.11.2-1
+++ [1114 16:55:11] Syncing sources to container
+++ [1114 16:55:16] Running build command...
2018/11/14 16:55:45 Code for OpenAPI definitions generated
+++ [1114 16:55:46] Building go targets for linux/amd64:
    cmd/kube-proxy
    cmd/kube-apiserver
    cmd/kube-controller-manager
    cmd/cloud-controller-manager
    cmd/kubelet
    cmd/kubeadm
    cmd/hyperkube
    cmd/kube-scheduler
    vendor/k8s.io/apiextensions-apiserver
    cluster/gce/gci/mounter
/usr/local/go/pkg/tool/linux_amd64/link: signal: killed
/usr/local/go/pkg/tool/linux_amd64/link: signal: killed
!!! [1114 16:56:50] Call tree:
!!! [1114 16:56:50]  1: /go/src/k8s.io/kubernetes/hack/lib/golang.sh:606 kube::golang::build_some_binaries(...)
!!! [1114 16:56:50]  2: /go/src/k8s.io/kubernetes/hack/lib/golang.sh:752 kube::golang::build_binaries_for_platform(...)
!!! [1114 16:56:50]  3: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1114 16:56:50] Call tree:
!!! [1114 16:56:50]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1114 16:56:50] Call tree:
!!! [1114 16:56:50]  1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make[1]: *** [all] Error 1
Makefile:92: recipe for target 'all' failed
make: *** [cross] Error 1
Makefile:484: recipe for target 'cross' failed
!!! [1114 16:56:51] Call tree:
!!! [1114 16:56:51]  1: build/../build/common.sh:518 kube::build::run_build_command_ex(...)
!!! [1114 16:56:51]  2: build/release.sh:36 kube::build::run_build_command(...)
make: *** [quick-release] Error 1
2018/11/14 16:56:51 process.go:155: Step 'make -C /Users/andig/go/src/k8s.io/kubernetes quick-release' finished in 1m47.642461627s
2018/11/14 16:56:51 main.go:312: Something went wrong: failed to acquire k8s binaries: error during make -C /Users/andig/go/src/k8s.io/kubernetes quick-release: exit status 2

Raising here since this repo contains the build instructions. No idea where the signal: killed comes from- it is reproducible.

/sig contribex

Most helpful comment

Make sure your docker daemon has at least 8GB RAM and it should work fine.

/close

All 6 comments

Make sure your docker daemon has at least 8GB RAM and it should work fine.

/close

@dims: Closing this issue.

In response to this:

Make sure your docker daemon has at least 8GB RAM and it should work fine.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dims
I also got the same error. I am having 8 GB RAM system memory. If I assign 8 GB RAM, all my memory will be used up. Will it create a problem? Is there any other solution?

See https://github.com/kubernetes/kubernetes/blob/26d32a7cffd7abfaaa88823b492d218f2289a1ea/build/README.md. I can't find the 8G documented, only 4.5G. I have 16G and just gave more to docker.

@dims @thockin
Shouldn't we update the amount of memory required (4.5GB) specified in the following documentation in the README.md to 8GB (as suggested above) or 10GB in my case.

macOS You can either use Docker for Mac or docker-machine. See installation instructions here. Note: You will want to set the Docker VM to have at least 4.5GB of initial memory or building will likely fail. (See: #11852).

I spent several hours trying to find a sweet spot and here is what I've found on my MacBook Pro (2018). Both "build/run.sh make" and "build/run.sh make cross" builds successfully with 10GB of memory.

Daemon Memory | Failed attempts | Passed runs
-- | -- | --
8 GB | 6 | 0
9 GB | 5 | 1
9.5 GB | 4 | 2
10 GB | 0 | 6

On my older Retina iMac 8GB works for both "build/run.sh make" and "build/run.sh make cross" builds fine.

Should we at-least point out in the README that

  • 4.5GB will suffice for building individual components on MacOS
  • And approximately 10GB is needed to make all binaries. i.e "build/run.sh make" OR "build/run.sh make cross" inside the build container.

We should figure out how to limit the parallelism. There's no excuse for
it to fail.

On Sun, Mar 3, 2019 at 6:46 PM tomba notifications@github.com wrote:

@dims https://github.com/dims @thockin https://github.com/thockin
Shouldn't we update the amount of memory required (4.5GB) specified in the
following documentation in the README.md
https://github.com/kubernetes/kubernetes/blob/master/build/README.md to
8GB (as suggested above) or 10GB in my case.

*macOS You can either use Docker for Mac or docker-machine. See
installation instructions here. Note: You will want to set the Docker VM to
have at least 4.5GB of initial memory or building will likely fail. (See:

11852).*

I spent several hours trying to find a sweet spot and here is what I've
found on my MacBook Pro (2018). Both "build/run.sh make" and "build/run.sh
make cross" builds successfully with 10GB of memory.
Daemon Memory Failed attempts Passed runs
8 GB 6 0
9 GB 5 1
9.5 GB 4 2
10 GB 0 6

On my older Retina iMac 8GB works for both "build/run.sh make" and
"build/run.sh make cross" builds fine.

Should we at-least point out in the README that

  • 4.5GB will suffice for building individual components on MacOS
  • And approximately 10GB is needed to make all binaries. i.e
    "build/run.sh make" OR "build/run.sh make cross" inside the build container.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/community/issues/2939#issuecomment-469099611,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFVgVKTp8ZhlmdHSIBl83W1vRQedeME4ks5vTIjpgaJpZM4YeCx_
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

parispittman picture parispittman  ·  3Comments

spiffxp picture spiffxp  ·  5Comments

casusbelli picture casusbelli  ·  4Comments

zacharysarah picture zacharysarah  ·  3Comments

ehashman picture ehashman  ·  4Comments