New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minikube: switch to build from source & mostly fix on Darwin #23776
Conversation
@copumpkin, thanks for your PR! By analyzing the history of the files in this pull request, we identified @peterhoeg and @ebzzry to be potential reviewers. |
then "0cdcabsx5l4jbpyj3zzyz5bnzks6wl64bmzdsnk41x92ar5y5yal" | ||
else "12f3b7s5lwpvzx4wj6i6h62n4zjshqf206fxxwpwx9kpsdaw6xdi"; | ||
binPath = [ kubernetes ] | ||
++ stdenv.lib.optionals stdenv.isLinux [ kubernetes libvirt qemu docker-machine-kvm ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubernetes is duplicated here
buildFlagsArray = '' | ||
-ldflags= | ||
-X k8s.io/minikube/pkg/version.version=${version} | ||
-X k8s.io/minikube/pkg/version.isoVersion=v1.0.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we move the isoversion into a variable? It changes with almost every release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I forgot to do that, thanks
# mkdir -p $bin/share/bash-completion/completions/ | ||
# HOME=$PWD $bin/bin/minikube completion bash > $bin/share/bash-completion/completions/minikube | ||
'' + stdenv.lib.optionalString stdenv.isDarwin '' | ||
install_name_tool -delete_rpath $out/lib $bin/bin/localkube | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We end up with all the sources under /share
. Are those needed? If not, we should blow them away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like a more general buildGoPackage
thing, right? Also, the bin
output doesn't have the source.
I've added some comments to the code but on linux minikube builds, but doesn't run with these changes: peter@dolores:~ $ minikube start --vm-driver=kvm --container-runtime=rkt --network-plugin=cni -v4
Starting local Kubernetes cluster...
Starting VM...
Running pre-create checks...
Creating machine...
(minikube) Downloading /home/peter/.minikube/cache/boot2docker.iso from file:///home/peter/.minikube/cache/iso/minikube-v1.0.7.iso...
(minikube) Creating SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with buildroot...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
SSH-ing files into VM...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x97b58a]
goroutine 70 [running]:
panic(0x199a500, 0xc420018160)
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-go-1.7.4/share/go/src/runtime/panic.go:500 +0x1a1
k8s.io/minikube/pkg/minikube/assets.(*MemoryAsset).Read(0xc4202a89a0, 0xc4207ca000, 0x8000, 0x8000, 0x8000, 0x8000, 0xc42076c370)
/tmp/nix-build-minikube-0.17.1.drv-0/go/src/k8s.io/minikube/pkg/minikube/assets/vm_assets.go:136 +0x2a
io.copyBuffer(0x7f6e685776b0, 0xc4201c2480, 0x7f6e684fadf8, 0xc4202a89a0, 0xc4207ca000, 0x8000, 0x8000, 0x199f640, 0x0, 0x7f6e685776b0)
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-go-1.7.4/share/go/src/io/io.go:390 +0x147
io.Copy(0x7f6e685776b0, 0xc4201c2480, 0x7f6e684fadf8, 0xc4202a89a0, 0xc4201c2480, 0x12, 0x0)
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-go-1.7.4/share/go/src/io/io.go:360 +0x68
k8s.io/minikube/pkg/minikube/sshutil.Transfer.func1(0xc4206d9590, 0x2877d40, 0xc4201c2480, 0x1b6d2b8, 0x4, 0x0, 0x1b73e52, 0x9, 0x7f6e684fadf8, 0xc4202a89a0)
/tmp/nix-build-minikube-0.17.1.drv-0/go/src/k8s.io/minikube/pkg/minikube/sshutil/sshutil.go:120 +0x310
created by k8s.io/minikube/pkg/minikube/sshutil.Transfer
/tmp/nix-build-minikube-0.17.1.drv-0/go/src/k8s.io/minikube/pkg/minikube/sshutil/sshutil.go:122 +0x4f9 |
Thanks for the quick review! I'll check on Linux and fix the things you mention 😄 |
Ah, the nil pointer thing is actually tricky. I'm poking at it now. |
ca88d41
to
296d542
Compare
I pushed an update but I still don't think it's quite working. The trickiness arises because |
I'm seeing this, there was a similar issue with fzf before.
|
Oh, I can fix that separately. I think I almost have it working on both darwin and linux now, but localkube is proving to be quite tricky 😄 |
296d542
to
0702714
Compare
@peterhoeg okay I think this is ready. It works fine on Darwin, but I don't have a linux host I can virtualize on to test on. Can you (or anyone else) try it out? |
Linux behavior should be largely unchanged but we now build minikube ourselves. Unfortunately localkube is still tricky to build so I pull in a binary version from upstream.
0702714
to
fe339d2
Compare
Just enabled the completions (tested with sandbox and disabled the online check), too |
Yep, works now, thanks @copumpkin! 👍 |
Thanks for checking! Someday we'll get a source build of localkube too :)
…On Mon, Mar 13, 2017 at 00:18 Peter Hoeg ***@***.***> wrote:
Yep, works now, thanks @copumpkin <https://github.com/copumpkin>! 👍
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23776 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAKP0SyRa2yExxOp2F4MBWIOdYBGwb_ks5rlMOtgaJpZM4MaZWR>
.
|
Linux behavior should be largely unchanged but Darwin now mostly works. I was unable to spin it up against the VMWare Fusion driver but I think it'll work with the xhyve one. I'll probably make another couple of changes after I get the xhyve driver working on Darwin. Would appreciate someone giving it a go on Linux.
cc @ebzzry @peterhoeg
Motivation for this change
Source builds are cooler than binaries 😄 also, it's nice when things work on Darwin.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)