Compare commits

..

21 commits

Author SHA1 Message Date
Max
564d186ab5 cluster/services/storage: register existing keys and buckets in incandescence 2024-08-16 20:21:52 +02:00
Max
89f5417e89 cluster/services/consul: implement runConsul incantation 2024-08-16 20:21:52 +02:00
Max
95a5ec5bfd cluster/services/forge: define db 2024-08-16 20:21:52 +02:00
Max
97be3269c0 cluster/services/storage: define snakeoil passphrase for heresy, ensure encryption 2024-08-16 20:21:52 +02:00
Max
01f5a51263 cluster/services/storage: use recursive simulacrum deps 2024-08-16 20:21:50 +02:00
Max
1e1fe7fef5 cluster/services/dns: use patroni incandescence 2024-08-16 20:21:48 +02:00
Max
7d484b5a5f modules/external-storage: implement detectFs for s3c4 2024-08-16 20:21:48 +02:00
Max
53ca0a8021 cluster/services/storage: use locksmith secrets for external storage 2024-08-16 20:21:48 +02:00
Max
e85a9cf8c2 cluster/services/storage: adjust test 2024-08-16 20:21:48 +02:00
Max
c1ad780b25 cluster/services/storage: use incandescence 2024-08-16 20:21:48 +02:00
Max
f3fcb6673c modules/external-storage: support locksmith secrets 2024-08-16 20:21:48 +02:00
Max
2b1127fd94 cluster/services/storage: implement s3ql key format 2024-08-16 20:21:48 +02:00
Max
dc573a71d1 checks/garage: drop 2024-08-16 20:21:46 +02:00
Max
1357f3748f cluster/services/storage: test in simulacrum 2024-08-16 20:21:41 +02:00
Max
b9fea1290d cluster/catalog: support snakeoil secrets 2024-08-16 20:21:41 +02:00
81e4ae46e6 Merge pull request 'The Simulacrum: Stage 5' (#113) from pr-simulacrum-stage-5 into master
Reviewed-on: https://forge.privatevoid.net///privatevoid.net/depot/pulls/113
2024-08-16 20:54:11 +03:00
Max
f4f35c3ae3 cluster/services/ways: test in simulacrum 2024-08-16 19:27:07 +02:00
Max
af2808833a cluster/services/hercules-ci-multi-agent: use forService 2024-08-16 15:26:13 +02:00
Max
8dcd4f39e1 cluster/services/monitoring: use forService 2024-08-16 15:26:13 +02:00
Max
77d92b7c1f cluster/services/forge: use forService 2024-08-16 15:26:13 +02:00
Max
55b60f30d6 cluster/services/attic: use forService 2024-08-16 15:26:13 +02:00
6 changed files with 82 additions and 9 deletions

View file

@ -52,10 +52,12 @@
cache.target = serverAddrs;
};
ways.cache-api = {
consulService = "atticd";
extras.extraConfig = ''
client_max_body_size 4G;
'';
ways = config.lib.forService "attic" {
cache-api = {
consulService = "atticd";
extras.extraConfig = ''
client_max_body_size 4G;
'';
};
};
}

View file

@ -16,10 +16,10 @@
};
};
ways.forge = let
ways = let
host = builtins.head config.services.forge.nodes.server;
in config.lib.forService "forge" {
target = config.hostLinks.${host}.forge.url;
forge.target = config.hostLinks.${host}.forge.url;
};
patroni = config.lib.forService "forge" {

View file

@ -93,7 +93,7 @@ in
};
};
ways = {
ways = config.lib.forService "monitoring" {
monitoring = {
consulService = "grafana";
extras.locations."/".proxyWebsockets = true;

View file

@ -3,12 +3,17 @@
{
imports = [
./options
./simulacrum/test-data.nix
];
services.ways = {
nodes.host = config.services.websites.nodes.host;
nixos.host = ./host.nix;
simulacrum.deps = [ "nginx" "acme-client" "dns" "certificates" "consul" ];
simulacrum = {
enable = true;
deps = [ "nginx" "acme-client" "dns" "certificates" "consul" ];
settings = ./simulacrum/test.nix;
};
};
dns.records = lib.mapAttrs'

View file

@ -0,0 +1,11 @@
{ config, lib, ... }:
{
ways = lib.mkIf config.simulacrum {
ways-test-simple = config.lib.forService "ways" {
target = "http://nowhere";
};
ways-test-consul = config.lib.forService "ways" {
consulService = "ways-test-service";
};
};
}

View file

@ -0,0 +1,55 @@
{ cluster, config, lib, ... }:
let
inherit (cluster._module.specialArgs.depot.lib.meta) domain;
in
{
nodes = lib.mkMerge [
{
nowhere = { pkgs, ... }: {
networking.firewall.allowedTCPPorts = [ 8080 ];
systemd.services.ways-simple-service = let
webroot = pkgs.writeTextDir "example.txt" "hello world";
in {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.darkhttpd}/bin/darkhttpd ${webroot} --port 8080";
DynamicUser = true;
};
};
};
}
(lib.genAttrs cluster.config.services.ways.nodes.host (lib.const {
services.nginx.upstreams.nowhere.servers = {
"${(builtins.head config.nodes.nowhere.networking.interfaces.eth1.ipv4.addresses).address}:8080" = {};
};
consul.services.ways-test-service = {
unit = "consul";
mode = "external";
definition = {
name = "ways-test-service";
address = (builtins.head config.nodes.nowhere.networking.interfaces.eth1.ipv4.addresses).address;
port = 8080;
};
};
}))
];
testScript = ''
import json
nodeNames = json.loads('${builtins.toJSON cluster.config.services.ways.nodes.host}')
nodes = [ n for n in machines if n.name in nodeNames ]
start_all()
nowhere.wait_for_unit("multi-user.target")
for node in nodes:
node.wait_for_unit("multi-user.target")
with subtest("single-target service"):
nowhere.succeed("curl -f https://ways-test-simple.${domain}")
with subtest("consul-managed service"):
nowhere.succeed("curl -f https://ways-test-consul.${domain}")
'';
}