Repository navigation
Declarative permanent infra (OpenTofu + Ansible) & gatewayd systemd wiring - #73
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces all 6 legacy imperative Gateway/Store/Hetzner installers (~1,900 LOC deleted) with a clean two-layer declarative deployment workflow (supporting Hetzner Cloud, UCloud, and future Ubuntu backends) while leaving ephemeral worker autoscaling untouched:
Wire
ucloud-gatewaydinto systemd &gateway-reconcilesandboxes/systemd/ucloud-sandbox-gatewayd.serviceand added it toSYSTEMD_UNIT_NAMES.reconcile_gateway_services()insandboxes/systemd.pyto automatically enable and restartucloud-sandbox-gatewayd.servicewhen installed, with unit tests intests/test_systemd.py.Hetzner Cloud OpenTofu module (
infra/hetzner/)auto_delete = false,prevent_destroy = true), protected 1 TB chunk-store volume, and Gateway/Store VMs (defaultcpx32).tofu validate,tofu fmt -check, and a live non-destructive import of all 14 Hetzner resources (0 to add, 0 to destroy).Provider-agnostic Ansible roles & playbooks (
infra/ansible/)ansible.builtin.*(zero external Galaxy collections):common,gateway,store,observability(fully nativecollector.yaml,tempo.yaml,scrape.yaml, Grafana provisioning, dashboard, CLI, and bounded systemd units),ops, plus optionalgateway_natandgateway_ingress(fully native Nginx TLS + Grafana/grafana/ops/auth proxy + Certbot renewal) overlays toggled per provider via inventory vars.inventories/hetzner.example/) and UCloud (inventories/ucloud.example/); real environment state stays outside Git under.deploy/(gitignored).site.yml(full convergence + cross-host chunk-index token SHA-256 verification),upgrade.yml(fast release rollout), andscripts/release/build_release.py(digest-pinned wheel +ucloud-gatewayd+ucloud-chunk-serve).Deleted all 6 legacy imperative installers & updated tests/docs
scripts/ops/setup_hetzner_foundation.py,install_hetzner_gateway.sh,install_ucloud_gateway.sh,install_ucloud_ops.sh,install_ucloud_observability_stack.sh, andconfigure_hetzner_sdk_ingress.sh(~1,900 LOC removed).tests/test_declarative_infra.py, loweredtests/test_rules_baseline.json, and updateddocs/operations.md.Verification
scripts/check.sh: PASS (ruff, 200 Python modules, Gomanaged_process+chunk_serve+gatewayd, Rustucloud-noded, wheel build, and all 133 SDK tests).tofu validate&tofu fmt -checkininfra/hetzner/: PASS; live 14-resource import verified (0 to add, 0 to destroy).ansible-playbook --syntax-check: PASS for Hetznersite.yml, UCloudsite.yml, andupgrade.yml.cpx32Hetzner cluster (site.yml), followed bysite.yml --check --diff:changed=0, failed=0(sandboxes-gateway: ok=61,sandboxes-store: ok=15, cross-host chunk-index token assertions passed).scripts/release/build_release.py: built wheel + static Linuxucloud-gatewayd&ucloud-chunk-serve+ SHA-256manifest.json.