Nixpkgs: document distributed builds and add test case

Created on 15 Apr 2017  路  9Comments  路  Source: NixOS/nixpkgs

Issue description

It's time consuming to set up distributed builds properly, no test case for that mechanism as well.
When configured improperly, error messages are not very useful.

Steps to reproduce

  1. Open /nixos/modules/tests folder
  2. grep for "distributedBuilds" and "buildMachines" options
  3. Observe empty output

  4. Open NixOS documentation (1 html page)

  5. Search for "distributed"

Technical details

  • System: NixOS: up to 17.03
stale

Most helpful comment

I updated the article to talk about features. Feel free to edit according to your experience.

All 9 comments

For reference: http://nixos.org/nix/manual/#chap-distributed-builds

I rewrote the nixos.wiki entry about this: https://nixos.wiki/wiki/Distributed_build
The article mentions that there is a NixOS test: https://github.com/NixOS/nix/blob/master/tests/remote-builds.nix#L46-L58

I failed to get it works on nixos-18.03. I have en error:

error: unable to start any build; either increase '--max-jobs' or enable remote builds

My configuration:

  ...
  nix = {
    autoOptimiseStore = true;
    maxJobs = 0; # disable build on local machine
    buildCores = 4;
    buildMachines = [
      {
        hostName = "builder";
        system = "x86_64-linux";
        maxJobs = 4;
        supportedFeatures = [ ];
        mandatoryFeatures = [ ];
      }
    ];
    distributedBuilds = true;
    extraOptions = ''
      builders-use-substitutes = true
    '';
  };

Of course, the root have access to builder and can run nix commands:

[root@nixie-laptop:~]# ssh builder nix-store --version
Warning: Permanently added 'debi,192.168.13.139' (ECDSA) to the list of known hosts.
nix-store (Nix) 2.0.2

[root@nixie-laptop:~]# nix ping-store --store ssh://builder
Warning: Permanently added 'debi,192.168.13.139' (ECDSA) to the list of known hosts.

What are you trying to build ? can you try to build with -vvvvvv ?
For example, nixos-tests need supportedFeatures=[ "kvm" "nixos-test"] otherwise nix will silently ignore the builders.

It seems to be works when I added "big-parallel" to the supportedFeatures.

I updated the article to talk about features. Feel free to edit according to your experience.

@symphorien Thanks

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@3noch @symphorien @katyo : thank you!

Was this page helpful?
0 / 5 - 0 ratings