Skip to main content

Module cluster

Module cluster 

Source
Expand description

A platform=any gate run on the homelab cluster, as one Kubernetes Job (ADR-0016).

A trusted manifest marks a gate whose verdict does not depend on the platform (platform=any) and says set executor cluster; the machine names a kubeconfig and an image pinned by digest. Then the gate runs in a pod instead of on this laptop, and takes no host slot (ADR-0014).

The cluster proves only passes. The verdict is read from what Kubernetes recorded — the Job’s Complete condition, each container’s exit code, fetch’s termination message naming the tree, the pod’s imageID — never from the logs. Anything else, a failure of the gate included, re-runs the gate here, unchanged, and the local outcome is the verdict: a gate never fails because of the cluster. Each such fallback appends <epoch> <gate> <reason> to greengate/cluster.log in the common git directory.

A pass is recorded under its own identity ([crate::gate_identity::cluster_token]) in its own ref (crate::gate_stamp::CLUSTER_REF) and never as a local token: the hooks consult proved so a cluster-derived pass never reaches the commit marker, a push stamp or the laptop’s attestation.

Every kubectl call goes through --kubeconfig <path> (never the default context), with stdin null — except the one exec -i that streams the bundle — and under one deadline taken before the Job is created.

Structs§

Detached
The gates of a rehearsal that are on the cluster for HEAD’s tree now.

Enums§

Ask
Who asks for a rehearsal to go to the cluster.
Judged
What the cluster is asked to judge.

Functions§

cancel_live
The signal watcher’s hook, after the index is restored: say so, ask the apiserver to drop every live Job without waiting for it, all under one shared budget, and remove the temporary files and refs. A second signal meanwhile ends amont at once and leaves the Job to its own deadline.
collect_command
amont cluster collect: exit 0 when it asked the cluster (or had nothing to ask, or another collect is at it), 1 when it learned nothing or could not keep what it learned, 2 on usage.
collect_if_declared
[collect] for the hooks and amont stamps, which run in every repository: only where the manifest declares a platform=any gate, the only kind a Workflow can hold a pass for, so a repository without one pays nothing.
covered_at_head
post-commit: the blocking commit-time scripts whose cluster token is on HEAD’s tree. The bypass ledger reads them as stamped: their pass is recorded, only not as a local token. Spawns nothing in a repository with no platform=any gate.
detach
Hand scoped — the gates a rehearsal of HEAD would run — to the cluster, as far as it may take them, and say which are there now: the ones a record of this tree still waits for, and the ones this call submitted. The rest run here, exactly as without the lane.
proved
Did the cluster prove the check id on tree in this process?
proved_anywhere
Did the cluster prove the check id on any tree in this process? For a caller that covers several trees at once (an attestation of a push).
proved_on_index
Did the cluster prove the check id on the index’s tree? Spawns nothing unless the cluster proved id somewhere; when git cannot name the index’s tree, the answer is yes, so no local token is written on a guess.
stamped_on_tree
amont stamps: does tree carry a cluster token for any of ids, each a trusted platform=any declaration?
try_run
Run ext on the cluster if it is the cluster’s to run. true: it passed there and the pass is recorded; the caller reports Passed. false: the caller runs it here, as it always has — either it was never the cluster’s (no line logged), or the cluster did not prove it (the reason is logged).
vouched
pre-commit (and run --stamp): is the tree about to be committed already proved on the cluster for this gate, as it is declared and configured now? A hit counts as a cluster pass (proved).
vouched_on_every
pre-push: does every tip carry this gate’s cluster token on its tree?
wanted
Does this rehearsal go to the cluster: asked for with --cluster, or the machine says greengate.rehearse.cluster true?