Live data from Hacker News

NixOps – Declarative cloud provisioning and deployment with NixOS

nixos.org

31–40 of 67 posts

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#31

I would love if someone could compare NixOps with BOSH.

I haven't done much Nix, but I do peek over the fence now and then because I (and others) wonder about applying it to buildpacks and/or OCI layer construction. I do a lot more BOSH, since I work at Pivotal. So these remarks are probably wrong.

However, from my ignorant viewpoint:

The deep agreement is that machine-level statefulness is evil. Trying to repair it in-situ is pointless when you can simply reset to known-good states.

BOSH does this at the whole-machine level. You get a stemcell (fixed target), you get releases (fixed configuration of software) and you get deployments (fixed mappings from releases into running systems).

When you make a change, you redeploy. BOSH recompiles any changed release packages and then rolls them out across the fleet, starting with canaries.

BOSH lets you define the number of VMs, networks and whatnot; I'm not sure if NixOps does.

Treating components as replaceable is the main point of departure from previous generations of configuration management, which largely evolved out of a world in which the mission was "make this single machine look right, starting from an unknown state".

NixOps appears to do something similar. I'm unclear as to whether it operates at the whole-machine level (à la BOSH) or whether it can perform transformations within an existing machine. The latter would, obviously, be a lot faster than replacing VMs wholesale.

That said, whole-machine replacement does have one accidental benefit: it's ruthless. You very quickly encounter the one-in-a-million edge cases for running services because BOSH will quite unmercifully steamroll VMs during a deploy. Any stateful distributed services that aren't ready to have running machines yanked from under them at short notice will quickly reveal themselves.

You'd be surprised how many systems that advertise themselves as tolerant to random machine loss ... er ... aren't. Not sure much how I can go into this, but some distributed systems do much more poorly than the stuff on the tin suggests, even after substantial engineering on our part to try and prop them up.

Disclosure: I work for Pivotal, so I use BOSH sometimes in my dayjob. But I'm by no means a capable operator or BOSH expert.

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#32
post #4

Earlier quoted context omitted.

I don't really see Nix as a limitation. It has a good claim to being a universal system configuration tool. Or how do you mean it's limited?

Can I use it to deploy either client or server applications on windows? All configuration and deployment tools I've looked at seem like they assume the only deployment target is linux servers running web applications. I don't care about the web. I need a deployment tool that works for local research on my clients' analysts' desktops, not just devops on remote somewhere.

Nix supposedly works in the new Linux subsystem of Windows 10, but I haven't tried it.

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#33
post #32

Earlier quoted context omitted.

Can I use it to deploy either client or server applications on windows? All configuration and deployment tools I've looked at seem like they assume the only deployment target is linux servers running web applications. I don't care about the web. I need a deployment tool that works for local research on my clients' analysts' desktops, not just devops on remote somewhere.

Nix supposedly works in the new Linux subsystem of Windows 10, but I haven't tried it.

Nix itself does indeed work on the latest version of WSL. However, there are still issues with building most of the packages from nixpkgs. For instance, I'm still waiting for this issue to be solved: https://github.com/Microsoft/BashOnWindows/issues/1878

Other distros are also affected by these issues, so I think they'll be solved eventually.

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#34
post #15

Earlier quoted context omitted.

The `none` provider works for any servers that has an ssh connection. I use it myself to maintain my server on vultr.com . It has been pretty neat!

So put on a Nix overlay on your Linux/Unix flavor of choice like people have done with pkgsrc in and outside the NetBSD community?

I don't know how NetBSD handles this, but for any provider that doesn't allow you to use custom ISO's or ipxe, you can use [nixos-in-place](https://github.com/jeaye/nixos-in-place). I've used it before. It isn't ideal, but it gets the job done.

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#35
post #2

Seems neat, better than Terraform, although limited to just nix and a few providers. Hopefully that will grow. I've been working on a provisioning tool myself. Provisioning is hard, and supporting multiple APIs can be really difficult.

The `none` provider works for any servers that has an ssh connection. I use it myself to maintain my server on vultr.com . It has been pretty neat!

FYI, there's a WIP PR for Vultr backend support in NixOps.

https://github.com/NixOS/nixops/pull/634

I cherry-picked this into my local NixOps repo and have been using it for several weeks to deploy to Vultr servers with no issues, except one -- the author has hard-wired an assumption that you're using Btrfs for your root filesystem. I didn't want that so I simply replaced that hard-wired assumption with ext4 in my personal branch. Now everything is working great.

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#36
post #27
post #16

In view of some replies downthread: yes, application-level management is entirely possible with Nix(OS). Currently, this works best for Haskell, for which there is a sizeable amount (relatively speaking) of Nix tooling available. This is largely because a lot of Nix(OS) users also use Haskell, perhaps because lend themselves to very similar modes of "declarative" thinking. This is a thorough, excellent guide on how t…

We use NixOS in production in our product, for our cloud services, and for some development environments. We build everything with nix from sbt projects, go projects, haskell projects, purescript projects, docker images, and npm projects. It's an incredible tool. NixOps is also a good tool but there are a lot of issues with it we haven't had time to contribute fixes for. We also wanted it to be lighter weight and to…

Are you able to share your tool?

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#37
post #11
post #7

Earlier quoted context omitted.

When I last tried it about 6 months ago it seemed to be a complete mess. I failed to get any recent ruby gems installed. There were dozens of different articles describing how to work with package repositories, and all of them seemed to be outdated by varying degrees. I also got the feeling that nix had more of a focus on desktop systems, for whatever reason.

I use it as a system level configuration tool, and then use Docker for the application level. This is not how the NixOS sees itself ideally, but in my experience their ideology does not map well to the reality of application deployment. So what I do is have all system level tools installed using NixOS: the OS, logging, systemd, Docker, sshd and so on. Then I have my applications built as Docker containers and provisi…

That sounds reasonable, but it kinda makes me question NixOS' value proposition. It seems that any one of the current distributions works well as a generic base for containers.

There are probably lots of systems running standard Linux packages with more complex configurations (i.e. Mailservers, maybe databases, proxies etc) where I could imagine it being useful? Or maybe their desktop work makes more sense than I thought–my desktop environment is much more customised than any server, and I've never tried if the setup scripts I try to maintain actually work.

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#38
post #11

Earlier quoted context omitted.

I use it as a system level configuration tool, and then use Docker for the application level. This is not how the NixOS sees itself ideally, but in my experience their ideology does not map well to the reality of application deployment. So what I do is have all system level tools installed using NixOS: the OS, logging, systemd, Docker, sshd and so on. Then I have my applications built as Docker containers and provisi…

That sounds reasonable, but it kinda makes me question NixOS' value proposition. It seems that any one of the current distributions works well as a generic base for containers. There are probably lots of systems running standard Linux packages with more complex configurations (i.e. Mailservers, maybe databases, proxies etc) where I could imagine it being useful? Or maybe their desktop work makes more sense than I tho…

I don't think any operating system at this moment does well as a base for containers. At least not from the box, and as soon as you have to customise the OS you need tooling like Puppet/Chef/Salt to make your customizations reproducible. And that's the exact value proposition of NixOS, it's not only reproducible, the OS will be a complete reflection of your Nix specifications from the ground up.

I feel NixOS definitely gets some stuff wrong, and I hope at some point it gets some good competition. Mainly because the Nix language looks a bit awkward to me, and also because I don't fully get their package management situation. But the idea of having the operating system be configured from a specification is just a level up from old fashioned linux distros.

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#39
post #7
post #4

Earlier quoted context omitted.

I don't really see Nix as a limitation. It has a good claim to being a universal system configuration tool. Or how do you mean it's limited?

When I last tried it about 6 months ago it seemed to be a complete mess. I failed to get any recent ruby gems installed. There were dozens of different articles describing how to work with package repositories, and all of them seemed to be outdated by varying degrees. I also got the feeling that nix had more of a focus on desktop systems, for whatever reason.

Well, Nix is probably never going to be usable by non-developers and is very far from production quality for any kind of infrastructure. I mean theoretically you can use it in production if you avoid nixpkgs and make your own package repository with your own packages and your own tools. Playing with it on desktop is fine, although you can't get far without learning the language, reading sources and doing some functional programming.

Still, Nix should be at least an inspiration for next real world package managers.

Re: NixOps – Declarative cloud provisioning and deployment with NixOS

#40
post #16

In view of some replies downthread: yes, application-level management is entirely possible with Nix(OS). Currently, this works best for Haskell, for which there is a sizeable amount (relatively speaking) of Nix tooling available. This is largely because a lot of Nix(OS) users also use Haskell, perhaps because lend themselves to very similar modes of "declarative" thinking. This is a thorough, excellent guide on how t…

I love Nix concepts and all it's subprojects (NixOS, NixOps, Hydra, Disnix).

However, i've found NixPkgs to be a bit messy. It's too big, targets too many platforms and it's too disorganised. But to be completely fair, I think it's getting a lot of good refactorings lately.

Post reply on HN