!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
18 Nov 2024
@luna:bddvlpr.comLuna Oh my bad, I forgot --experimental-flake-eval, this is the log I get:
[WARN ] Using direct flake evaluation (experimental)
[INFO ] Enumerating nodes...
[INFO ] Selected all 4 nodes.
       ❌ 4s Failed: Child process exited with error code: 1
 (...) ❌ 4s Evaluation failed: Child process exited with error code: 1                                           
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to evaluate phobos, ceres, deimos, and ariel - Last 20 lines of logs:
[ERROR]   stderr)          1575|         else
[ERROR]   stderr) 
[ERROR]   stderr)        … while evaluating the attribute 'value'
[ERROR]   stderr)          at /nix/store/hfz1qqd0z8amlgn8qwich1dvkmldik36-source/lib/modules.nix:816:9:
[ERROR]   stderr)           815|     in warnDeprecation opt //
[ERROR]   stderr)           816|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
[ERROR]   stderr)              |         ^
[ERROR]   stderr)           817|         inherit (res.defsFinal') highestPrio;
[ERROR]   stderr) 
[ERROR]   stderr)        … while evaluating the option `system.build.toplevel':
[ERROR]   stderr) 
[ERROR]   stderr)        … while evaluating definitions from `/nix/store/hfz1qqd0z8amlgn8qwich1dvkmldik36-source/nixos/modules/system/activation/top-level.nix':
[ERROR]   stderr) 
[ERROR]   stderr)        (stack trace truncated; use '--show-trace' to show the full, detailed trace)
[ERROR]   stderr) 
[ERROR]   stderr)        error:
[ERROR]   stderr)        Failed assertions:
[ERROR]   stderr)        - The ‘fileSystems’ option does not specify your root file system.
[ERROR]   stderr)        - You must set the option ‘boot.loader.grub.devices’ or 'boot.loader.grub.mirroredBoots' to make the system bootable.
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Hint: Backtrace available - Use `RUST_BACKTRACE=1` environment variable to display a backtrace
Is disko perhaps not compatible with colmena?
09:20:22
@ibizaman:matrix.orgibizaman
In reply to @jh-devv:matrix.org
What tool do you people think would fit well with Colmena when deploying bare metal?
Any tool should be compatible. I used nixos-anywhere successfully and heard about nixos-infect working too. I’ve got a flake template for the former https://github.com/ibizaman/skarabox if you want some inspiration.
09:27:06
@luna:bddvlpr.comLuna Perhaps its not reading any of the configuration as the log shows
 (...) | evaluation warning: system.stateVersion is not set, defaulting to 25.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.
While a repl shows
nix-repl> outputs.nixosConfigurations.ariel.config.system.stateVersion
"24.05"

nix-repl>
09:27:29
@ibizaman:matrix.orgibizaman
In reply to @luna:bddvlpr.com
Oh my bad, I forgot --experimental-flake-eval, this is the log I get:
[WARN ] Using direct flake evaluation (experimental)
[INFO ] Enumerating nodes...
[INFO ] Selected all 4 nodes.
       ❌ 4s Failed: Child process exited with error code: 1
 (...) ❌ 4s Evaluation failed: Child process exited with error code: 1                                           
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to evaluate phobos, ceres, deimos, and ariel - Last 20 lines of logs:
[ERROR]   stderr)          1575|         else
[ERROR]   stderr) 
[ERROR]   stderr)        … while evaluating the attribute 'value'
[ERROR]   stderr)          at /nix/store/hfz1qqd0z8amlgn8qwich1dvkmldik36-source/lib/modules.nix:816:9:
[ERROR]   stderr)           815|     in warnDeprecation opt //
[ERROR]   stderr)           816|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
[ERROR]   stderr)              |         ^
[ERROR]   stderr)           817|         inherit (res.defsFinal') highestPrio;
[ERROR]   stderr) 
[ERROR]   stderr)        … while evaluating the option `system.build.toplevel':
[ERROR]   stderr) 
[ERROR]   stderr)        … while evaluating definitions from `/nix/store/hfz1qqd0z8amlgn8qwich1dvkmldik36-source/nixos/modules/system/activation/top-level.nix':
[ERROR]   stderr) 
[ERROR]   stderr)        (stack trace truncated; use '--show-trace' to show the full, detailed trace)
[ERROR]   stderr) 
[ERROR]   stderr)        error:
[ERROR]   stderr)        Failed assertions:
[ERROR]   stderr)        - The ‘fileSystems’ option does not specify your root file system.
[ERROR]   stderr)        - You must set the option ‘boot.loader.grub.devices’ or 'boot.loader.grub.mirroredBoots' to make the system bootable.
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Hint: Backtrace available - Use `RUST_BACKTRACE=1` environment variable to display a backtrace
Is disko perhaps not compatible with colmena?
There are two errors at the end there, setting root filesystem and grub stuff. Usually those come from running the hardware generator on the new machine and that gets you a hardware-configuration.nix file. You must include that file or recreate the options it is setting for the configuration to be happy.
09:29:54
@jh-devv:matrix.org@jh-devv:matrix.org
In reply to @ibizaman:matrix.org
Any tool should be compatible. I used nixos-anywhere successfully and heard about nixos-infect working too. I’ve got a flake template for the former https://github.com/ibizaman/skarabox if you want some inspiration.
Does this support iPXE?
09:30:06
@luna:bddvlpr.comLuna
In reply to@ibizaman:matrix.org
There are two errors at the end there, setting root filesystem and grub stuff. Usually those come from running the hardware generator on the new machine and that gets you a hardware-configuration.nix file. You must include that file or recreate the options it is setting for the configuration to be happy.
Those are correctly set and can be seen through the repl. Maybe I'm misunderstanding, does it (like deploy-rs) check for configurations at outputs.nixosConfigurations for matching attributes to outputs.colmena?
09:31:28
@luna:bddvlpr.comLuna
{
  self,
  inputs,
  ...
}: let
  inherit (self) outputs;
  inherit (builtins) mapAttrs;
in {
  flake = {
    colmena =
      (mapAttrs (host: value: {
          deployment = {
            targetHost = "${host}.cloud.bddvlpr.com";
          };
        })
        outputs.nixosConfigurations)
      // {
        meta = {
          nixpkgs = import inputs.nixpkgs {
            system = "x86_64-linux";
            overlays = [];
          };
        };
      };

    colmenaHive = inputs.colmena.lib.makeHive outputs.colmena;
  };
}
This is the current configuration, btw.
09:33:32
@ibizaman:matrix.orgibizaman
In reply to @jh-devv:matrix.org
Does this support iPXE?
Ah no I didn’t do that in my template. But it’s definitely doable. I found a few links though https://wiki.nixos.org/wiki/Netboot and https://carlosvaz.com/posts/ipxe-booting-with-nixos/
09:33:34
@ibizaman:matrix.orgibizaman
In reply to @luna:bddvlpr.com
{
  self,
  inputs,
  ...
}: let
  inherit (self) outputs;
  inherit (builtins) mapAttrs;
in {
  flake = {
    colmena =
      (mapAttrs (host: value: {
          deployment = {
            targetHost = "${host}.cloud.bddvlpr.com";
          };
        })
        outputs.nixosConfigurations)
      // {
        meta = {
          nixpkgs = import inputs.nixpkgs {
            system = "x86_64-linux";
            overlays = [];
          };
        };
      };

    colmenaHive = inputs.colmena.lib.makeHive outputs.colmena;
  };
}
This is the current configuration, btw.
I’m maybe misreading, did you leave out the configuration for the host you’re trying the build the config for?
09:36:43
@luna:bddvlpr.comLuna No, I think I get what I'm doing wrong now. I thought that it just required outputs.colmena to get the deployment settings and would actually look up the host at outputs.nixosConfigurations like deploy-rs would. I'll try just merging them now. 09:37:45
@ibizaman:matrix.orgibizaman
In reply to @luna:bddvlpr.com
No, I think I get what I'm doing wrong now. I thought that it just required outputs.colmena to get the deployment settings and would actually look up the host at outputs.nixosConfigurations like deploy-rs would. I'll try just merging them now.
Ah I see indeed that seems like the likely culprit.
09:38:17
@luna:bddvlpr.comLunaAs for the meta nixpkgs, does this have to be a set architecture?09:39:03
@luna:bddvlpr.comLunaCan't it be dynamic depending on the host running commands?09:39:16
@ibizaman:matrix.orgibizaman
In reply to @luna:bddvlpr.com
Can't it be dynamic depending on the host running commands?
Dynamic, not sure. But you can use https://colmena.cli.rs/unstable/reference/meta.html#nodenixpkgs for node specific nixpkgs. There’s an example here https://colmena.cli.rs/unstable/tutorial/index.html
09:57:42
@luna:bddvlpr.comLunaFinally got it evaluating with https://github.com/zhaofengli/colmena/issues/60#issuecomment-1510496861. I still don't get the use of meta.nixpkgs in particular though.10:01:02
@luna:bddvlpr.comLuna Another small note, can I define --experimental-flake-eval somewhere in the config that I don't have to add it to every command? 10:01:59
@ibizaman:matrix.orgibizaman
In reply to @luna:bddvlpr.com
Another small note, can I define --experimental-flake-eval somewhere in the config that I don't have to add it to every command?
I don’t think you can add it in the config of this flake.nix, but you can set it permanently by following examples here https://wiki.nixos.org/wiki/Flakes
10:04:47
@luna:bddvlpr.comLuna I don't see how that wiki has information on how to set that permanently. I'm not talking about Nix's --experimental-features 'flakes', colmena's experimental flake eval requires its own --experimental-flake-eval. 10:07:08
@ibizaman:matrix.orgibizamanOh. I never used that 🤔 I enabled it like the wiki suggested and I never needed that command10:15:04
@ibizaman:matrix.orgibizaman * 10:15:16
19 Nov 2024
@garionion:entr0py.de@garionion:entr0py.de left the room.10:58:23
21 Nov 2024
@ftchrist:matrix.orgFrédéric Christ joined the room.05:14:08
@howlymowly:matrix.orgThomas m joined the room.22:15:59
25 Nov 2024
@nullcube:matrix.orgNullCube joined the room.10:04:26
28 Nov 2024
@madonius:entropia.de/madonius[er|he]is it new that a file has to be fully check in for colmena to build the derivation?21:24:56
@hexa:lossy.networkhexathat sounds like you switched to flakes21:29:59
@madonius:entropia.de/madonius[er|he]I was using flakes the whole time, but with the 24.05 I had no issues with the files just being tracked by git21:33:47
@madonius:entropia.de/madonius[er|he]now I have to fully commit them in order for them to get built21:34:01
@madonius:entropia.de/madonius[er|he] I asked over at #users:nixos.org and they said that that should not be the case and to ask here 21:35:08
@madonius:entropia.de/madonius[er|he]🤷21:35:11

Show newer messages


Back to Room ListRoom Version: 6