110 lines
2.4 KiB
Nix
110 lines
2.4 KiB
Nix
let
|
|
# Pin the deployment package-set to a specific version of nixpkgs
|
|
# pkgs = import (builtins.fetchTarball {
|
|
# url = "https://github.com/NixOS/nixpkgs/archive/e6377ff35544226392b49fa2cf05590f9f0c4b43.tar.gz";
|
|
# sha256 = "1fra9wwy5gvj5ibayqkzqpwdf715bggc0qbmrfch4fghwvl5m70l";
|
|
# }) {};
|
|
pkgs = import <nixpkgs> {};
|
|
|
|
nodes =
|
|
with builtins;
|
|
let nodes = genList (n: n + 1) 8; in
|
|
map (n: ({ name = "c0-${toString n}"; address = "10.1.61.10${toString n}"; })) nodes;
|
|
|
|
stokes = import ./frontend.nix {
|
|
inherit pkgs;
|
|
inherit nodes;
|
|
};
|
|
|
|
compute = {
|
|
# deployment.tags = [ "compute" ];
|
|
|
|
fileSystems = {
|
|
"/stokes" = {
|
|
device = "10.1.63.100:/home";
|
|
fsType = "nfs";
|
|
options = [
|
|
"soft"
|
|
"defaults"
|
|
"noauto"
|
|
"x-systemd.automount"
|
|
];
|
|
};
|
|
"/opt" = {
|
|
device = "10.1.63.80:/opt";
|
|
fsType = "nfs";
|
|
options = [ "soft" "rdma" "defaults" ];
|
|
};
|
|
"/data" = {
|
|
device = "10.1.63.80:/data";
|
|
fsType = "nfs";
|
|
options = [ "soft" "rdma" "defaults" ];
|
|
};
|
|
};
|
|
|
|
systemd.automounts = [
|
|
{
|
|
where = "/stokes";
|
|
wantedBy = [ "default.target" ];
|
|
}
|
|
];
|
|
};
|
|
|
|
mkCompute = host:
|
|
let
|
|
ipoib = builtins.replaceStrings [".61."] [".63."] host.address;
|
|
hw = ./hw + "/${host.name}.nix";
|
|
in {
|
|
"${host.name}" = {
|
|
features = {
|
|
inherit host;
|
|
os.externalInterface = "eno33";
|
|
hpc.compute = true;
|
|
# k8s = { inherit etcdCluster; };
|
|
};
|
|
|
|
node = {
|
|
i40efix = true;
|
|
};
|
|
|
|
networking = {
|
|
useDHCP = false;
|
|
interfaces.eno33 = {
|
|
useDHCP = false;
|
|
ipv4.addresses = [ {
|
|
address = host.address;
|
|
prefixLength = 24;
|
|
} ];
|
|
ipv4.routes = [ {
|
|
address = "10.1.62.2";
|
|
prefixLength = 32;
|
|
via = "10.1.61.100";
|
|
} ];
|
|
|
|
};
|
|
interfaces."ibp65s0.2222" = {
|
|
useDHCP = false;
|
|
ipv4.addresses = [ {
|
|
address = ipoib;
|
|
prefixLength = 24;
|
|
} ];
|
|
};
|
|
};
|
|
imports = [ ./cluster.nix hw ];
|
|
}
|
|
// compute;
|
|
};
|
|
in {
|
|
## morph
|
|
# network = {
|
|
# inherit pkgs;
|
|
# description = "stokes";
|
|
# ordering = {
|
|
# tags = [ "frontend" "compute" ];
|
|
# };
|
|
# };
|
|
|
|
inherit stokes;
|
|
} // builtins.foldl' (a: n: a // mkCompute n) {} nodes
|
|
|