!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

You have reached the beginning of time (for this room).


SenderMessageTime
10 Apr 2023
@whentze:matrix.orgWanja Hentzewe built something like that at work, kinda20:21:19
@whentze:matrix.orgWanja Hentzebut it's quite intertwined with our own CI logic20:21:34
@whentze:matrix.orgWanja Hentzedefinitely works20:21:37
@dantefromhell:matrix.orgdantefromhell
In reply to @me:indeednotjames.com

Which hosts require an apply after submitting a patch/ security fix/ bugfix to one of the source repos?

you could probably also just colmena build all nodes and check which nodes produce a different outpath and then only apply those

*

building to verify feels wrong in an environment where all inputs (config & packages) are managed declaratively.

the list of affected hosts should be queryable - e.g. within a CI/CD pipeline because we have all the inventory information available

22:56:02
@dantefromhell:matrix.orgdantefromhell

Emily:

colmena is stateless by design. and to know which nodes need to updated, you would have to keep track of the nodes closures/generations.

I disagree. For 1 commit this query should always be doable without contacting any host because the desired inventory state is declared.

The situation I can think of where you need to check the deployed closures is if you are trying to solve "configuration drift" and deployment of patches with a single solution - which is kinda the common pattern in non-declarative environments.

But if you're looking at config drift (which I'm still wondering if that can actually be a reasonable thing within NixOS given the generations mechanism 🤔) and the "affected query" as 2 separate problems the aforementioned query actually becomes independent of colmena itself (and therefore the stateless limitation).

23:01:33
@dantefromhell:matrix.orgdantefromhell *

Emily:

colmena is stateless by design. and to know which nodes need to updated, you would have to keep track of the nodes closures/generations.

I disagree. For 1 commit this query should always be doable without contacting a host because the old & new desired state is clearly defined.

The situation I can think of where you need to check the deployed closures is if you are trying to solve "configuration drift" and deployment of patches with a single solution - which is kinda the common pattern in non-declarative environments.

But if you're looking at config drift (which I'm still wondering if that can actually be a reasonable thing within NixOS given the generations mechanism 🤔) and the "affected query" as 2 separate problems the aforementioned query actually becomes independent of colmena itself (and therefore the stateless limitation).

23:03:20
@dantefromhell:matrix.orgdantefromhell *

Emily:

colmena is stateless by design. and to know which nodes need to updated, you would have to keep track of the nodes closures/generations.

I disagree. For 1 commit this query should always be doable without contacting a host because the old & new desired state are clearly defined.

The situation I can think of where you need to check the deployed closures is if you are trying to solve "configuration drift" and deployment of patches with a single solution - which is kinda the common pattern in non-declarative environments.

But if you're looking at config drift (which I'm still wondering if that can actually be a reasonable thing within NixOS given the generations mechanism 🤔) and the "affected query" as 2 separate problems the aforementioned query actually becomes independent of colmena itself (and therefore the stateless limitation).

23:04:24
@dantefromhell:matrix.orgdantefromhell
In reply to @whentze:matrix.org
we built something like that at work, kinda
sweet! Is any of the work publicly available for inspiration?
23:04:35
@dantefromhell:matrix.orgdantefromhell

here's another question occupying my mind as I'm thinking about the structure for a new hive.

From reading past conversations in this channel it seems that one can define a host in (at least) 3 different ways

  1. with colmena + a wrapper to wire the host configuration into nixOsConfiguration
  2. with nixosConfiguration + some wrapper to make the host config colmena compatible
  3. outside of either colmena or nixosConfiguration with 2 wrappers to make the host config compatible (as demonstrated in Yureka (she/her) suxin code)
    After seeing code for each possibility I struggle to understand what are the down/ up sides of them in order to help me make the right decision.

As I'm guessing there's no "decision chart" available 😉 Could y'all help me to figure out what the pros/ cons/ limitations for the approaches are?

23:18:04
@whentze:matrix.orgWanja Hentze
In reply to @dantefromhell:matrix.org
sweet! Is any of the work publicly available for inspiration?
sadly no, but this part is pretty banal
23:44:23
@whentze:matrix.orgWanja Hentzebasically our CI builds all hosts and then checks for each one if the built hash is different than the one on there23:44:53
@whentze:matrix.orgWanja Hentzewhere it differs, it creates a deployment job23:45:05
@whentze:matrix.orgWanja Hentzein order to not have to SSH to check the hashes (which also works though) we have a little activation script that writes the current system hash to a textfile where the Prometheus node exporter (via plaintext exporter) picks it up so you can querry it via monitoring23:46:30
@whentze:matrix.orgWanja Hentzeyes indeed we check the real deployment precisely to solve configuration drift23:47:46
@whentze:matrix.orgWanja Hentzelooking at a commit and saying which hosts it changes would be super useful though, for code review for example23:49:42
11 Apr 2023
@sef:exotic.shsefidel changed their profile picture.15:02:29
@sef:exotic.shsefidel changed their profile picture.15:09:39
@sef:exotic.shsefidel changed their profile picture.15:29:23

Show newer messages


Back to Room ListRoom Version: 6