nix-cache02: add Harmonia binary cache service
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
- Parameterize harmonia.nix to use hostname-based Vault paths - Add nix-cache services to nix-cache02 - Add Vault secret and variable for nix-cache02 signing key - Add nix-cache02 public key to trusted-public-keys on all hosts - Update plan doc to remove actions runner references Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,6 @@ The `homelab-deploy` tool was extended with a builder mode:
|
|||||||
### Old System (nix-cache01)
|
### Old System (nix-cache01)
|
||||||
- Still running at 10.69.13.15
|
- Still running at 10.69.13.15
|
||||||
- Serves binary cache via Harmonia
|
- Serves binary cache via Harmonia
|
||||||
- Runs Gitea Actions runner
|
|
||||||
- Has the old `build-flakes.sh` timer (every 30 min)
|
- Has the old `build-flakes.sh` timer (every 30 min)
|
||||||
- Will be decommissioned after nix-cache02 is fully validated
|
- Will be decommissioned after nix-cache02 is fully validated
|
||||||
|
|
||||||
@@ -69,7 +68,6 @@ The `homelab-deploy` tool was extended with a builder mode:
|
|||||||
- Metrics exposed on port 9973 (`homelab-deploy-builder` job)
|
- Metrics exposed on port 9973 (`homelab-deploy-builder` job)
|
||||||
- Does NOT yet have:
|
- Does NOT yet have:
|
||||||
- Harmonia (binary cache server)
|
- Harmonia (binary cache server)
|
||||||
- Actions runner
|
|
||||||
- Cache signing key
|
- Cache signing key
|
||||||
|
|
||||||
## Remaining Work
|
## Remaining Work
|
||||||
@@ -84,10 +82,9 @@ The `homelab-deploy` tool was extended with a builder mode:
|
|||||||
### Phase 4: Complete Migration
|
### Phase 4: Complete Migration
|
||||||
|
|
||||||
1. **Add Harmonia to nix-cache02** - Copy cache signing key, configure service
|
1. **Add Harmonia to nix-cache02** - Copy cache signing key, configure service
|
||||||
2. **Add Actions runner to nix-cache02** - Configure with Vault token
|
2. **Update DNS** - Point `nix-cache.home.2rjus.net` to nix-cache02
|
||||||
3. **Update DNS** - Point `nix-cache.home.2rjus.net` to nix-cache02
|
3. **Increase RAM** - Bump to 24GB after nix-cache01 is gone
|
||||||
4. **Increase RAM** - Bump to 24GB after nix-cache01 is gone
|
4. **Decommission nix-cache01**:
|
||||||
5. **Decommission nix-cache01**:
|
|
||||||
- Remove from `terraform/vms.tf`
|
- Remove from `terraform/vms.tf`
|
||||||
- Remove old build script (`services/nix-cache/build-flakes.nix`, `build-flakes.sh`)
|
- Remove old build script (`services/nix-cache/build-flakes.nix`, `build-flakes.sh`)
|
||||||
- Archive or delete host config
|
- Archive or delete host config
|
||||||
@@ -145,5 +142,4 @@ Available metrics:
|
|||||||
## Open Questions
|
## Open Questions
|
||||||
|
|
||||||
- [ ] When to cut over DNS from nix-cache01 to nix-cache02?
|
- [ ] When to cut over DNS from nix-cache01 to nix-cache02?
|
||||||
- [ ] Keep Actions runner on nix-cache02 or separate host?
|
|
||||||
- [ ] Implement safe flake update workflow before or after full migration?
|
- [ ] Implement safe flake update workflow before or after full migration?
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
./builder.nix
|
./builder.nix
|
||||||
|
../../services/nix-cache
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
vault.secrets.cache-secret = {
|
vault.secrets.cache-secret = {
|
||||||
secretPath = "hosts/nix-cache01/cache-secret";
|
secretPath = "hosts/${config.networking.hostName}/cache-secret";
|
||||||
extractKey = "key";
|
extractKey = "key";
|
||||||
outputDir = "/run/secrets/cache-secret";
|
outputDir = "/run/secrets/cache-secret";
|
||||||
services = [ "harmonia" ];
|
services = [ "harmonia" ];
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ in
|
|||||||
];
|
];
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"nix-cache.home.2rjus.net-1:2kowZOG6pvhoK4AHVO3alBlvcghH20wchzoR0V86UWI="
|
"nix-cache.home.2rjus.net-1:2kowZOG6pvhoK4AHVO3alBlvcghH20wchzoR0V86UWI="
|
||||||
|
"nix-cache02.home.2rjus.net-1:QyT5FAvJtV+EPQrgQQ6iV9JMg1kRiWuIAJftM35QMls="
|
||||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||||
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -75,12 +75,17 @@ locals {
|
|||||||
data = { private_key = var.wireguard_private_key }
|
data = { private_key = var.wireguard_private_key }
|
||||||
}
|
}
|
||||||
|
|
||||||
# Nix cache signing key
|
# Nix cache signing keys
|
||||||
"hosts/nix-cache01/cache-secret" = {
|
"hosts/nix-cache01/cache-secret" = {
|
||||||
auto_generate = false
|
auto_generate = false
|
||||||
data = { key = var.cache_signing_key }
|
data = { key = var.cache_signing_key }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"hosts/nix-cache02/cache-secret" = {
|
||||||
|
auto_generate = false
|
||||||
|
data = { key = var.cache_signing_key_02 }
|
||||||
|
}
|
||||||
|
|
||||||
# Homelab-deploy NKeys
|
# Homelab-deploy NKeys
|
||||||
"shared/homelab-deploy/listener-nkey" = {
|
"shared/homelab-deploy/listener-nkey" = {
|
||||||
auto_generate = false
|
auto_generate = false
|
||||||
|
|||||||
@@ -41,11 +41,18 @@ variable "wireguard_private_key" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "cache_signing_key" {
|
variable "cache_signing_key" {
|
||||||
description = "Nix binary cache signing key"
|
description = "Nix binary cache signing key (nix-cache01)"
|
||||||
type = string
|
type = string
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "cache_signing_key_02" {
|
||||||
|
description = "Nix binary cache signing key (nix-cache02)"
|
||||||
|
type = string
|
||||||
|
default = "PLACEHOLDER"
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
|
|
||||||
variable "homelab_deploy_listener_nkey" {
|
variable "homelab_deploy_listener_nkey" {
|
||||||
description = "NKey seed for homelab-deploy listeners"
|
description = "NKey seed for homelab-deploy listeners"
|
||||||
type = string
|
type = string
|
||||||
|
|||||||
Reference in New Issue
Block a user