Skip to content

minikube: bundle kvm2 driver #41644

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

Merged
merged 1 commit into from
Jun 24, 2018
Merged

minikube: bundle kvm2 driver #41644

merged 1 commit into from
Jun 24, 2018

Conversation

tadfisher
Copy link
Contributor

@tadfisher tadfisher commented Jun 7, 2018

Motivation for this change

See #34448

Add a drivers ? [] argument for bundling arbitrary binaries in the minikube PATH. This currently defaults to [ docker-machine-kvm docker-machine-kvm2 ] on Linux.

A separate effort is here: #39438

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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.

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jun 7, 2018
@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: minikube

Partial log (click to expand)

  GEN     trace/generated-helpers.c
  CCAS    aarch64_be-linux-user/linux-user/safe-syscall.o
  CC      sh4eb-softmmu/accel/stubs/kvm-stub.o
  CC      ppc-linux-user/accel/tcg/translator.o
  CC      sh4eb-softmmu/accel/tcg/tcg-all.o
  CC      aarch64_be-linux-user/linux-user/flatload.o
  CC      sh4eb-softmmu/accel/tcg/cputlb.o
building of '/nix/store/biyy06fp0nylgjdj5ngxj6azx88kf31y-qemu-2.12.0.drv' timed out after 3600 seconds
cannot build derivation '/nix/store/naqid2i9h9inq7m66vypmipsmpghpky8-minikube-0.27.0.drv': 2 dependencies couldn't be built
error: build of '/nix/store/naqid2i9h9inq7m66vypmipsmpghpky8-minikube-0.27.0.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: minikube

Partial log (click to expand)

/nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0/share/go/src/k8s.io/minikube/vendor/k8s.io/apiserver/pkg/util/webhook/gencerts.sh: interpreter directive changed from "/bin/bash" to "/nix/store/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
/nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0/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/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
/nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0/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/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
/nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0/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/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
/nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0/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/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
/nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0/share/go/src/k8s.io/minikube/vendor/google.golang.org/grpc/codegen.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
/nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0/share/go/src/k8s.io/minikube/vendor/google.golang.org/grpc/vet.sh: interpreter directive changed from "/bin/bash" to "/nix/store/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
/nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0/share/go/src/k8s.io/minikube/test.sh: interpreter directive changed from "/bin/bash" to "/nix/store/qckzjk3406va7h6s40cy9s75z2w715rq-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/xdda2w59yhhx0s5052kcf8hjbj1l7bdj-minikube-0.27.0...
/nix/store/bna9khdasr3pfxnrqq8l1pqhwm3jm85h-minikube-0.27.0-bin

@@ -16882,6 +16882,10 @@ with pkgs;

minikube = callPackage ../applications/networking/cluster/minikube {
inherit (darwin.apple_sdk.frameworks) vmnet;
drivers = lib.optionals stdenv.isLinux [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this in the argument definition in order to reduce the size of all-packages.nix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would I do this cleanly? This comes to mind:

{ stdenv, buildGoPackage, fetchFromGitHub, fetchurl, go-bindata, libvirt, qemu
, gpgme, makeWrapper, hostPlatform, vmnet, python, pkgconfig
, pkgs, drivers ? stdenv.lib.optionals stdenv.isLinux [ pkgs.docker-machine-kvm pkgs.docker-machine-kvm2 ]
}:

But I don't like adding a pkgs argument. Or do I do something like:

{ stdenv, buildGoPackage, fetchFromGitHub, fetchurl, go-bindata, libvirt, qemu
, gpgme, makeWrapper, hostPlatform, vmnet, python, pkgconfig
, kvmDriver ? stdenv.isLinux, docker-machine-kvm
, kvm2Driver ? stdenv.isLinux, docker-machine-kvm2
}:

and handle those specifically in binPath?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we could not just add docker-machine-kvm2 to the argument list as it is done for docker-machine-kvm? Moreover, docker-machine-kvm is supposed to be removed so it will remain only one driver.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @nlewo: Just add that package as you do now (with docker-machine-kvm) and internally create a list of supported drivers.

let
   drivers = filter (d: d != null) ([]
             ++ lib.optionals stdenv.isLinux [ docker-machine-kvm docker-machine-kvm2 ]
             ++ lib.optionals stdenv.isDarwn []
   );
in

Note: I am not sure if the null filter is required here. Thought is that it will allow people to set inputs to null in their overrides and remove specific drivers if they do not want them to be available.

If you want to allow people to add packages (as drivers) that aren't specified within the minikube derivation: Add an extraDrivers argument that defaults to [] and add that to the list of drivers that are being assembled in the packages expression.

@tadfisher
Copy link
Contributor Author

@nlewo @andir Updated, thanks!

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: minikube

Partial log (click to expand)

/nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0/share/go/src/k8s.io/minikube/hack/jenkins/minikube_set_pending.sh: interpreter directive changed from "/bin/bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
/nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0/share/go/src/k8s.io/minikube/hack/jenkins/osx_integration_tests_hyperkit.sh: interpreter directive changed from "/bin/bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
/nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0/share/go/src/k8s.io/minikube/hack/jenkins/release_build_and_upload.sh: interpreter directive changed from "/bin/bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
/nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0/share/go/src/k8s.io/minikube/hack/jenkins/osx_integration_tests_virtualbox.sh: interpreter directive changed from "/bin/bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
/nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0/share/go/src/k8s.io/minikube/hack/godeps/godep-update-k8s.sh: interpreter directive changed from "/bin/bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
/nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0/share/go/src/k8s.io/minikube/hack/godeps/godep-save.sh: interpreter directive changed from "/bin/bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
/nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0/share/go/src/k8s.io/minikube/hack/godeps/godep-restore.sh: interpreter directive changed from "/bin/bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
/nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0/share/go/src/k8s.io/minikube/test.sh: interpreter directive changed from "/bin/bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/10qpy9h76viql1744dacngh85qa1qcmv-minikube-0.27.0...
/nix/store/vgkbwvkafyrry66x8s2m3k71i4nx1smj-minikube-0.27.0-bin

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: minikube

Partial log (click to expand)

  CC      ppcemb-softmmu/tcg/tcg-op-gvec.o
  CC      ppcemb-softmmu/tcg/tcg-common.o
  CC      ppcemb-softmmu/tcg/optimize.o
  CC      ppcemb-softmmu/fpu/softfloat.o
  CC      ppcemb-softmmu/disas.o
  GEN     ppcemb-softmmu/gdbstub-xml.c
  CC      ppc64-softmmu/tcg/tcg-op.o
building of '/nix/store/454xw6f26wpxv725hfjx4jwjxgx6kyl2-qemu-2.12.0.drv' timed out after 3600 seconds
cannot build derivation '/nix/store/x7d8rryi5ngyy8dvf3569xyjj380mh2d-minikube-0.27.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/x7d8rryi5ngyy8dvf3569xyjj380mh2d-minikube-0.27.0.drv' failed

@andir
Copy link
Member

andir commented Jun 24, 2018

Looks good to me. @nlewo any objections?

@nlewo nlewo merged commit 3951a69 into NixOS:master Jun 24, 2018
@flokli flokli mentioned this pull request Jun 29, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants