Files
ilkerandClaude Opus 5.5 772579648c hpcod: one binary installs, checks and tests the control plane
An installation used to be this one: the deploy scripts and the Ansible
defaults carried one site's domain, hypervisor and login, the Proxmox side
and the database were set up by hand, and deploying meant copying scripts
and a tree of roles beside the binary and keeping them in step with it.

The binary now carries the roles, the Terraform module, the schema and the
catalogue (embed.go), and installs itself:

- hpcod setup: a full-screen installer for administrators. It asks where
  clusters are built, signs in to Proxmox before asking anything else
  (root's password once, or tokens), offers nodes and datastores from what
  Proxmox has, checks every field as it is typed, runs every step with its
  output live, checks the result and offers a test cluster. -yes runs the
  same steps from a site file; make deploy uses that.
- hpcod verify: each fact checked by using it.
- hpcod selftest: the smallest real cluster, by the portal's own path, a
  job run on it, then taken down.
- Closed networks: hpcod serves HTTPS itself from a CA name-constrained to
  the site's domains, issuing and renewing its own certificate, and
  answers DNS for the portal and every cluster name.
- A simulated Proxmox: Proxmox VE in QEMU on the control plane host, on a
  private bridge with NAT, for trying it without one.

Every step reads back what it changed and is safe to run again. The
site's values live in one file; group_vars/all/site.yml is generated from
it, and the playbooks refuse to run without it. ci_user and -ssh-user no
longer default to a personal account. scripts/B10, B20 and C20 are gone:
their work is the setup steps.

Proven end to end on a simulated Proxmox (Proxmox VE 9 in a VM on a real
host): the install, the Proxmox step by the password path, the head
template, verify READY, and a test cluster that ran srun on its compute
node and was destroyed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:20:04 +01:00

94 lines
4.1 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package tui
import (
"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
)
// The palette, shared with the slides: navy and cream, an orange accent for
// what has focus, blue for structure.
var (
cOrange = lipgloss.Color("#F28C28")
cBlue = lipgloss.Color("#3BA3C9")
cCream = lipgloss.Color("#F4F2EC")
cText = lipgloss.Color("#D6DDE6")
cMuted = lipgloss.Color("#8796AA")
cDim = lipgloss.Color("#4F5D73")
cPanel = lipgloss.Color("#17283F")
cNavy = lipgloss.Color("#0F1B2D")
cGreen = lipgloss.Color("#5BC08A")
cRed = lipgloss.Color("#E5636B")
cAmber = lipgloss.Color("#E8B34A")
)
var (
sTitle = lipgloss.NewStyle().Bold(true).Foreground(cCream)
sOK = lipgloss.NewStyle().Foreground(cGreen)
sFail = lipgloss.NewStyle().Foreground(cRed).Bold(true)
sWarn = lipgloss.NewStyle().Foreground(cAmber)
sDim = lipgloss.NewStyle().Foreground(cMuted)
sFaint = lipgloss.NewStyle().Foreground(cDim)
sText = lipgloss.NewStyle().Foreground(cText)
sAcc = lipgloss.NewStyle().Foreground(cOrange).Bold(true)
sBlue = lipgloss.NewStyle().Foreground(cBlue).Bold(true)
sKey = lipgloss.NewStyle().Foreground(cNavy).Background(cBlue).Padding(0, 1).Bold(true)
)
// formTheme styles every form like the rest of the window.
func formTheme() *huh.Theme {
t := huh.ThemeBase()
t.Form.Base = lipgloss.NewStyle()
t.Group.Base = lipgloss.NewStyle()
t.Group.Title = sAcc
t.Group.Description = sDim
t.FieldSeparator = lipgloss.NewStyle().SetString("\n")
f := &t.Focused
f.Base = lipgloss.NewStyle().PaddingLeft(1).BorderStyle(lipgloss.ThickBorder()).BorderLeft(true).BorderForeground(cOrange)
f.Title = lipgloss.NewStyle().Foreground(cOrange).Bold(true)
f.NoteTitle = lipgloss.NewStyle().Foreground(cBlue).Bold(true).MarginBottom(1)
f.Description = lipgloss.NewStyle().Foreground(cMuted)
f.ErrorIndicator = lipgloss.NewStyle().Foreground(cRed).SetString(" ●")
f.ErrorMessage = lipgloss.NewStyle().Foreground(cRed)
f.SelectSelector = lipgloss.NewStyle().Foreground(cOrange).SetString("› ")
f.Option = lipgloss.NewStyle().Foreground(cText)
f.NextIndicator = lipgloss.NewStyle().Foreground(cOrange).MarginLeft(1).SetString("→")
f.PrevIndicator = lipgloss.NewStyle().Foreground(cOrange).MarginRight(1).SetString("←")
f.MultiSelectSelector = lipgloss.NewStyle().Foreground(cOrange).SetString("› ")
f.SelectedOption = lipgloss.NewStyle().Foreground(cCream).Bold(true)
f.SelectedPrefix = lipgloss.NewStyle().Foreground(cGreen).SetString("✓ ")
f.UnselectedOption = lipgloss.NewStyle().Foreground(cText)
f.UnselectedPrefix = lipgloss.NewStyle().Foreground(cDim).SetString("• ")
f.TextInput.Cursor = lipgloss.NewStyle().Foreground(cOrange)
f.TextInput.Placeholder = lipgloss.NewStyle().Foreground(cDim)
// Style only: the input draws its own "> ", and a string here doubles it.
f.TextInput.Prompt = lipgloss.NewStyle().Foreground(cOrange)
f.TextInput.Text = lipgloss.NewStyle().Foreground(cCream)
f.FocusedButton = lipgloss.NewStyle().Foreground(cNavy).Background(cOrange).Bold(true).Padding(0, 2).MarginRight(1)
f.BlurredButton = lipgloss.NewStyle().Foreground(cText).Background(cPanel).Padding(0, 2).MarginRight(1)
f.Next = f.FocusedButton
t.Blurred = *f
b := &t.Blurred
b.Base = f.Base.BorderForeground(cDim)
b.Title = lipgloss.NewStyle().Foreground(cMuted)
// A note is never focused, so it always draws blurred: it is where a
// screen says what it is about, and must not read as greyed out.
b.NoteTitle = lipgloss.NewStyle().Foreground(cBlue).Bold(true).MarginBottom(1)
b.Description = lipgloss.NewStyle().Foreground(cText)
b.SelectSelector = lipgloss.NewStyle().SetString(" ")
b.MultiSelectSelector = lipgloss.NewStyle().SetString(" ")
b.TextInput.Prompt = lipgloss.NewStyle().Foreground(cDim)
b.TextInput.Text = lipgloss.NewStyle().Foreground(cText)
b.NextIndicator = lipgloss.NewStyle()
b.PrevIndicator = lipgloss.NewStyle()
t.Help.ShortKey = lipgloss.NewStyle().Foreground(cMuted)
t.Help.ShortDesc = lipgloss.NewStyle().Foreground(cDim)
t.Help.ShortSeparator = lipgloss.NewStyle().Foreground(cDim)
t.Help.FullKey = t.Help.ShortKey
t.Help.FullDesc = t.Help.ShortDesc
t.Help.FullSeparator = t.Help.ShortSeparator
return t
}