diff --git a/build/flake.lock b/build/flake.lock index 8a6357d9..4a822796 100644 --- a/build/flake.lock +++ b/build/flake.lock @@ -272,26 +272,6 @@ "type": "github" } }, - "hydra-scale-equinix-metal": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733176494, - "narHash": "sha256-s/jVBWzr9nO/H5FJMSp1/DWZEw7zuGg0itOP8pWDLdg=", - "owner": "NixOS", - "repo": "hydra-scale-equinix-metal", - "rev": "3d0db527c799ddb83aee9173062bbe4e41610a5b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "hydra-scale-equinix-metal", - "type": "github" - } - }, "libgit2": { "flake": false, "locked": { @@ -490,7 +470,6 @@ "colmena": "colmena", "disko": "disko", "hydra": "hydra", - "hydra-scale-equinix-metal": "hydra-scale-equinix-metal", "nix": [ "hydra", "nix" diff --git a/build/flake.nix b/build/flake.nix index a47c0b66..45c6ff40 100644 --- a/build/flake.nix +++ b/build/flake.nix @@ -14,9 +14,6 @@ inputs.hydra.inputs.nixpkgs.follows = "nixpkgs"; inputs.nix.follows = "hydra/nix"; - inputs.hydra-scale-equinix-metal.url = "github:NixOS/hydra-scale-equinix-metal"; - inputs.hydra-scale-equinix-metal.inputs.nixpkgs.follows = "nixpkgs"; - inputs.nix-netboot-serve.url = "github:DeterminateSystems/nix-netboot-serve"; inputs.nix-netboot-serve.inputs.nixpkgs.follows = "nixpkgs"; @@ -33,7 +30,6 @@ colmena, disko, hydra, - hydra-scale-equinix-metal, nix, nixpkgs, nixos-channel-scripts, @@ -48,7 +44,6 @@ agenix.nixosModules.age disko.nixosModules.disko hydra.nixosModules.hydra - hydra-scale-equinix-metal.nixosModules.default nix-netboot-serve.nixosModules.nix-netboot-serve ]; diff --git a/build/hydra-scaler.nix b/build/hydra-scaler.nix deleted file mode 100644 index 57d512c0..00000000 --- a/build/hydra-scaler.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ config, ... }: - -{ - services.hydra-scale-equinix-metal = { - enable = true; - hydraRoot = "https://hydra.nixos.org/"; - prometheusRoot = "https://status.nixos.org/prometheus"; - secretFile = "/root/keys/hydra-scale-equinix-metal-env"; - interval = [ "*:0/5" ]; - config = - let - netboot_base = "https://netboot.nixos.org/dispatch/hydra/hydra.nixos.org/equinix-metal-builders/main"; - in - { - metro = "any"; - tags = [ "hydra" ]; - categories = { - # NOTE(cole-h): We don't autoscale arm64 anymore because EM asked us not to: the arm64 spot - # market appears to be a little funky as of this comment (we would commonly spin up a - # machine, only for it to be reclaimed before it was even able to boot into NixOS and run - # even 1 build for Hydra). - # As of 17 Feb 2024, we have 2 dedicated arm64 machines on EM -- one `small` - # (`small-c3.large.arm64`) and one `big-parallel` (`big-parallel-c3.large.arm64`). Hopefully - # this will be an improvement over "maybe we have no arm64 machines at all because they spin - # down before they can do any work". - # The netboot URL for arm64 big-parallel is: https://netboot.nixos.org/dispatch/hydra/hydra.nixos.org/equinix-metal-builders/main/c3-large-arm--big-parallel ("Always PXE" enabled, "hydra" tag) - # The netboot URL for arm64 small is: https://netboot.nixos.org/dispatch/hydra/hydra.nixos.org/equinix-metal-builders/main/c3-large-arm ("Always PXE" enabled, "hydra" tag) - - x86_64-linux = rec { - bigparallel = { - divisor = 16; - minimum = 1; - maximum = 4; - plans = [ - { - bid = 2.0; - netboot_url = "${netboot_base}/c3-medium-x86--big-parallel"; - plan = "c3.medium.x86"; - } - { - bid = 2.0; - netboot_url = "${netboot_base}/m3-large-x86--big-parallel"; - plan = "m3.large.x86"; - } - ]; - }; - small = { - divisor = 2000; - minimum = 1; - maximum = 3; - plans = [ - { - bid = 2.0; - netboot_url = "${netboot_base}/c3-medium-x86"; - plan = "c3.medium.x86"; - } - { - bid = 2.0; - netboot_url = "${netboot_base}/m3-large-x86"; - plan = "m3.large.x86"; - } - ]; - }; - }; - }; - }; - }; -} diff --git a/build/mimas/default.nix b/build/mimas/default.nix index e407d880..33faf6c3 100644 --- a/build/mimas/default.nix +++ b/build/mimas/default.nix @@ -3,8 +3,6 @@ ../common.nix ../hydra.nix ../hydra-proxy.nix - ../hydra-scaler.nix - ../packet-importer.nix ./boot.nix ./network.nix ]; diff --git a/build/packet-importer.nix b/build/packet-importer.nix deleted file mode 100644 index e165505c..00000000 --- a/build/packet-importer.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ pkgs, ... }: -let - importer = pkgs.callPackage ../hydra-packet-importer { }; -in -{ - users.users.hydra-packet = { - description = "Hydra Packet Machine Importer"; - group = "hydra"; - isSystemUser = true; - }; - - systemd.tmpfiles.rules = [ - "d /var/lib/hydra-packet-import 0755 hydra-packet hydra -" - "f /var/lib/hydra-packet-import/machines 0644 hydra-packet hydra -" - ]; - - services.hydra-dev.buildMachinesFiles = [ "/var/lib/hydra-packet-import/machines" ]; - - systemd.services.hydra-packet-import = { - path = with pkgs; [ - openssh - moreutils - ]; - script = "${importer}/bin/hydra-packet-importer /var/lib/hydra-packet-import/hydra-packet-import.json | sort | sponge /var/lib/hydra-packet-import/machines"; - serviceConfig = { - User = "hydra-packet"; - Group = "keys"; - SupplementaryGroups = [ - "hydra" - "keys" - ]; - Type = "oneshot"; - RuntimeMaxSec = 1800; - }; - }; - - systemd.timers.hydra-packet-import = { - enable = true; - description = "Update the list of Hydra machines from Packet.net"; - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "*:0/5"; - }; - }; -} diff --git a/build/pluto/prometheus/default.nix b/build/pluto/prometheus/default.nix index 6e69c70f..c6be8cc4 100644 --- a/build/pluto/prometheus/default.nix +++ b/build/pluto/prometheus/default.nix @@ -14,8 +14,6 @@ ./exporters/nixos.nix ./exporters/node.nix ./exporters/owncast.nix - ./exporters/packet-sd.nix - ./exporters/packet-spot-market.nix ./exporters/postgresql.nix ./exporters/r13y.nix ./exporters/rfc39.nix diff --git a/build/pluto/prometheus/exporters/node.nix b/build/pluto/prometheus/exporters/node.nix index 2c66358f..5cae2a92 100644 --- a/build/pluto/prometheus/exporters/node.nix +++ b/build/pluto/prometheus/exporters/node.nix @@ -48,7 +48,7 @@ ruleFiles = let - diskSelector = ''mountpoint=~"(/|/scratch)",instance!~".*packethost.net"''; + diskSelector = ''mountpoint=~"(/|/tmp)"''; relevantLabels = "device,fstype,instance,mountpoint"; in [ diff --git a/build/pluto/prometheus/exporters/packet-sd.nix b/build/pluto/prometheus/exporters/packet-sd.nix deleted file mode 100644 index f5e328aa..00000000 --- a/build/pluto/prometheus/exporters/packet-sd.nix +++ /dev/null @@ -1,111 +0,0 @@ -{ config, pkgs, ... }: - -{ - age.secrets.packet-sd-env = { - file = ../../../secrets/packet-sd-env.age; - owner = "packet-sd"; - }; - - users.users.packet-sd = { - description = "Prometheus Packet Service Discovery"; - isSystemUser = true; - group = "packet-sd"; - }; - users.groups.packet-sd = { }; - - systemd.tmpfiles.rules = [ - "d /var/lib/packet-sd 0755 packet-sd - -" - "f /var/lib/packet-sd/packet-sd.json 0644 packet-sd - -" - ]; - - systemd.services.prometheus-packet-sd = { - wantedBy = [ - "multi-user.target" - "prometheus.service" - ]; - after = [ "network.target" ]; - - serviceConfig = { - User = "packet-sd"; - Group = "keys"; - ExecStart = "${pkgs.packet-sd}/bin/prometheus-packet-sd --output.file=/var/lib/packet-sd/packet-sd.json"; - EnvironmentFile = config.age.secrets.packet-sd-env.path; - Restart = "always"; - RestartSec = "60s"; - }; - }; - - services.prometheus = { - scrapeConfigs = [ - { - job_name = "prometheus-packet-sd"; - metrics_path = "/metrics"; - static_configs = [ { targets = [ "127.0.0.1:9465" ]; } ]; - } - { - job_name = "packet_nodes"; - file_sd_configs = [ - { - files = [ "/var/lib/packet-sd/packet-sd.json" ]; - refresh_interval = "30s"; - } - ]; - relabel_configs = [ - { - source_labels = [ "__meta_packet_public_ipv4" ]; - target_label = "__address__"; - replacement = "\${1}:9100"; - action = "replace"; - } - { - source_labels = [ "__meta_packet_facility" ]; - target_label = "facility"; - } - { - source_labels = [ "__meta_packet_facility" ]; - target_label = "packet_facility"; - } - { - source_labels = [ "__meta_packet_plan" ]; - target_label = "plan"; - } - { - source_labels = [ "__meta_packet_plan" ]; - target_label = "packet_plan"; - } - { - # todo: change from _id to _uuid - source_labels = [ "__meta_packet_switch_id" ]; - target_label = "packet_switch_id"; - } - { - source_labels = [ "__meta_packet_device_id" ]; - target_label = "packet_device_id"; - } - { - source_labels = [ "__meta_packet_state" ]; - target_label = "packet_device_state"; - } - { - source_labels = [ "__meta_packet_short_id" ]; - target_label = "instance"; - replacement = "\${1}.packethost.net"; - action = "replace"; - } - { - source_labels = [ "__meta_packet_tags" ]; - target_label = "role"; - regex = ".*hydra.*"; - replacement = "builder"; - action = "replace"; - } - { - source_labels = [ "__meta_packet_tags" ]; - regex = ".*prometheus-scraping-disabled.*"; - action = "drop"; - } - ]; - } - ]; - }; -} diff --git a/build/pluto/prometheus/exporters/packet-spot-market.nix b/build/pluto/prometheus/exporters/packet-spot-market.nix deleted file mode 100644 index 7c71829d..00000000 --- a/build/pluto/prometheus/exporters/packet-spot-market.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ config, pkgs, ... }: -let - exporter = pkgs.fetchFromGitHub { - owner = "grahamc"; - repo = "prometheus-packet-spot-market-price-exporter"; - rev = "b894f5dc061e2ab2d0ef101c28fce390285ad492"; - sha256 = "sha256-I2WolAAM+siE8JfZbEZ3Mmk7/XqVio/PzUKqZUYCBfE="; - }; -in -{ - age.secrets.prometheus-packet-spot-market-price-exporter.file = ../../../secrets/prometheus-packet-spot-market-price-exporter.age; - - systemd.services.prometheus-packet-spot-market-price-exporter = { - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - serviceConfig = { - DynamicUser = true; - User = "spot-price-exporter"; - Group = "keys"; - Restart = "always"; - RestartSec = "60s"; - PrivateTmp = true; - LoadCredential = [ - "config:${config.age.secrets.prometheus-packet-spot-market-price-exporter.path}" - ]; - }; - - path = [ - (pkgs.python3.withPackages ( - ps: with ps; [ - prometheus_client - requests - ] - )) - ]; - - script = "exec python3 ${exporter}/scrape.py $CREDENTIALS_DIRECTORY/config"; - }; - - services.prometheus.scrapeConfigs = [ - { - job_name = "prometheus-packet-spot-price-exporter"; - metrics_path = "/metrics"; - static_configs = [ { targets = [ "127.0.0.1:9400" ]; } ]; - } - ]; -} diff --git a/build/secrets.nix b/build/secrets.nix index 3375cb8e..a76dcf8e 100644 --- a/build/secrets.nix +++ b/build/secrets.nix @@ -9,10 +9,8 @@ let hydra-mirror-aws-credentials = [ machines.pluto ]; hydra-mirror-git-credentials = [ machines.pluto ]; owncast-admin-password = [ machines.pluto ]; - packet-sd-env = [ machines.pluto ]; pluto-backup-secret = [ machines.pluto ]; pluto-backup-ssh-key = [ machines.pluto ]; - prometheus-packet-spot-market-price-exporter = [ machines.pluto ]; rfc39-credentials = [ machines.pluto ]; rfc39-github = [ machines.pluto ]; rfc39-record-push = [ machines.pluto ]; diff --git a/build/secrets/packet-sd-env.age b/build/secrets/packet-sd-env.age deleted file mode 100644 index f2dfe6d1..00000000 Binary files a/build/secrets/packet-sd-env.age and /dev/null differ diff --git a/build/secrets/prometheus-packet-spot-market-price-exporter.age b/build/secrets/prometheus-packet-spot-market-price-exporter.age deleted file mode 100644 index 6839e659..00000000 --- a/build/secrets/prometheus-packet-spot-market-price-exporter.age +++ /dev/null @@ -1,33 +0,0 @@ -age-encryption.org/v1 --> ssh-ed25519 s9hT2g 4D18KkWzF7hESct6oV4GonrxoML2j91StDcg1bjbCzk -0PYG934Jkgosl91rHtlDG6zJcju6q2x01CK8X0NbU1U --> ssh-ed25519 UnbSJQ N8jxxtDq22JooBbYKflIjr5wlwjjIBG3x15BdrLuMUo -7ikyU/4M9us9glTzoZ7Ck/82/d3fYX3odj+r+8d8vQI --> ssh-ed25519 Srtq2A n0IEJBcec9fvW1iZ22UbzSudTxDx5cM82PoFgj7DAis -JHD+Tb7j1b+UDpHBAgNP4IWIiJMtmz5nFoHNI1D6Bqw --> ssh-ed25519 KdJNLg l4vbD2Q1cuQpaB0EyrwI/jXrRWIyXWDiKjRwV81NKHw -VR0xIZHooJ1hs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--> ssh-ed25519 3ENwVg p4pclaTugKavyb621BHUDOU/MG2lAr+Fs0hbINk6YlU -E2AecVDs5AuwZN0IjSinPHkxi6X3pntPdI1f3+uPIfM ---- yeLaAf4Qm31NpgmncL35ynKKY4krIpuwfzJiZvlCMbM -êË÷æ>‹~<Á—šGÞ¸I8;SÁœg¡5Yÿó[ÍF¸¥è[¬îû¤œi`?]À¢$¨¶ëÛ‹%.7G¼ îb*=5Ó%Ðã¿ \ No newline at end of file