mirror of
https://github.com/hanzoai/compute.git
synced 2026-10-30 14:50:41 +00:00
visor manages VMs across DO/Hetzner/Lightsail/Azure/GCP/Proxmox. It is deliberately the non-cluster path, and it linked client-go twice. autoscaler/ is deleted. It listed Pending pods via rest.InClusterConfig and scaled DOKS node pools — a cluster autoscaler living inside the VM manager. It was gated on autoscalerClusters, which is set in no deployment, so it had never run. service/doks.go is untouched: pure godo, still serving node-pool CRUD. object/coordinator.go now elects over ha.Membership — the interface hanzoai/ha already defines, reused rather than re-declared. With nothing registered the default reports an ERROR, not an empty set: an empty set is the positive claim "I have no peers", which is exactly the lie that double-debits a two-replica Deployment. Only an error carries "I don't know who my peers are". That default means no source, no metering, so a source had to be chosen. It is ha.Static in main.go's serve(), paired with replicas: 1 in universe. The sole process is the sole writer, so exactly-once holds by construction. It is registered in serve() and NOT in visor.Bootstrap(), which is shared verbatim with the embedded cloud mount whose replica count is cloud's, not ours. The two halves are one change: ha.Static at replicas: 2 bills every customer twice an hour. Both sides now carry a comment pointing at the other. Also corrects the comment that made this invisible. Shared() said "Postgres under both backends"; under Base it is the pod-local _global SQLite coord, so the lease PK does not span pods and the election is the only thing holding the line — not belt-and-braces over a global constraint, as the doc implied. k8s/rbac.yaml is a bare ServiceAccount: visor holds zero cluster permissions. go.mod loses every k8s.io/* and sigs.k8s.io/* entry, not just client-go. Co-authored-by: Hanzo Dev <[email protected]>
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
version: '3.1'
|
|
services:
|
|
visor:
|
|
restart: always
|
|
build:
|
|
context: ./
|
|
dockerfile: Dockerfile
|
|
target: STANDARD
|
|
entrypoint: /bin/sh -c './visor --createDatabase=true'
|
|
ports:
|
|
- "19000:19000"
|
|
depends_on:
|
|
- db
|
|
environment:
|
|
RUNNING_IN_DOCKER: "true"
|
|
DB_DSN: "${DB_DSN:-user=hanzo dbname=hanzo_visor host=db port=5432 sslmode=disable}"
|
|
IAM_CLIENT_ID: "${IAM_CLIENT_ID:-}"
|
|
IAM_CLIENT_SECRET: "${IAM_CLIENT_SECRET:-}"
|
|
COMMERCE_URL: "${COMMERCE_URL:-}"
|
|
COMMERCE_TOKEN: "${COMMERCE_TOKEN:-}"
|
|
volumes:
|
|
- ./conf:/conf/
|
|
db:
|
|
restart: always
|
|
image: postgres:16-alpine
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_USER: "${POSTGRES_USER:-hanzo}"
|
|
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}"
|
|
POSTGRES_DB: hanzo_visor
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
guacd:
|
|
image: guacamole/guacd:latest
|
|
environment:
|
|
GUACD_LOG_LEVEL: debug
|
|
volumes:
|
|
- ./data/guacd:/usr/local/visor/data
|
|
ports:
|
|
- "4822:4822"
|
|
restart:
|
|
always
|
|
|
|
volumes:
|
|
pgdata:
|