Ephemeral CPU Droplet fleet that horizontally scales the iteration loop:
- infra/terraform/test-fleet: cattle Droplets from a golden image (auto-discovered
by name via digitalocean_images), grouped under the mc:dev DO project, with a
mocked-provider test suite (no token/spend).
- infra/packer: golden-image builder reusing scripts/dev-setup/linux.sh.
- scripts/run/dist.sh: ./run dist:{check,up,sim,train,down} — shard sim/test
batches across workers via autoplay-batch AUTOPLAY_HOST+SEED_OFFSET.
GPU intentionally absent (workload is CPU-bound per docs/ai-production.md).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
1.1 KiB
HCL
29 lines
1.1 KiB
HCL
locals {
|
|
# Repo root, three levels up from infra/terraform/test-fleet.
|
|
repo_root = abspath("${path.module}/../../..")
|
|
inventory_path = "${local.repo_root}/.local/fleet/inventory"
|
|
# One "<user>@<ipv4>" line per worker — consumed by scripts/run/dist.sh.
|
|
inventory_body = join("\n", [for d in digitalocean_droplet.worker : "${var.remote_user}@${d.ipv4_address}"])
|
|
}
|
|
|
|
output "worker_ips" {
|
|
description = "Public IPv4 of each fleet worker."
|
|
value = [for d in digitalocean_droplet.worker : d.ipv4_address]
|
|
}
|
|
|
|
output "worker_hosts" {
|
|
description = "ssh targets (<user>@<ip>) the dispatch layer fans work across."
|
|
value = [for d in digitalocean_droplet.worker : "${var.remote_user}@${d.ipv4_address}"]
|
|
}
|
|
|
|
output "inventory_path" {
|
|
description = "Path to the rendered ssh inventory file."
|
|
value = local.inventory_path
|
|
}
|
|
|
|
# Rendered whenever workers exist; emptied (header only) when workers = 0 so a
|
|
# stale fleet can't be addressed after teardown.
|
|
resource "local_file" "inventory" {
|
|
filename = local.inventory_path
|
|
content = "${local.inventory_body}${local.inventory_body == "" ? "# fleet is down (workers = 0)\n" : "\n"}"
|
|
}
|