feat(ops/modules): configure builderball cache setup

Configures an experimental setup for a builderball-based public cache.

This cache only includes the two build machines (whitby & nevsky), for the time
period where both of them exist simultaneously.

The idea is this:

All participating hosts run a harmonia binary cache locally (whitby already
does). They then run builderball instances pointing at each other's harmonia
caches (through dedicated public hostnames).

When a request comes in, the first matching cache address is returned and Nix
will substitute from there.

Change-Id: Ia7d5357fd5e04f77b460205544fa24e82b100230
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12975
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2025-01-12 16:44:11 +03:00 committed by clbot
parent 6733b26ba5
commit c948a26d7d
9 changed files with 214 additions and 11 deletions

View file

@ -104,6 +104,40 @@ resource "glesys_dnsdomain_record" "tvl_fyi_net_CNAME" {
host = "net"
}
# Binary cache round-robin setup (experimental; only on .fyi)
resource "glesys_dnsdomain_record" "cache_tvl_fyi_A" {
domain = glesys_dnsdomain.tvl_fyi.id
host = "cache"
type = "A"
data = each.key
for_each = toset([var.whitby_ipv4, var.nevsky_ipv4])
}
resource "glesys_dnsdomain_record" "cache_tvl_fyi_AAAA" {
domain = glesys_dnsdomain.tvl_fyi.id
host = "cache"
type = "AAAA"
data = each.key
for_each = toset([var.whitby_ipv6, var.nevsky_ipv6])
}
# Builderball cache records
resource "glesys_dnsdomain_record" "tvl_fyi_cache_whitby_CNAME" {
domain = glesys_dnsdomain.tvl_fyi.id
type = "CNAME"
data = "whitby.tvl.fyi."
host = "whitby.cache"
}
resource "glesys_dnsdomain_record" "tvl_fyi_cache_nevsky_CNAME" {
domain = glesys_dnsdomain.tvl_fyi.id
type = "CNAME"
data = "nevsky.tvl.fyi."
host = "nevsky.cache"
}
# Google Domains mail forwarding configuration (no sending)
resource "glesys_dnsdomain_record" "tvl_fyi_MX_5" {
domain = glesys_dnsdomain.tvl_fyi.id

View file

@ -67,6 +67,13 @@ resource "glesys_dnsdomain_record" "tvl_su_sanduny_AAAA" {
data = var.sanduny_ipv6
}
resource "glesys_dnsdomain_record" "cache_tvl_su_whitby_CNAME" {
domain = glesys_dnsdomain.tvl_su.id
host = "cache"
type = "CNAME"
data = "whitby.tvl.su."
}
# Explicit records for all services running on whitby
resource "glesys_dnsdomain_record" "tvl_su_whitby_services" {
domain = glesys_dnsdomain.tvl_su.id

View file

@ -98,7 +98,6 @@ locals {
"atward",
"auth",
"b",
"cache",
"cl",
"code",
"cs",