!BgJZHVOYkwVcEKLAyM:nixos.org

NixOS Deployments

1248 Members
NixOS Deployment tooling307 Servers

Load older messages


SenderMessageTime
22 Aug 2021
@roberthensing:matrix.orgRobert Hensing (roberth)sadly because if it were, we could have a more efficient NixOS evaluation, but that's another story14:00:34
@roberthensing:matrix.orgRobert Hensing (roberth) bit of a tangent there, imports in defaults is the best place in this situation even if NixOS were different 14:01:18
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @roberthensing:matrix.org
the alternative is to import wherever you read or write them, but that's not idiomatic, sadly
Top level would be generally fine for me, I'll probably put the options under some deployment.machineSpecs attribute and import it in the file where I define the deployment targets (I'm using two different files here, one with a libvirtd target for testing the setup, and one for the physical machines)
14:01:56
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @roberthensing:matrix.org
bit of a tangent there, imports in defaults is the best place in this situation even if NixOS were different
I'm already in a place where I'm using nixops even for my private machines (yes, I deploy to ::1 😀 )
14:02:31
@roberthensing:matrix.orgRobert Hensing (roberth)cool. I use a mix of tools including nixops, arion and remote NixOS via Hercules CI effects14:03:33
@roberthensing:matrix.orgRobert Hensing (roberth)oh and I have a one node terraform deployment as well14:04:06
@schnecfk:ruhr-uni-bochum.deCRTified

Robert Hensing (roberth) it works, here's my module:

{ config, name, pkgs, lib, ... }: {
  options = with lib; {
    deployment = {

      slurmNodeConfig = mkOption {
        type = types.str;
        description = "Node configuration for Slurm";
        readOnly = true;
      };

      slurm = mkOption {
        type = with types; attrsOf (oneOf [ int str ]);
        description =
          "Attribute set that is coerced into the Slurm Node config";
        default = { };
        example = {
          CPUs = 2;
          RealMemory = 2000;
          TmpDisk = 64000;
        };
      };
    };
  };

  config = {
    deployment.slurmNodeConfig = "NodeName=${name} "
      + (lib.concatStringsSep " "
        (lib.mapAttrsToList (n: v: "${n}=${toString v}")
          config.deployment.slurm));
  };
}

And in the libvirtd target I'm using it like this:

{
  defaults = { config, ... }: {
    imports = [
      ./options/deployment.nix
    ];
    
    deployment = {
      targetEnv = "libvirtd";
      libvirtd = {
        vcpu = 2;
        memorySize = 1024;
        headless = false;
        baseImageSize = 10;
      };

      slurm = {
        CPUs = config.deployment.libvirtd.vcpu - 1;
        RealMemory = config.deployment.libvirtd.memorySize;
        MemSpecLimit = 256;
      };
    };
  };
}

19:29:38
@schnecfk:ruhr-uni-bochum.deCRTifiedSo this works fine and is available on all nodes in a proper way19:29:55
@schnecfk:ruhr-uni-bochum.deCRTifiedI just noticed that the slurm module in nixpkgs has a bug19:30:07
@schnecfk:ruhr-uni-bochum.deCRTified * I just noticed that the slurm module in nixpkgs has a bug (but that's not a deployment problem)19:30:20
@schnecfk:ruhr-uni-bochum.deCRTified * ~~I just noticed that the slurm module in nixpkgs has a bug (but that's not a deployment problem)~~ Ok, I used it wrong...19:33:28
@schnecfk:ruhr-uni-bochum.deCRTified * ~I just noticed that the slurm module in nixpkgs has a bug (but that's not a deployment problem)~ Ok, I used it wrong...19:33:37
@schnecfk:ruhr-uni-bochum.deCRTified * I just noticed that the slurm module in nixpkgs has a bug (but that's not a deployment problem) Ok, I used it wrong... 19:33:57
@schnecfk:ruhr-uni-bochum.deCRTified Is deployment.owners in use somewhere? 20:39:07
@schnecfk:ruhr-uni-bochum.deCRTifiedSearching through the nixops source only shows three locations in the code, and they all just define that option20:39:33
23 Aug 2021
@zaphar_ps:matrix.orgzaphar_ps CRTified: I think that's just metadata 17:36:12
24 Aug 2021
@nate5824:matrix.orgnate5824 joined the room.22:46:24
@nate5824:matrix.orgnate5824Redacted or Malformed Event22:48:01
@nate5824:matrix.orgnate5824
In reply to @zaphar_ps:matrix.org
Hrmmm so it seems importing <nixpkgs/nixos/modules/virtualisation/google-compute-image.nix>causes the boto error not nixops.
https://github.com/NixOS/nixpkgs/pull/135505
22:49:01
@hexa:lossy.networkhexaboto is dead, things should migrate to boto323:53:03
25 Aug 2021
@zaphar_ps:matrix.orgzaphar_psI fixed it by pinning to an older version of nixops than I was previously pinning to.13:10:59
@zaphar_ps:matrix.orgzaphar_ps * I fixed it by pinning to an older version of nixpkgs than I was previously pinning to.13:11:08
@zaphar_ps:matrix.orgzaphar_psBut yeah people should upgrade and all.13:11:20
26 Aug 2021
@max:privatevoid.netMax joined the room.01:26:57
@clemjvdm:matrix.orgclemjvdm joined the room.22:03:50
28 Aug 2021
@lvkm:matrix.orglvkm joined the room.06:28:07
@lvkm:matrix.orglvkm changed their display name from Istvan Ruzman to lvkm.06:30:24
@roberthensing:matrix.orgRobert Hensing (roberth)who's familiar with the ssh code in nixops?15:08:00
@roberthensing:matrix.orgRobert Hensing (roberth)I'm looking for a reviewer to help make ssh automatic and safe in combination with remote state15:09:40
@roberthensing:matrix.orgRobert Hensing (roberth)https://github.com/NixOS/nixops/pull/146415:09:48

There are no newer messages yet.


Back to Room ListRoom Version: 6