Skip to content
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 fixes and hyperkit driver #40188

Merged
merged 3 commits into from May 27, 2018
Merged

Conversation

nicknovitski
Copy link
Contributor

Motivation for this change

My friends develop on macs and run what they develop on kubernetes. I couldn't get any other minikube drivers to work on our machines. minikube v0.26.1 adds hyperkit as a supported driver (apparently it will be the recommended one soon), and I was able to get it to work.

This PR should be treated very skeptically, because it's technically adding a broken feature: minikube refuses to run the driver unless it has the setuid flag. I tried patching out that check, but it seems that only binaries with that flag can successfully communicate with vmnet. If you don't run chmod u+s $storepath/bin/docker-machine-driver-hyperkit, you can't use it.

I don't mind running that command, but I don't know if it's right to put something like this in nixpkgs. Is there a good non-NixOS approach to things like this?

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • [ ] NixOS
    • macOS
    • [ ] other Linux distributions
  • [ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • [ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@nicknovitski
Copy link
Contributor Author

nicknovitski commented May 10, 2018

I believe the ld flags I added in order to download kubeadm also fix #31602, which means we don't need to download localkube ourselves and pass it through the binary data. I've verified that I can delete the local cache, run minikube start with the localkube bootstrapper, and it will download and use it successfully. From reading these issues it seems like minikube used to try to download localkube into the store, but now it uses ~/.minikube.

@nicknovitski
Copy link
Contributor Author

I found a way to disable the kubectl download message when generating shell completions, and so I removed kubernetes/kubectl as a dependency entirely. I don't know if that's ideal, since normal usage of minikube requires kubectl, and minikube will download kubectl on its own if kubectl isn't installed. Maybe in nixpkgs terms it's a native build input?

@matthewbauer
Copy link
Member

@GrahamcOfBorg build minikube

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: minikube

Partial log (click to expand)

/nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/github.com/ugorji/go/codec/tests.sh: interpreter directive changed from "/bin/bash" to "/nix/store/l4w7xwjy2nmk31fl5kgyy7gg8z7l9n8z-bash-4.4-p19/bin/bash"
/nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/golang.org/x/sys/unix/mkall.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/l4w7xwjy2nmk31fl5kgyy7gg8z7l9n8z-bash-4.4-p19/bin/bash"
/nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/golang.org/x/sys/unix/mkerrors.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/l4w7xwjy2nmk31fl5kgyy7gg8z7l9n8z-bash-4.4-p19/bin/bash"
/nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/google.golang.org/grpc/codegen.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/l4w7xwjy2nmk31fl5kgyy7gg8z7l9n8z-bash-4.4-p19/bin/bash"
/nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/google.golang.org/grpc/vet.sh: interpreter directive changed from "/bin/bash" to "/nix/store/l4w7xwjy2nmk31fl5kgyy7gg8z7l9n8z-bash-4.4-p19/bin/bash"
/nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/k8s.io/kubernetes/plugin/pkg/admission/imagepolicy/gencerts.sh: interpreter directive changed from "/bin/bash" to "/nix/store/l4w7xwjy2nmk31fl5kgyy7gg8z7l9n8z-bash-4.4-p19/bin/bash"
/nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/k8s.io/apiserver/pkg/util/webhook/gencerts.sh: interpreter directive changed from "/bin/bash" to "/nix/store/l4w7xwjy2nmk31fl5kgyy7gg8z7l9n8z-bash-4.4-p19/bin/bash"
/nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/gencerts.sh: interpreter directive changed from "/bin/bash" to "/nix/store/l4w7xwjy2nmk31fl5kgyy7gg8z7l9n8z-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/r67ln5j14nrjsqx9fzxdfvyrc47c6kg0-minikube-0.26.1...
/nix/store/4pigv2jbmkwfd7pmh7qxkgw38v37pc0h-minikube-0.26.1-bin

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: minikube

Partial log (click to expand)

make[2]: *** [/build/xen-4.8.3/tools/../tools/Rules.mk:217: subdir-install-firmware] Error 2
make[2]: Leaving directory '/build/xen-4.8.3/tools'
make[1]: *** [/build/xen-4.8.3/tools/../tools/Rules.mk:212: subdirs-install] Error 2
make[1]: Leaving directory '/build/xen-4.8.3/tools'
make: *** [Makefile:101: install-tools] Error 2
builder for '/nix/store/r0nfia59xb8mf4ryfkcf6xk5d2klqmaq-xen-4.8.3.drv' failed with exit code 2
cannot build derivation '/nix/store/xlfzss5lr5caq4k658jkmr8f4anzilyb-libvirt-4.1.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/pbfhp2d2kj959741gvkripvz7j0fkqpm-docker-machine-kvm-0.8.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/sg9gpd01sgsvq9ldav0gmqj4www1ykx3-minikube-0.26.1.drv': 2 dependencies couldn't be built
error: build of '/nix/store/sg9gpd01sgsvq9ldav0gmqj4www1ykx3-minikube-0.26.1.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: minikube

Partial log (click to expand)

/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/github.com/ugorji/go/codec/prebuild.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/github.com/ugorji/go/codec/tests.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/golang.org/x/sys/unix/mkall.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/golang.org/x/sys/unix/mkerrors.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/google.golang.org/grpc/codegen.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/google.golang.org/grpc/vet.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/k8s.io/apiserver/pkg/util/webhook/gencerts.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/gencerts.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/gii788kf1f989a837c7zjjwlai141kcf-minikube-0.26.1/share/go/src/k8s.io/minikube/vendor/k8s.io/kubernetes/plugin/pkg/admission/imagepolicy/gencerts.sh: interpreter directive changed from "/bin/bash" to "/nix/store/r8bx3qf1bpncb14i9gzma4vr089pc3pv-bash-4.4-p19/bin/bash"
/nix/store/yaiqslgsaf6c5nfgy50dr15pmyqmxg9r-minikube-0.26.1-bin

This gives a valid default version when minikube attempts to download
localkube, kubeadm, and other binaries, and makes downloading and vendoring
localkube as binary data unnecessary.
@nicknovitski
Copy link
Contributor Author

So a compile error in xen?

dsdt_anycpu.c:7495:28: error: 'dsdt_anycpu' undeclared here (not in a function); did you mean 'dsdt_anycpu_len'?
 int dsdt_anycpu_len=sizeof(dsdt_anycpu);
                            ^~~~~~~~~~~
                            dsdt_anycpu_len

Hmm. Well, I'll rebase and see if that changes anything.

@globin globin merged commit a797bd6 into NixOS:master May 27, 2018
@nicknovitski nicknovitski deleted the minikube-hyperkit branch June 15, 2018 03:13
@Zildj1an
Copy link

So a compile error in xen?

dsdt_anycpu.c:7495:28: error: 'dsdt_anycpu' undeclared here (not in a function); did you mean 'dsdt_anycpu_len'?
 int dsdt_anycpu_len=sizeof(dsdt_anycpu);
                            ^~~~~~~~~~~
                            dsdt_anycpu_len

Did you solve this error? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants