News for hackers. Stuff that matters.
Re:NixOS and Stateless Deployment by falcolas on Sunday January 04, 2015 @11:10AM (#8834784)
Please forgive me if I have trouble taking advice from someone who has set up "tens" of servers and doesn't appear to understand the current set of orchestration tools.

Don't get me wrong, Nix sounds great, but this is a poor article from an inexperienced sysadmin who is unable to really point out the pros and cons.

Re:NixOS and Stateless Deployment by mercurial on Sunday January 04, 2015 @11:24AM (#8834848)
As a guy who is in no way a sysadmin but has devops experience, I thought he nailed it pretty well. Take Ansible. It is declarative: you write down the list of packages you expect to find on the target machine(s), and Ansible will install any that is missing. Now, you remove one of these packages from your playbook. Is it magically uninstalled from the targets? Absolutely not. Because the playbook doesn't describe the "state of the world" in its entirety. A NixOS file does that. Remove postgresql from a master NixOS configuration file? Update and no more Postgres. Because everything that NixOS manages is described (installed software, configuration, etc) (1).

1: Actually, last time I looked at NixOS, you could also install things the imperative way, but that's a silly thing to do.

Re:NixOS and Stateless Deployment by curun1r on Sunday January 04, 2015 @03:20PM (#8835664)
He did forget to mention Terraform, a tool that suffers from none of the problems he mentioned. And I'm sure there are other DevOps tools that handle state management.

All these tools have to deal with the problem of state. Most of them choose to handle it implicitly...the state of the system is the state and the tool tries to determine it at runtime. This strategy has all the problems listed in the article. Other tools attempt to keep a record of the state. This solves the issues from the article but has it's own set of issues (mostly state management and state corruption). Neither approach is objectively right and both have their tradeoffs.

I honestly agree with the original, down-voted, poster...the article is a bit preachy without much insight. The rise of DevOps has turned system administration into a CS problem. And, like most other CS problems these days, it all boils down to managing state. And just like there are many approaches to state management in application architecture (RDBMS, NoSQL, Paxos/Raft, etc) where no solution is objectively right, there will be many approaches to state management in DevOps where no solution is objectively right. The author obviously has his preferences, but his analysis is biased and incomplete and should be called out as such.

Re:NixOS and Stateless Deployment by gfxmonk on Sunday January 04, 2015 @04:58PM (#8836036)
OP here. I've heard of terraform, although I've not investigated it much further than that.

It sounds like it's mostly a provisioning tool, and doesn't really help with configuration management once your machines exist. From the "terraform vs chef / puppet" page:

> Terraform enables any configuration management tool to be used to setup a resource once it has been created. Terraform focuses on the higher-level abstraction of the datacenter and associated services [...]

So it sounds like like a very nice provisioning tool, but doesn't really compete with NixOS itself. Perhaps you could even use it to provision NixOs machines?

Re:NixOS and Stateless Deployment by bojo on Sunday January 04, 2015 @07:49PM (#8836576)
You probably want to check out HashiCorp's full stack they recently released dubbed 'Atlas', in which Terraform is one small component: https://atlas.hashicorp.com/
Re:NixOS and Stateless Deployment by curun1r on Sunday January 04, 2015 @09:54PM (#8836915)
I don't want a tool that does both provisioning and configuration management as I feel the latter should be a real-time concern rather than a deploy-time concern. Using Consul (https://consul.io) and Consul Template (https://github.com/hashicorp/consul-template), we're able to keep configuration centralized, secure and have it deployed automatically every time it changes. And it removes the distinction between configuration changes that are triggered by some event (machine failure, network partition, monitoring, auto-scaling, etc), changes that are triggered by a developer commit and changes that operations wants to make (maintenance, DDoS response, etc). Terraform provisions all of that and then configuration management happens on an ongoing basis.

I'm really not trying to sound like a shill for Hashicorp, but we use a bunch of their tools and find them to be, overall, very worthwhile and focused on accomplishing a single logical task which makes them easily composable with tools from other vendors. I also don't want it to sound like I'm criticizing Nix or NixOS...they sound like excellent tools. My only point was that there are other ways to solve the problems expressed in the posting and that each solution has tradeoffs that DevOps needs to consider when designing infrastructure. Your blog struck me as being a strawman criticism of somewhat dated tools without consideration for newer options, especially since your discussion of Docker was so narrowly focused on the actual Docker tool without any consideration given for Fleet, Swarm, ECS or any of the host of orchestration options in the Docker ecosystem.

If you'd written it more from a position of "here's how NixOS has made my life easier," you'd probably find that people would be more receptive to it. But, instead, it had a "here's why NixOS is better than the alternatives" feel to it which is going to rub people the wrong way when it's pretty clear that you're not aware of all the alternatives. NixOS is one good option, but it's by no means the only good option.

> Perhaps you could even use it [Terraform] to provision NixOs machines?

You definitely can, so long as your servers are virtualized. Terraform is significantly less useful in a bare-metal world. However Terraform is really about provisioning specific machines. For example, you might write Terraform to provision 1 SMTP server, 3 web front-ends behind a load balancer and 2 database hosts. But it's pretty crude at doing provision-time tasks...it basically allows you to run shell commands. Where you'd do the bulk of your provisioning would be in a tool like Packer, Aminator or other such tool that creates VM images that can be deployed. That's where you'd start with a base NixOs image and then declare what's installed on an SMTP server, a web front-end and a database server. Terraform would just reference those images and size the machines.

Re:NixOS and Stateless Deployment by gfxmonk on Sunday January 04, 2015 @11:01PM (#8837176)
Fair points. I started the post by stating that I (personally) wanted to use NixOS in the future, but admittedly didn't maintain that tone throughout the piece.

I definitely have humble requirements in terms of deployment size, so (for me) any orchestration tool is likely to be way more effort than it's worth. I compared NixOS (not a deployment tool) to those other (small-scale deployment and/or configuration management tools) because that's what I and plenty of developers I know have used, and I think the comparison helps illustrate the issues that NixOS can solve. Hopefully those who _do_ have experience and need for larger orchestration software can tell from reading whether the problems NixOS solves are relevant to them.

Re:NixOS and Stateless Deployment by josteink on Sunday January 04, 2015 @11:31AM (#8834871)
> Actually, last time I looked at NixOS, you could also install things the imperative way, but that's a silly thing to do.

Actually not, because if you do, you will find these changes added to a file declaratively describing all the changes you have committed to the system (or user-context) as a whole.

It's a good way to build a config if you're not fully comfortable with nix-syntax.

I don't remember where the file ends up, but it is there.

Re:NixOS and Stateless Deployment by tel on Sunday January 04, 2015 @11:40AM (#8834895)
I think it's $HOME/.nix-profile/manifest.nix
Re:NixOS and Stateless Deployment by mercurial on Sunday January 04, 2015 @01:31PM (#8835301)
Ah, interesting. Thanks for the precision.
Re:NixOS and Stateless Deployment by mercurial on Sunday January 04, 2015 @11:33AM (#8834876)
(I'll admit that it doesn't address the point you were trying to raise rather ungraciously, namely, how well NixOS deployment tooling scale to really large deployments, which is a good question to ask).
Re:NixOS and Stateless Deployment by gfxmonk on Sunday January 04, 2015 @11:21PM (#8837261)
That's a fair question. I'll let you know if I find out ;)

My hunch is that it could scale well, but would require some integration work in order to use it nicely with existing orchestration tools. I don't know exactly what that would look like, or if it would be worth the effort of going off the beaten track.

Re:NixOS and Stateless Deployment by mSparks on Sunday January 04, 2015 @12:16PM (#8835041)
I don't get it. Stick in the CentOS CD, click install, add the root user account and password

And you're done. Server up and running. done about 20 of them in the last twelve months. What's all this "package" stuff about? what's wrong with yum?

Re:NixOS and Stateless Deployment by drinchev on Sunday January 04, 2015 @01:36PM (#8835315)
Yeah that's what I was doing for almost 5 years before I found Ansible. Now I even don't bother to put a CD. I go to my VPS provider and add a VPS then add my key and run an ansible playbook, which installs whatever I want, the way I wanted it.

The thing with package managers is that it get's boring to do everything all over again for a large amount of servers. Also your brain memory does not have a reliable version control. You need to keep why and how you do certain stuff on your server somewhere else. First thing that comes to your mind is a shell script and people are already using something better ( ansible, puppet, etc. ). Now, with this article, I see that there is something even better than this.

Re:NixOS and Stateless Deployment by bojo on Sunday January 04, 2015 @08:24PM (#8836669)
It's not just about installing a few packages with the package manager. You have system specific configuration, ranging from services to users to file systems and more, sometimes at odds with the state of a security patched/updated machine at any point in time. The way you configured the state of a machine 12 months ago might not be reflected when you build, update, and configure a machine today. This disconnect between installs gets compounded when you have to randomly log in and make minor tweaks to keep up with your ever-changing application specs (tweaks which rarely get documented), causing you or your successor to scratch their head wondering what steps are missing compared to before when doing a new build. This gets even more complicated when you build large clusters meant to scale, and can't afford to spend the time it takes to individually configure each machine. Orchestration aims at fixing this by giving you a way to bring the state of a freshly installed machine to the correct state of your production environment in an (ideally) consistent and repeatable manner, which is the whole point of all these fancy new products we're seeing these days.
Re:NixOS and Stateless Deployment by xorcist on Monday January 05, 2015 @03:12AM (#8837827)
One reason is because there is more than one of you.

By using Puppet, I never have to read my colleagues custom setup script because store it there. By checking in everything to version control, I see who has done what by reading the changelog.

If you are only managing your own servers and keep a strict discipline you will see less of the benefits.

Re:NixOS and Stateless Deployment by falcolas on Sunday January 04, 2015 @11:49AM (#8834929)
Actually, the point is not that Nix is bad (though there are reports of packages installing things you didn't want because someone thought a dependency of the root package might need it). It's that the author doesn't have enough experience as a sysamin to speak on Nix actual strengths and weaknesses when compared to tools they don't appear to understand very well.

This article is fluff because of this lack of experience; it honestly reads as another "looks at this cool thing I know nothing about!"

Re:NixOS and Stateless Deployment by cwp on Sunday January 04, 2015 @02:24PM (#8835465)
Ok, if it's fluff, do tell us what issues he overlooks. If he's made a mistake about how Puppet or Ansible work, point them out. In other words, criticize what he said, not his pedigree.
Re:NixOS and Stateless Deployment by thirsteh on Sunday January 04, 2015 @04:48PM (#8835989)
People who make ad hominem attacks usually can't do that.