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

docker & docker-machine-xhyve: enable darwin support #31737

Merged
merged 4 commits into from Nov 20, 2017

Conversation

periklis
Copy link
Contributor

@periklis periklis commented Nov 16, 2017

Motivation for this change

Using docker cli client as a pure dependency on darwin is the starting point for a more pure docker support on this platform. The proposed PR makes docker-engine builds depending on platform. This is not a full docker support for darwin, because running the daemon needs either a virtualbox or xhyve based solution.

This packages:

  • docker cli
  • docker-machine-xhyve
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.

@NeQuissimus
Copy link
Member

For the heck of it, could you (outside this PR) try Docker v17.11.0-ce-rc4 ?
Might as well make the implementation work with the soon-to-be-released 17.11

@periklis
Copy link
Contributor Author

@NeQuissimus sure, why not :)

@periklis
Copy link
Contributor Author

@NeQuissimus The darwin build for v17.11.0-ce-rc4 works fine. However, i do not have access to a hydra for linux builds. I can push a second branch for that.

@NeQuissimus
Copy link
Member

No, no worries, I just wanted to make sure since I usually only test Docker on Linux when I update

@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Nov 16, 2017
@LnL7
Copy link
Member

LnL7 commented Nov 16, 2017

@GrahamcOfBorg build docker

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-linux


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

(use ‘--show-trace’ to show detailed location information)

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

(use ‘--show-trace’ to show detailed location information)

@NeQuissimus
Copy link
Member

@grahamc What happened to the borg here?

@grahamc
Copy link
Member

grahamc commented Nov 17, 2017

I just re-triggered evaluation checking again. Are you wondering about the build results or the eval results?

@NeQuissimus
Copy link
Member

Docker should not be marked as broken...

@grahamc
Copy link
Member

grahamc commented Nov 17, 2017

It turns out all the errors here are from the same problem. something about this PR makes this happen:

error: Package ‘docker-17.09.0-ce’ in /var/lib/gc-of-borg/.nix-test/mr-est-38dca4e3aa6bca43ea96d2fcc04e8229-31737/pkgs/applications/virtualization/docker/default.nix:190 is not supported on ‘x86_64-linux’, refusing to evaluate.

@NeQuissimus
Copy link
Member

Oh!

Could we get @GrahamcOfBorg to output this info somehow?

@grahamc
Copy link
Member

grahamc commented Nov 17, 2017

I've been thinking through this a bit. I think yes, I'm a bit worried about sharing secrets about hosts but I think with our Hydra-like safeguards, we should be OK to share them.

Actually doing so is another thing. Can you open an issue on grahamc/ofborg ?

@periklis periklis changed the title WIP docker: enable darwin support docker cli: enable darwin support Nov 20, 2017
@periklis
Copy link
Contributor Author

@NeQuissimus Packaging docker-machine-xhyve will take me some time. However we can merge this for start to enable using docker cli als buildInput on darwin.

@periklis
Copy link
Contributor Author

@grahamc Can anybody call for Grahamcofborg to build our PR or maintainers only?

@LnL7
Copy link
Member

LnL7 commented Nov 20, 2017

@GrahamcOfBorg build docker

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

(use ‘--show-trace’ to show detailed location information)

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-linux


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

(use ‘--show-trace’ to show detailed location information)

@grahamc
Copy link
Member

grahamc commented Nov 20, 2017

@periklis only about 10 people can call it right now. We're working on making it a wider group though!

@grahamc
Copy link
Member

grahamc commented Nov 20, 2017

Note, though, that it doesn't make sense that Docker is broken on Linux here. Something is wrong with this PR.

@periklis
Copy link
Contributor Author

@grahamc Sure it doesn't make sense to merge something broken. However, if borg is not giving me an useful error message, could somebody put a simple jobset on hydra to find the issue?

@grahamc
Copy link
Member

grahamc commented Nov 20, 2017

I've posted the error message, and the bot has posted the same error message, also see the "Details" link next to "eval-nixos-options" (this is new as of Yesterday.) Hydra won't tell us more, unfortunately.

@NeQuissimus
Copy link
Member

@periklis This is literally all we have to go on:

(Docker definitely builds on master, not with this PR; I just tried both)

λ nix-build -A docker --show-trace
error: while evaluating the attribute ‘docker_17_09’ at /home/nequi/dev/nixpkgs/pkgs/applications/virtualization/docker/default.nix:200:3:
while evaluating ‘dockerGen’ at /home/nequi/dev/nixpkgs/pkgs/applications/virtualization/docker/default.nix:11:15, called from /home/nequi/dev/nixpkgs/pkgs/applications/virtualization/docker/default.nix:200:18:
while evaluating ‘mkDerivation’ at /home/nequi/dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:15:5, called from /home/nequi/dev/nixpkgs/pkgs/applications/virtualization/docker/default.nix:16:7:
while evaluating ‘addPassthru’ at /home/nequi/dev/nixpkgs/lib/customisation.nix:135:22, called from /home/nequi/dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:166:7:
while evaluating anonymous function at /home/nequi/dev/nixpkgs/pkgs/stdenv/generic/check-meta.nix:5:1, called from /home/nequi/dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:167:22:
while evaluating ‘throwEvalHelp’ at /home/nequi/dev/nixpkgs/pkgs/stdenv/generic/check-meta.nix:128:19, called from /home/nequi/dev/nixpkgs/pkgs/stdenv/generic/check-meta.nix:194:17:
Package ‘docker-17.09.0-ce’ in /home/nequi/dev/nixpkgs/pkgs/applications/virtualization/docker/default.nix:190 is not supported on ‘x86_64-linux’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@NeQuissimus
Copy link
Member

@periklis I am still getting the same error

@periklis periklis changed the title docker cli: enable darwin support docker & docker-machine-xhyve: enable darwin support Nov 20, 2017
Copy link
Member

@LnL7 LnL7 left a comment

Choose a reason for hiding this comment

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

I suspect you have allowBroken = true; in your config.nix that hides the meta problem on your machine. In that case you can use --argstr config {} or :a import <nixpkgs> { config = {}; } in nix-repl for testing to make sure your local config/overrides don't influence the results.

maintainers = with maintainers; [ nequissimus offline tailhook vdemeester ];
platforms = platforms.linux;
maintainers = with maintainers; [ nequissimus offline tailhook vdemeester periklis ];
platforms = with platforms; [ linux darwin ];
Copy link
Member

Choose a reason for hiding this comment

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

this is causing the evaluation errors, things in stdenv.lib.platforms are already lists because some attributes contain multiple architectures.

@LnL7
Copy link
Member

LnL7 commented Nov 20, 2017

@GrahamcOfBorg build docker

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-linux


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

(use ‘--show-trace’ to show detailed location information)

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

(use ‘--show-trace’ to show detailed location information)

@periklis
Copy link
Contributor Author

periklis commented Nov 20, 2017

just for the protocol from the irc, the instantiation of the derivation on x86_64-linux is fine:
nix-instantiate -A docker --show-trace --argstr system 'x86_64-linux'
However, the borg uses the extra option --option restrict-eval true.

The error was in with.platforms; linux ++ darwin; vs. with.platforms; [ linux darwin ], where latter is [["x86_64-linux" "i686-linux"] ["x86_64-darwin"]]

@LnL7
Copy link
Member

LnL7 commented Nov 20, 2017

@GrahamcOfBorg build docker

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: x86_64-darwin

2017/11/20 20:08:00 WARN: man/src/system/prune.md does not exist, skipping
2017/11/20 20:08:00 WARN: man/src/system.md does not exist, skipping
2017/11/20 20:08:00 WARN: man/src/volume/prune.md does not exist, skipping
2017/11/20 20:08:00 WARN: man/src/volume/rm.md does not exist, skipping
Generate legacy manpages
post-installation fixup
patching script interpreter paths in /nix/store/wj9ffr61i0dkxwk3yj88q1wyq23hpm1k-docker-17.09.0-ce
gzipping man pages under /nix/store/ih418srgyhp4j97g7h3npdwlm66x36d3-docker-17.09.0-ce-man/share/man/
patching script interpreter paths in /nix/store/ih418srgyhp4j97g7h3npdwlm66x36d3-docker-17.09.0-ce-man
/nix/store/wj9ffr61i0dkxwk3yj88q1wyq23hpm1k-docker-17.09.0-ce

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: x86_64-linux

shrinking RPATHs of ELF executables and libraries in /nix/store/qdn6f8g5faq5xknkvi2kljf25nrb96rb-docker-17.09.0-ce
shrinking /nix/store/qdn6f8g5faq5xknkvi2kljf25nrb96rb-docker-17.09.0-ce/libexec/docker/docker
shrinking /nix/store/qdn6f8g5faq5xknkvi2kljf25nrb96rb-docker-17.09.0-ce/libexec/docker/dockerd
patching script interpreter paths in /nix/store/qdn6f8g5faq5xknkvi2kljf25nrb96rb-docker-17.09.0-ce
checking for references to /tmp/nix-build-docker-17.09.0-ce.drv-0 in /nix/store/qdn6f8g5faq5xknkvi2kljf25nrb96rb-docker-17.09.0-ce...
shrinking RPATHs of ELF executables and libraries in /nix/store/jb688pnw1m9lx69qc3a9w0w4xqvgincz-docker-17.09.0-ce-man
gzipping man pages under /nix/store/jb688pnw1m9lx69qc3a9w0w4xqvgincz-docker-17.09.0-ce-man/share/man/
patching script interpreter paths in /nix/store/jb688pnw1m9lx69qc3a9w0w4xqvgincz-docker-17.09.0-ce-man
checking for references to /tmp/nix-build-docker-17.09.0-ce.drv-0 in /nix/store/jb688pnw1m9lx69qc3a9w0w4xqvgincz-docker-17.09.0-ce-man...
/nix/store/qdn6f8g5faq5xknkvi2kljf25nrb96rb-docker-17.09.0-ce

@NeQuissimus
Copy link
Member

Ah, I missed that! Makes sense now... I think this is good to go then?!

@periklis
Copy link
Contributor Author

@NeQuissimus yes let's wait for the borg builds and then i'll push the squashed commits with the fixups.

@NeQuissimus
Copy link
Member

I think everything has been built, no?

@LnL7
Copy link
Member

LnL7 commented Nov 20, 2017

was waiting for the eval checks

@LnL7 LnL7 merged commit a6172a9 into NixOS:master Nov 20, 2017
@gilligan
Copy link
Contributor

Is there any documentation that could/should be written for this?

@NeQuissimus
Copy link
Member

I guess we're not squashing? :D Anyways, things should work fine now

@periklis
Copy link
Contributor Author

@periklis periklis deleted the init-docker-darwin-support branch November 20, 2017 20:21
@gilligan
Copy link
Contributor

@periklis that’s not documentation though, that is a link to a blog article talking about homebrew stuff ;)

I was wondering if smth could/should be added to the manual about using this.

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

Successfully merging this pull request may close these issues.

None yet

6 participants