!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

316 Members
A simple, stateless NixOS deployment tool - https://github.com/zhaofengli/colmena107 Servers

Load older messages


SenderMessageTime
8 Aug 2022
@blaggacao:matrix.org@blaggacao:matrix.org

To put it with physics, we need to iprove the bond-energy of otherwise linux-philosophy tool-atoms.

On the command line, the bond is very clear, usually it's |.

But that simplicity doesn't apply for a nix fabric.

17:15:22
@blaggacao:matrix.org@blaggacao:matrix.org* To put it with a chemistry analogy to assent the argument: we need to iprove the bond-energy of otherwise linux-philosophy tool-atoms. On the command line, the bond is very clear, usually it's `|`. But that simplicity doesn't apply for a `nix` fabric.17:15:56
@blaggacao:matrix.org@blaggacao:matrix.org* To put it with a chemistry analogy to assent the argument: we need to improve the bond-energy of otherwise linux-philosophy tool-atoms. On the command line, the bond is very clear, usually it's `|`. But that simplicity doesn't apply for a `nix` fabric.17:16:16
@blaggacao:matrix.org@blaggacao:matrix.org* To put it with a chemistry analogy to assent the argument: we need to improve the bond-energy of otherwise linux-philosophy tool-atoms. On the command line, the bond is very clear, usually it's `|`. But that simplicity doesn't apply for a repository-spanning (i.e. world-spanning) `nix` fabric.17:16:52
10 Aug 2022
@luxus:furiosa.orgluxus joined the room.09:54:50
@dantefromhell:matrix.orgdantefromhell
In reply to @blaggacao:matrix.org

To put it with a chemistry analogy to assent the argument: we need to improve the bond-energy of otherwise linux-philosophy tool-atoms.

On the command line, the bond is very clear, usually it's |.

But that simplicity doesn't apply for a repository-spanning (i.e. world-spanning) nix fabric.

very true, as someone who has 20+ years of itops this still feels mostly unresolved and often unthought of.

I'm curious if you can provide more details to the solution you found?

21:14:41
@blaggacao:matrix.org@blaggacao:matrix.org

Well, colmena uses an evaluator (instead of for example the nix bundle interface) in order to parallelize the evaluation. So at its heart, it's a speed consideración.

The receptor interface is established in src/nix/eval.nix and that defines the incoming schema as well as the intermediate schema that can be processed by the CLI.

There are two solutions:

  • don't use an evaluator, but rather consume a well-knowm flake attribute (which is already evaluated - this is the divnix/std approach with __std)
  • make the evaluator swappable colmena --eval ./path/to/eval.nix so that you can consume arbitrary inout contracts via a custom evaluator.

Since colmena strives for optimization and parallelization, the second option is really the beat choixe.

For something like divnix/styx, I don't know yet, I'll probably just going to wrap the nix bundle interface within the CLI. It's probably not parallelized, but it is easly swappable for a custom evaluator. WIP, so I might get more insight as I go.

21:21:43
@blaggacao:matrix.org@blaggacao:matrix.org

From the bundler docs:

A bundler must be a function that accepts an arbitrary value (typically a derivation or app definition) and returns a derivation.

23:50:31
11 Aug 2022
@janejasperous:one.ems.hostJane Jasperous man nix3-bundle 08:24:47
@janejasperous:one.ems.hostJane Jasperous *

man nix3-bundle

and

https://github.com/NixOS/bundlers

08:25:57
@janejasperous:one.ems.hostJane Jasperous *

man nix3-bundle

and

https://github.com/NixOS/bundlers

I had missed this

08:31:04
13 Aug 2022
@ronnypfannschmidt:matrix.org@ronnypfannschmidt:matrix.org joined the room.12:01:57
@farcaller:matrix.orgfarcaller joined the room.14:26:22
@farcaller:matrix.orgfarcaller o/ I'm a bit confused as to where do I start, given colmena requires a host that's already running nixos (unless I missed anything?) can I just nix-build some base image for a vm myself then? do I need to be somehow specific about it? 14:28:16
@farcaller:matrix.orgfarcalleractually looking at what it did to a test system it seems that it pretty much wiped everything kubevirt builder did and got the “new” nixos rolling. Am I correct to assume that the base system is effectively lost configuration wise so it doesn’t really matter what I boot into?15:33:26
@kity:kity.wtfproblems joined the room.17:08:05
@jhillyerd:matrix.org@jhillyerd:matrix.orgYeah, that's typically how nixos deploys work, the base system is mostly lost.17:24:00
@farcaller:matrix.orgfarcallergotcha, thanks for clarifying17:27:47
@jhillyerd:matrix.org@jhillyerd:matrix.orgI think the old channel configs hang around, so you can end up with some very old environments when using nix-env or nix-shell on those hosts. Not sure if there is a better way to control that.18:12:35
@farcaller:matrix.orgfarcallerefficiency wise that means I can’t quite build a base image and finish the configuration with colmena because that will effectively overwrite everything and negate any benefits of deploying from a snapshot, right?18:24:44
@jhillyerd:matrix.org@jhillyerd:matrix.orgIf the base and the colmena config are built off of different versions of nixpkgs, then yes, you'd be uploading mostly new /nix/store contents18:25:59
@farcaller:matrix.orgfarcalleroh right; and I can freeze those.18:28:31
@farcaller:matrix.orgfarcallerthanks!18:28:35
15 Aug 2022
@tim92:matrix.orgtim joined the room.06:10:23
16 Aug 2022
@ruddy:leohoo.xyz@ruddy:leohoo.xyz joined the room.12:12:19
@ruddy:leohoo.xyz@ruddy:leohoo.xyz left the room.12:12:22
@rdk31:matrix.orgrdk31 joined the room.19:39:44
@kayla.fire:matrix.orgkayla (she/they) joined the room.21:30:57
17 Aug 2022
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @blaggacao:matrix.org

Well, colmena uses an evaluator (instead of for example the nix bundle interface) in order to parallelize the evaluation. So at its heart, it's a speed consideración.

The receptor interface is established in src/nix/eval.nix and that defines the incoming schema as well as the intermediate schema that can be processed by the CLI.

There are two solutions:

  • don't use an evaluator, but rather consume a well-knowm flake attribute (which is already evaluated - this is the divnix/std approach with __std)
  • make the evaluator swappable colmena --eval ./path/to/eval.nix so that you can consume arbitrary inout contracts via a custom evaluator.

Since colmena strives for optimization and parallelization, the second option is really the beat choixe.

For something like divnix/styx, I don't know yet, I'll probably just going to wrap the nix bundle interface within the CLI. It's probably not parallelized, but it is easly swappable for a custom evaluator. WIP, so I might get more insight as I go.

Ok, finally have some time for Colmena, so let's talk about swappable eval. My primary concern with it is that it may limit the potential for larger changes to the deployment flow, such as support for something like profiles/activators in deploy-rs. I'm also a bit wary of wrapped versions of Colmena with the swappable evaluator overridden exhibiting totally different behavior, causing confusions with the user.
03:03:38
@zhaofeng:zhaofeng.liZhaofeng Li

A new related development is that flake evaluation is finally pure [1]. The current implementation is to generate a temporary flake containing eval.nix and friends that depends on the user flake as an input.

[1] For nix-instantiate at the moment. The streaming evaluator nix-eval-jobs requires a change to be upstreamed.

03:03:56

Show newer messages


Back to Room ListRoom Version: 6