Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better real-world testing #1218

Open
mkg20001 opened this issue Jan 12, 2020 · 4 comments
Open

Better real-world testing #1218

mkg20001 opened this issue Jan 12, 2020 · 4 comments

Comments

@mkg20001
Copy link
Member

mkg20001 commented Jan 12, 2020

After #1213 there's now https://github.com/NixOS/nixops/issues/1005

The hetzner module seems to be broken at pretty much every deployment with another error message coming along to annoy me.

Would it be possible to put an end to this madness?

@mkg20001
Copy link
Member Author

I've just got an idea: There could be a hetzner machine that's specifically used for testing nixops on it's own account that would be simply re-deployed at every test.

@paluh
Copy link
Contributor

paluh commented Jan 20, 2020

@mkg20001 I fully understand your proposition as I've spent last few days learning (I'm a slow learner :-P) and playing with nixops and hetzner provisioning. Maybe we should move this discussion to the NixOS/nixops-hetzner repo.

P.S.
I was able to finally get working hetzner deployment.

I'm using latest master branch of nixops and pinning some nixpkgs-19.0.9 version (to have really reproducible deployment) in this shell.nix:

let
  hostPkgs = import <nixpkgs> {};
  # nixos-19.0.9 - v2020-01-13
  pkgsSrc = hostPkgs.fetchFromGitHub {
    owner = "NixOS";
    repo = "nixpkgs-channels";
    rev = "09aa1b23bb5f04dfc0ac306a379a464584fc8de7";
    sha256 = "1byv12ayy7k6p64jgm3054xif8yvp388sr3lycd4ax01w9qpc1ry";
  };
  pkgs = import pkgsSrc {
    config.allowUnfree = true;

    overlays = [
      (self: super: {
        nixops =
          let
            src = pkgs.fetchFromGitHub {
              owner = "NixOS";
              repo = "nixops";
              rev = "4cfb70513bad149183adc3ac741c176d83b0e9d5";
              sha256 = "0irf9wha2rxla6z7mywj5z29bvjbpwlxqj2s29ygsbhp6hnlbzzz";
            };
          in
            (import "${src}/release.nix" { p = (p: [ (p.hetzner) ]); }).build.x86_64-linux;
      })
    ];
  };
in
  pkgs.stdenv.mkDerivation {
    name = "nixops-trivial";
    NIX_PATH="nixpkgs=${pkgs.path}";
    buildInputs = [ pkgs.nixops ];
  }

Minimal empty logical machine definition - trivial.nix:

{ ketosis =
    { config, pkgs, ... }: {};
}

I wanted to use raid with level=0 but I wasn't able to boot machine again. Debugging boot issue was outside of my current scope so I've decided to use lvm instead - trivial-hetzner.nix:

{ ketosis = {
    deployment.targetEnv = "hetzner";
    deployment.hetzner.mainIPv4 = "*.*.*.*";

    deployment.hetzner.createSubAccount = false;

    deployment.hetzner.partitions = ''
      clearpart --all --initlabel --drives=nvme1n1,nvme0n1

      part pv.01 --label=root-part1 --grow --ondisk=nvme0n1
      part pv.02 --label=root-part2 --grow --ondisk=nvme1n1

      volgroup vg0 pv.01 pv.02
      logvol swap --vgname=vg0 --recommended --fstype swap --label=swap --name=swap
      logvol /    --vgname=vg0 --size=1800000 --fstype ext4 --label=root --name=root
    '';
  };
}

At the end I've got some errors from nixops command and its reboot didn't finish but when I had reseted this machine from my hetzner robot panel everything worked fine.

updating GRUB 2 menu...                                                                                                                                       
installing the GRUB 2 boot loader on /dev/nvme0n1...                                                                                                          
Installing for i386-pc platform.                                                                                                                              
You have a memory leak (not released memory pool):                                                                                                            
[0x56de50] dtree 

In order to test this configuration you should:

  • Check and setup your device labels (in standard raid level=1 partitioning setup there are by default two disks in use sda and sdb) in partitioning section.

  • Export HETZNER_ROBOT_USER and HETZNER_ROBOT_PASS into your env.

  • Set up your machine IP address in trivial-hetzner.nix deployment.hetzner.mainIPv4 because I've marked it out.

  • It is important to use deployment.hetzner.createSubAccount = false; as it is because there is an open issue related to this feature.

@paluh
Copy link
Contributor

paluh commented Jan 20, 2020

P.S.II.
Somewhat related: NixOS/nixops-hetzner#6

@mkg20001
Copy link
Member Author

mkg20001 commented Jan 22, 2020

A bit related, since it could make testing better and automate reproducing the issues for fixing them: NixOS/nixpkgs#2079

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants