Distributed build: Difference between revisions

Link to Nixos-rebuild#Deploying_on_other_machines
Axka (talk | contribs)
m Minor wording changes
 
(2 intermediate revisions by 2 users not shown)
Line 40: Line 40:
{{Tip|The best test to check that the SSH access works for Nix is to run on your local machine:
{{Tip|The best test to check that the SSH access works for Nix is to run on your local machine:


<code>nix store ping --store ssh://<REMOTE-BUILDER></code>
<code>nix store info --store ssh://<REMOTE-BUILDER></code>


Where <code><REMOTE-BUILDER></code> is the remote builder's IP address, host address or whatever name you configure in ~/.ssh/config or /root/.ssh/config, including the user@ prefix.}}
Where <code><REMOTE-BUILDER></code> is the remote builder's IP address, host address or whatever name you configure in ~/.ssh/config or /root/.ssh/config, including the user@ prefix.}}
Line 145: Line 145:
     # default is 1 but may keep the builder idle in between builds
     # default is 1 but may keep the builder idle in between builds
     maxJobs = 3;
     maxJobs = 3;
     # how fast is the builder compared to your local machine
     # how fast is the builder compared to other remote builders
     speedFactor = 2;
     speedFactor = 2;
     supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
     supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
Line 244: Line 244:
* How do I know why my builds aren't being distributed?
* How do I know why my builds aren't being distributed?
** Run <code>nix build -vvvvvvvvv 2>&1 | less</code> and search for <code>decline</code>.
** Run <code>nix build -vvvvvvvvv 2>&1 | less</code> and search for <code>decline</code>.
* I can <code>nix store ping</code> but the build doesn't distribute.
* I can <code>nix store info</code> but the build doesn't distribute.
** If on NixOS, Check that <code>nix store ping</code> command works when run as root.
** If on NixOS, Check that <code>nix store info</code> works when run as root.
** If you configured builders on the command line (with <code>--builders</code>), make sure your account is in <code>nix.trustedUsers</code> in <code>/etc/nixos/configuration.nix</code>. Only <code>/etc/nix/nix.conf</code> is taken into account otherwise.
** If you configured builders on the command line with the <code>--builders</code> flag, make sure your account is in <code>nix.trustedUsers</code> in <code>/etc/nixos/configuration.nix</code>. Otherwise only <code>/etc/nix/nix.conf</code> is taken into account.
* I can ping the store as root, but I'm getting "broken pipe" errors when trying to distribute.
* I can <code>nix store info</code> as root, but I'm getting "broken pipe" errors when trying to distribute.
** You may have hit bug {{Issue|46038}}. Add <code>nix.distributedBuilds = true;</code> to <code>configuration.nix</code> and <code>nixos-rebuild switch</code>.
** You may have hit bug {{Issue|46038}}. Add <code>nix.distributedBuilds = true;</code> to <code>configuration.nix</code> and <code>nixos-rebuild switch</code>.