Live data from Hacker News

Nix as OS X Package Manager

ariya.ofilabs.com

191–200 of 209 posts

Re: Nix as OS X Package Manager

#191
post #185

Earlier quoted context omitted.

> If I want to rebuild my machine same as before, or deploy build 100s of servers at different points in time with the same setup, reproducibility is necessary. No it isn't. Reproducible is talking about the process or steps needed to make a machine. You do not need to repeat the steps to produce the first machine to produce the second machine. You can simply clone the first machine, and Docker makes this very easy t…

> Reproducible is talking about the process or steps needed to make a machine. You do not need to repeat the steps to produce the first machine to produce the second machine. You can simply clone the first machine, and Docker makes this very easy to do. Cloning is not the answer since it's all or nothing -- where reproducibility can be achieved piecemeal. Only offering cloning means that starting with the same initia…

> Only offering cloning means that starting with the same initial Dockerfile and making some needed updates to it, one can't be sure that the NON updated parts will be producible. So you don't get flexible reuse.

What exactly do you mean by flexible reuse, and why is it good? What exactly do you mean by NON updated parts and what does it mean that they are "producible"?

I don't understand your words. Speak plainly!

I don't use a Dockerfile, and the interactive development approach means normally you start up your clone, work on it for a bit, then commit the clone.

Here's an example:

    $ docker run -t -i debian:jessie bash
    root@264b51d62d0e:/# apt-get install nvi
    E: Unable to locate package nvi
    root@264b51d62d0e:/# apt-get update
    root@264b51d62d0e:/# apt-get install nvi
    $ v=`docker commit 264b51d62d0e`
    $ docker tag $v whatever
The mistake with the first line didn't mean I needed to start over. In a realistic example that could save me an hour of rebuilding. I can push my tag to other developers I'm working with, and they can use `docker diff` to find out what the differences are.

> But until one reaches that, they have to experiment with various configurations (to end with the specific Docker image they want). Without reproducibility, they can't be guaranteed that their various test configurations under test are the same and only their latest changes differ. Perhaps another thing they left as is broke too.

This is a danger that requires discipline. Committing instances is very cheap, so it is good practice to commit often, and keep notes (commit messages). I think version control is common enough that most sysadmins know how to do this, and other packaging systems suffer from the exact same problem.

However because it's interactive, that need to experiment is satisfied fully and the sysadmin/user gets to use all of their tools to develop the working prototypes.

> But if you mess with the clone it's not a clone anymore. And if a whole team has to mess with the clone over some period of time to update or fix it, there's hell to keep track what went on.

This is not true.

With Docker you are encouraged to make many clones and branches and try different things out. The clones that are useful get tagged and forwarded to others.

A sysadmin who isn't using version control has other problems!

> Only offering cloning also means that when you need to update only a part (e.g. because of security reasons) you can't just use the same dockerfile with the changed component and be sure that you'll get an otherwise identical system. So you don't get flexible updating.

I don't understand this complaint, but it mentions dockerfiles again. Let me be clear: I never use dockerfiles.

If I want to update for security reasons (as I mentioned in my heartbleed example), then I will find it easier and faster to implement the fixes interactively. Having to write my recipe for nix-os and run it and wait while it runs is insecure because you are vulnerable longer.

> Besides, reproducibility doesn't preclude cloning as part of the process -- it's a superset of it, offering way more flexibility.

The non-interactive (and "reproducible") approach is slower, less secure, more prone to errors. I don't believe it can possibly be "more flexible" since the interactive approach can do everything the non-interactive approach can do and faster.

I do admit that Docker's build artefacts use more disk space and more Internet bandwidth than plain text nix configuration artefacts, but this is not fundamental to interactive development, which is specifically what I'm advocating.

> Any significant contribution you might have for software engineering in regards to that?

> That's just an argument from popularity. And not necessarily a popularity they opted for, while also being provided with the alternative.

Arguing that "nobody does it so it must be wrong" isn't any better than "just because everyone does it doesn't make it right".

I really think you need to learn about something and make up your own mind, instead of repeating "Docker is Bad" because you read something like that on a blog.

I also think you should really try to understand what I am suggesting before you go arguing against it.

Re: Nix as OS X Package Manager

#192
post #185

Earlier quoted context omitted.

Any significant contribution you might have for software engineering in regards to that? Aside from merely believing that. I can't even tell what you mean. If I want to rebuild my machine same as before, or deploy build 100s of servers at different points in time with the same setup, reproducibility is necessary. There's not even one argument against that. If you have any, please oblige us. Should deployments be a su…

> If I want to rebuild my machine same as before, or deploy build 100s of servers at different points in time with the same setup, reproducibility is necessary. No it isn't. Reproducible is talking about the process or steps needed to make a machine. You do not need to repeat the steps to produce the first machine to produce the second machine. You can simply clone the first machine, and Docker makes this very easy t…

> You do not need to repeat the steps to produce the first machine to produce the second machine. You can simply clone the first machine, and Docker makes this very easy to do.

That's nice for cloning, it's not reproducability.

How do you know that the docker image was created with the right set of software? How do you know that there wasn't anything else added to it?

Copying the final image means you're just copying an opaque binary blob. You can't do the work yourself to build an image, and get the same docker image.

Something like "nix" makes that simple. Everyone can agree on the steps required to get from A to Z. Everyone can independently agree that each step looks the same for everyone.

For me, it's not about ease of use. It's about security and trust.

Re: Nix as OS X Package Manager

#193
post #152
post #47

Earlier quoted context omitted.

> You don't need to reproduce that working state: The work has already been done! My background is physics, and the philosophy there is "If you can't reproduce it, it doesn't exist." In my experience with software, sharing opaque binary blobs is a Bad Thing. It doesn't matter if the blob is a proprietary firmware image, or a "open source" docker image. It's a magic unreproducible image. And (to me, at least) therefor…

> In my experience with software, sharing opaque binary blobs is a Bad Thing And yet you don't know why. This is called dogma, and dogma is bad: It leads people to make stupid decisions over and over, all the while repeating that the alternative is worse.

> This is called dogma,

Then you don't know what the word "dogma" means.

What I said was "In my experience." i.e. practice learned over time.

This cannot be interpreted by any reasonable person as "blobs are bad, just 'cause."

That kind of straw man argument leads me to conclude that similar issues are being your inability to understand the use of reproducability.

Re: Nix as OS X Package Manager

#194
post #104

Earlier quoted context omitted.

You're not wrong, but Docker comes at it from a different angle; Docker expects you to be handing around tagged images, to solve a similar set (but not the same set!) of problems that reproducible builds solve. Ideally, I want _both_ of them: tagged Docker images being sent between environments (with `docker run -e SOME_ENV=testing imagename` for changing the internal config), but reproducible builds in my Dockerfile…

Yes, you can do this. There is a utility "nix-docker" that will convert a Nix configuration file into a BusyBox Docker image (see e.g. http://zef.me/blog/6049/nix-docker )

Unfortunately the repo says:

> DISCLAIMER: This project is no longer actively maintained and probably broken

Re: Nix as OS X Package Manager

#195
post #192
post #185

Earlier quoted context omitted.

> If I want to rebuild my machine same as before, or deploy build 100s of servers at different points in time with the same setup, reproducibility is necessary. No it isn't. Reproducible is talking about the process or steps needed to make a machine. You do not need to repeat the steps to produce the first machine to produce the second machine. You can simply clone the first machine, and Docker makes this very easy t…

> You do not need to repeat the steps to produce the first machine to produce the second machine. You can simply clone the first machine, and Docker makes this very easy to do. That's nice for cloning, it's not reproducability. How do you know that the docker image was created with the right set of software? How do you know that there wasn't anything else added to it? Copying the final image means you're just copying…

> How do you know that the docker image was created with the right set of software?

Define "the right set". If I ask someone to prepare something I might use

    docker export/diff
in part of the review process.

> How do you know that there wasn't anything else added to it?

    docker diff
> Copying the final image means you're just copying an opaque binary blob. You can't do the work yourself to build an image, and get the same docker image.

So what?

Why exactly do you think "copying an opaque binary blob" is bad?

Don't you ever copy files on your hard disk?

Have you ever used `dd` to copy a filesystem as a binary blob to a disk or a USB key?

Did you know "git" copies "opaque binary blobs" around? Do you really prefer RCS because the version control is stored in plain text files?

What exactly is your complaint here?

My position is simple, but apparently radical: I recommend interactive development of systems because it is better, and I define better as faster and more secure. "Reproducible" simply is not a goal.

> For me, it's not about ease of use. It's about security and trust.

You should rethink your position.

Nix packages from sources you don't trust aren't more secure than docker images (even if you use nix.useChroot=true), which, barring bugs in docker and Linux, at least get virtual memory, disk, and networking.

Nix packages built by yourself are harder to write than docker tags you build yourself.

Re: Nix as OS X Package Manager

#196
Having set up my last company doing all development and deployment using nix, moving to a new team which just uses pip/virtualenv and a "bootstrapping script" feels a little unnerving to start with.

Re: Nix as OS X Package Manager

#197
post #191

Earlier quoted context omitted.

> Reproducible is talking about the process or steps needed to make a machine. You do not need to repeat the steps to produce the first machine to produce the second machine. You can simply clone the first machine, and Docker makes this very easy to do. Cloning is not the answer since it's all or nothing -- where reproducibility can be achieved piecemeal. Only offering cloning means that starting with the same initia…

> Only offering cloning means that starting with the same initial Dockerfile and making some needed updates to it, one can't be sure that the NON updated parts will be producible. So you don't get flexible reuse. What exactly do you mean by flexible reuse, and why is it good? What exactly do you mean by NON updated parts and what does it mean that they are "producible"? I don't understand your words. Speak plainly! I…

> Only offering cloning means that starting with the same initial Dockerfile and making some needed updates to it, one can't be sure that the NON updated parts will be producible. So you don't get flexible reuse.

> What exactly do you mean by flexible reuse, and why is it good?

I already explained. What exactly don't you understand?

It's about being able to reuse a recipe (dockerfile, etc.) for creating your final artifact while ALSO being able to change it -- as opposed to the "take it or leave it" case with cloning some binary blob.

> What exactly do you mean by NON updated parts

I wrote "Only offering cloning means that starting with the same initial Dockerfile and making some needed updates to it, one can't be sure that the NON updated parts will be (re)producible".

My typo aside, the meaning is clear: with cloning available but no reproducibility, when you want to only change part of a container (e.g. update a specific piece of software there), you don't know (when you re-create the container) that the other parts you didn't change are as they were before.

Basically that's the very definition of non-reproducibility.

> I don't use a Dockerfile, and the interactive development approach means normally you start up your clone, work on it for a bit, then commit the clone.

That's neither a good, nor a new process. That's like 90's sysadmin work. For one, you're doing all this work manually. Second, if you want to revert/change something you made, you have to mess with your clone, potentially putting it in some weirdo state -- you basically remove the scriptability part and just mess with your clone manually. Or you write some custom scripts or use some provisioning software -- which brings you right back to the reproducibility discussion.

With reproducibility you wouldn't have to commit the clone -- just the "recipe" to make. And you would still COULD commit the clone if you wanted (as I said, reproducibility is a superset of merely working with clones).

> The mistake with the first line didn't mean I needed to start over. In a realistic example that could save me an hour of rebuilding.

Doesn't save you anything over reproducibility -- since the latter does not prevent cloning. But having only cloning (which is what the parent lamented) does deprive you of the benefits of reproducibility.

"In a realistic example", for example, things could get much more hairy (and many more tests and changes could be needed), beyond merely forgetting to update apt before installing nvi.

And all of these changes and process would be totally opaque to your clonable blob.

> I can push my tag to other developers I'm working with, and they can use `docker diff` to find out what the differences are.

The can use docker diff and try to guess what the differences are -- and what the intention was, etc. Because docker diff is just a record of file changes, not of procedures followed and the intentions behind them.

> This is a danger that requires discipline.

And that's (part) of the whole problem. Anything that requires discipline on the human part and that could be automated is busy-work -- and error prone.

> With Docker you are encouraged to make many clones and branches and try different things out.

Yes, but that's meant for safe-keeping, like vm-snapshots. It doesn't replacing actually having a written record of what you did, what's supposed to be istalled inside, and why.

> I don't understand this complaint, but it mentions dockerfiles again. Let me be clear: I never use dockerfiles.

So again, a throwback to the manual devops age.

> Arguing that "nobody does it so it must be wrong" isn't any better than "just because everyone does it doesn't make it right".

Perhaps. But I fail to see where I did that.

> repeating "Docker is Bad"

Who said Docker is bad? Docker is great. It's non reproducibility that's the issue.

Re: Nix as OS X Package Manager

#198
post #113
post #46

Could someone post (or link to) the history of Nix, the package manager? Who developed it, key project milestones, etc.? I understand it comes from, or led to, NixOS Linux distribution which uses Nix of course. The nixos.org website is a bit sparse on the Nix project's history, and same with wikipedia (though separately mentions that NixOS was a research project started by Eelco Dolstra in 2003).

I don't know if it's useful to you, but I can link you to Eelco Dolstra’s PhD Thesis (2006): http://nixos.org/~eelco/pubs/phd-thesis.pdf He also wrote this InfoQ article on the subject of Nix and NixOS which may have some useful information (2014): https://www.infoq.com/articles/configuration-management-with... The Wikipedia pages for Nix and NixOS also have some interesting references. https://en.wikipedia.org/wiki/…

Thanks for posting these links. I didn't know about the PhD thesis and the InfoQ article is the best introduction to Nix that I've read yet!

Re: Nix as OS X Package Manager

#199
post #196

Having set up my last company doing all development and deployment using nix, moving to a new team which just uses pip/virtualenv and a "bootstrapping script" feels a little unnerving to start with.

Is there any good guides to get started on nix with python?

Re: Nix as OS X Package Manager

#200
post #191

Earlier quoted context omitted.

> Only offering cloning means that starting with the same initial Dockerfile and making some needed updates to it, one can't be sure that the NON updated parts will be producible. So you don't get flexible reuse. What exactly do you mean by flexible reuse, and why is it good? What exactly do you mean by NON updated parts and what does it mean that they are "producible"? I don't understand your words. Speak plainly! I…

> Only offering cloning means that starting with the same initial Dockerfile and making some needed updates to it, one can't be sure that the NON updated parts will be producible. So you don't get flexible reuse. > What exactly do you mean by flexible reuse, and why is it good? I already explained. What exactly don't you understand? It's about being able to reuse a recipe (dockerfile, etc.) for creating your final ar…

> It's about being able to reuse a recipe (dockerfile, etc.) for creating your final artifact while ALSO being able to change it -- as opposed to the "take it or leave it" case with cloning some binary blob.

You must be confused. I can create and delete files on my filesystem -- changing it -- even though it is a binary blob.

Perhaps you mean something else?

> with cloning available but no reproducibility, when you want to only change part of a container (e.g. update a specific piece of software there), you don't know (when you re-create the container) that the other parts you didn't change are as they were before

I keep hearing you say when I want to re-create the container, but I don't ever hear you say why I would want to re-create the container.

> For one, you're doing all this work manually

Wrong. It's less manual work.

Writing a nixfile is manual work. It's hard manual work because none of the tools are interactive, and it's very distracting waiting for the computer to reply the nixfile between interations.

Interactive development is superior.

> if you want to revert/change something you made, you have to mess with your clone

No I don't. I discard it.

Do you use git rebase on your own history? Or do you create a new branch with a cleaned up history?

I do the latter.

> potentially putting it in some weirdo state

I don't need to reinstall my operating system every day because I get confused about what is on my computer.

> The can use docker diff and try to guess what the differences are -- and what the intention was, etc. Because docker diff is just a record of file changes, not of procedures followed and the intentions behind them.

The intentions are recorded in the commit log. That's why docker commit allows commit messages.

Procedures are only recorded if someone records them. Why would I do that if I only have to do it once?

> "In a realistic example", for example, things could get much more hairy (and many more tests and changes could be needed), beyond merely forgetting to update apt before installing nvi.

That's what I said, but you're missing the part where I don't have to wait hours and hours and hours while nix rebuilds my system over and over again.

"Reproducibility" has enormous costs, and the value proffered can be had with better tools.

> Anything that requires discipline on the human part and that could be automated is busy-work -- and error prone.

You're not automating the nixscript-writing, so you haven't saved any work. You've created busy-work by reinstalling your operating system over and over again.

> Yes, but that's meant for safe-keeping, like vm-snapshots. It doesn't replacing actually having a written record of what you did, what's supposed to be istalled inside, and why.

No, it's exactly a written record because that's what the commit messages are for.

If I want to know what's inside, there are other tools (dpkg) for taking inventory.

> So again, a throwback to the manual devops age.

Nonsense.

For some reason you only want to count the time that your script is running from when it is finished, instead of the time and expertise needed to develop the script in the first place, that you only need to run once.

If you can't understand that a sysadmin's job, whether they are writing a nixfile or they are directly interacting with a machine, is manual work, then I just can't imagine how I can be understood by you.

That's insane.

Post reply on HN