-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
Support building fully remotely #260
Comments
👍 ran into the exact same issue |
I have a patch somewhere... |
@domenkozar about that patch... send it to me and I'll clean it up? Or is it ready to go? |
In theory this is already supposed to work. From the code:
|
Yeah the work that needs to be done is to check if platforms match and provide a way to override the default to on or off. |
Found it, it was written by @goodwillcoding https://gist.github.com/goodwillcoding/9c536748ba80da2eeebd |
Hm, calling |
@edolstra actually there are two problems and my report above doesn't highlight them properly.
|
How about designating a push host, from which other systems get populated? Defaulting to localhost but if set to the build host and if SSH behaviour is fixed, that would behave as I'd prefer. |
The problem with a push host is that there is no guarantee that it has connectivity to the other machines (e.g. if you deploy a network with EC2 machines in different regions). |
@edolstra But in that case you simply keep the push host as localhost and I'm now wondering how to make that work. The push host needs to initiate So deploying from scratch with a remote push host would be:
Would that work? On Wed, Apr 15, 2015 at 2:27 PM Eelco Dolstra notifications@github.com
|
Forgot to add:
On Wed, Apr 15, 2015 at 3:12 PM Wout Mertens wout.mertens@gmail.com wrote:
|
Just for reference, this also addresses #195 |
I just downloaded and started playing with nixops, starting with examples from the manual, and hit this issue pretty quickly. I'm also too new to Nix{,OS,ops} to unstick myself even by manually fixing things up as described in this issue description. No fun! |
👍 I'm trying to deploy and it's taken ~8 hours so far. |
@aszlig can you post here your findings? Just for future reference :) |
The problem with Another idea I had was to instantiate the individual machines, copy-closure the |
FWIW I put together something to easily set up a linux remote builder running docker (https://github.com/holidaycheck/nix-remote-builder). Based on the code that @edolstra pasted having a remote builder configured would be a workaround for this I assume? Obviously not needing the remote builder in the first place would be better I suppose. |
Relevant #412 |
This feature is unfortunately a dealbreaker for me. I love Nix, but I also have to run on macOS. I was surprised to learn that this is not how nixops actually works. IMHO it severely limits the potential userbase for nixops and puts a damper on growth relative to other tools like terraform. Also seems that this would solve a number of other issues brought up in the past: #560, #976. |
FWIW, I did end up getting this working just fine with the help of this article: https://medium.com/@zw3rk/provisioning-a-nixos-server-from-macos-d36055afc4ad |
I think I still don't get why we need to download everything on the client side. Couldn't we just add an option to push the configuration.nix file on all the servers, and then run a switch from all the servers? That way, most of the time the servers will just download precompiled binaries from the nixos cache so it will be much more efficient to download it from there rather than from the client (who may have a very poor connection). |
@tobiasBora It's not as easy as it sounds because the configuration needs to be complete. So in fact the configuration.nix would need to set the environment to what it is on the build host, import the nixops deployment configuration and extract its host configuration, and include all its nix dependencies. Possible, but not trivial. But indeed, adding your own cache is probably pretty easy and then what you propose would be really nice. The added bonus is being able to run |
I'm not super familiar with nixops, but this doesn't actually sound that hard. And in fact all these steps could still on the client machine IIUC. The client machine could evaluate the nixops expression, send the right subexpressions to the right machines and then run |
Indeed, this is all technically possible and even desirable, and if this were JavaScript someone would probably have already done it. I know there is a Haskell parser for Nix, perhaps that project can do the heavy lifting. There's also nixjs written by @svanderburg but I don't know if it is at a level that it can extract dependency trees from Nix. Even something that copies all the files that might be needed instead of only the files that are needed would be great. |
Yeah, this seems like a good way to go. And pretty easy too! |
It's not possible to just push the whole configuration as a first step ? (Special care may be needed for secrets, but not sure)
|
If you're running nixops on your OS X laptop and deploy, it will first download a bunch of things to your laptop and fail at some point because you're on Darwin. Next, you log in on the deployed remote host and add your own ssh key so that nix-build can use the host. Then, you deploy again and it starts uploading what it just downloaded. This is not a nice user story.
It would be great if there was support for a buildhost, which runs the deployment build and then pushes to the other nodes in the network. One or more of the machines in the network are marked as workers and one is marked as nixops master. If the nixops master is defined it will perform all downloads and coordinate builds, and all other machines are populated from it.
Something like that? Or at the very least documenting a workflow like "deploy a VM from this image, do this to make it into a regular nixos machine with nixops and copy your network definitions on there" would be nice.
The text was updated successfully, but these errors were encountered: