feat: apply sealed installation plans without interactive setup

This commit is contained in:
Codex
2026-10-06 15:45:18 +02:00
parent c3c9f509bf
commit 8b9a086fd6
31 changed files with 1542 additions and 45 deletions
+31 -4
View File
@@ -39,9 +39,8 @@ platform without pulling layers. `docker compose config --format json` checks th
effective service configuration. Compose receives only Docker connection/trust,
proxy and executable-discovery host variables; application parameters come from
the prepared environment file. Raw Docker output is never copied into reports.
Each Docker command has a 15-second bound. No release is currently certified merely
because controlled manifest tests pass: publication and real pull acceptance belong
to the publication/execution tickets.
Each preflight Docker command has a 15-second bound. Public image publication is
verified separately; controlled manifest tests alone do not certify host acceptance.
## External checks and bounds
@@ -85,7 +84,35 @@ is generated. Credential rotation invalidates the plan. Added/deleted/changed
workspace files invalidate it as well. Changes during the checks abort publication.
Plan output never overwrites an existing plan or key.
Execution and resumption must call `VerifyPlanInputs` **and repeat live checks and
Execution and resumption call `ReadExecutionPlan` **and repeat live checks and
credential reads before mutations**. A valid seal alone does not certify current
network availability, Docker state or runtime readiness. Keep both plan files
private and outside the workspace repository; they are installation-local artifacts.
## Non-interactive platform execution
`tht --installation ABS_DESCRIPTOR installation apply --plan ABS_PLAN [--json]`
requires an operator whose version and revision match the manifest. Plans must
include the manifest and bootstrap paths; regenerate older plans. The only permitted
absent-input transition is materialization of a standard release transport overlay
with exactly its packaged digest. All other input changes invalidate execution.
The local profile uses the preparing non-root Unix operator's UID/GID for core,
maintenance, migrations and PostgreSQL. Original private authentication directory
and credential mounts remain authoritative. A pinned, offline one-shot helper seeds
only installation-owned volumes, retaining a root-owned initialization marker for
interruption recovery. Existing ready volumes are never recursively chowned.
Account collisions and foreign volumes stop execution. This requires local Docker;
Windows runs inside WSL2 rather than the native Windows shell.
The lifecycle lock excludes concurrent operations. Asset publication and journal
updates are atomic. Every retry repeats reconciliation, even after a completed
journal stage. Pull and service startup have 30-minute bounds; Catalog startup and
migration have 5-minute bounds; final health inspection has a 1-minute bound.
Cancellation cleans up named one-shot containers and releases the lock. Hard-killed
processes require explicit stale-owner inspection; automatic destructive repair is
not performed. Errors contain a stage/action without raw Docker output or secrets.
Success reports `platform_ready: true` and `workspace_ready: false`: services and
local authentication protection are checked, while binding import, workspace
preprocessing, model use and final readiness remain separate obligations.
+41 -6
View File
@@ -13,9 +13,11 @@ The first two steps of the new flow work without Docker, Node, Python, Pi or an
installation descriptor. Use the platform bundle with **both** `tht` and
`tht-workspace-documents` in the same directory (`.exe` on Windows). Put that directory
on `PATH`, or invoke the absolute executable path. Older packages containing only
`tht` do not provide this capability. Maintainers can currently build the bundle;
publishing assets and Docker Hub images belongs to a later delivery step. The rest
of this guide still describes the existing installation path.
`tht` do not provide this capability. Download bundles from the
[public releases](https://git.tylconsulting.it/mptyl/ThothII/releases); core and frontend
images are published on Docker Hub. `installation apply` requires a bundle containing
that command: the first preview provided preparation and preflight only. On Windows,
use the Linux bundle inside Ubuntu WSL2.
1. Choose a new directory outside the application checkout, with an existing parent:
@@ -179,8 +181,8 @@ tht --installation /path/installation/thothii-installation.yaml installation pla
This repeats document checks, verifies image digests and Compose, Git, available
external databases and Evidence, then saves the plan and its separate private
`.key` file. It does not execute setup. Missing images and unavailable existing
dependencies block the plan. Actual Docker Hub publication remains the next ticket;
an invented manifest cannot bypass publication.
dependencies block the plan. The manifest and executables must belong to the same
release; an invented manifest cannot bypass these checks.
Correct `error` outcomes and read `warning` outcomes. `deferred-to-runtime` entries
are mandatory checks after startup, not readiness already achieved. After changing
@@ -192,7 +194,40 @@ incur ordinary service request charges. See the
[preflight reference](installation-preflight.md) for limits, the manifest
format and runtime obligations.
## Before you start: the two repositories
## Start the platform from verified documents
Use the same non-root operator that prepared the documents, with access to local
Docker. The command asks no questions and accepts closed stdin:
```sh
tht --installation /path/installation/thothii-installation.yaml installation apply \
--plan /path/installation/installation-plan.json --json
```
It repeats live checks and plan verification, copies verified assets, pulls images,
initializes new installation volumes, starts PostgreSQL, applies Catalog and Memory
migrations, and starts services. It never builds sources. The initial administrator
comes from the prepared authentication documents. Secrets retain private permissions;
services that read them run with the operator's UID. This path does not convert an
existing stack with incompatible volume ownership.
`platform_ready: true, workspace_ready: false` confirms platform startup and protected
endpoints, **not** readiness to query a database. Binding import, workspace activation
and preprocessing, and a model smoke test are subsequent steps. The three curated
example databases remain deferred.
After a failure, correct the cause and repeat `apply`. The private journal under
`.tht/<installation>/installation-apply.json` records stages; actual service state is
checked again. Retries preserve data, never reset volumes and never fall back to
building sources. Changed documents or credentials require a new plan. Ctrl+C releases
the lock; after a forcibly killed process, confirm that its owner is no longer running
before explicitly removing a stale lock. A different release requires the upgrade
path rather than this command.
## Manual source path: the two repositories
The remaining sections describe the existing manual path. Do not run its build/setup
commands over an installation created with `installation apply`.
There are two separate repositories:
+40 -6
View File
@@ -14,9 +14,10 @@ un file di installazione. Usare il bundle della propria piattaforma con **entram
gli eseguibili `tht` e `tht-workspace-documents` nella stessa cartella (`.exe` su
Windows). Aggiungere la cartella al `PATH`, oppure usare il percorso completo.
Il vecchio pacchetto con il solo `tht` non contiene questa capacità. Il bundle è
attualmente producibile dal manutentore; pubblicazione degli asset e immagini
Docker Hub appartengono a una fase successiva. Il resto della guida descrive ancora
il percorso di installazione esistente.
scaricabile dai [rilasci pubblici](https://git.tylconsulting.it/mptyl/ThothII/releases).
Le immagini core e frontend sono pubblicate su Docker Hub. Per `installation apply`
occorre un bundle che includa questo comando: la prima preview conteneva solo
preparazione e preflight. Su Windows usare il bundle Linux in Ubuntu WSL2.
1. Scegliere una cartella nuova, esterna all'applicazione, con padre già esistente:
@@ -185,8 +186,8 @@ tht --installation /percorso/installazione/thothii-installation.yaml installatio
Il comando ripete i controlli dei documenti, verifica immagini/digest e Compose,
Git, database ed Evidence esterne disponibili, poi salva il piano e il suo file
privato `.key`. Non esegue il setup. Le immagini assenti e le dipendenze esterne
irraggiungibili bloccano il piano. Al momento la pubblicazione reale Docker Hub
è ancora il ticket successivo: un manifest inventato non permette di aggirarla.
irraggiungibili bloccano il piano. Il manifest deve provenire dallo stesso rilascio
degli eseguibili; un manifest inventato non permette di aggirare queste verifiche.
Correggere gli esiti `error`; leggere gli `warning`. Gli esiti
`deferred-to-runtime` identificano controlli obbligatori dopo l'avvio, non una
@@ -199,7 +200,40 @@ generazione LLM viene invocata; le richieste HTTP/S3 possono avere i normali cos
del servizio. Limiti, manifest e obblighi sono nel
[riferimento di preflight](installation-preflight.md).
## Prima di iniziare: i due repository
## Avviare la piattaforma dai documenti verificati
Eseguire come lo stesso utente non root che ha preparato i documenti, con Docker
locale accessibile. Il comando non pone domande e funziona anche con stdin chiuso:
```sh
tht --installation /percorso/installazione/thothii-installation.yaml installation apply \
--plan /percorso/installazione/installation-plan.json --json
```
Ripete le verifiche live e del piano, copia gli asset verificati, scarica le immagini,
inizializza i volumi della nuova installazione, avvia PostgreSQL, applica le migrazioni
Catalog e Memory e avvia i servizi. Non compila sorgenti. L'amministratore iniziale
proviene dai documenti di autenticazione già preparati. I segreti mantengono i
permessi privati: i servizi interessati usano l'UID dell'operatore. Questo percorso
non converte stack preesistenti con proprietari o volumi incompatibili.
Il risultato `platform_ready: true, workspace_ready: false` certifica l'avvio della
piattaforma e la protezione degli endpoint, **non** la possibilità di interrogare
già il database. Import dei binding, attivazione/preprocessing dei workspace e
prova modello sono i passi successivi. I tre database di esempio restano differiti.
In caso di errore, correggere la causa e ripetere `apply`: il journal privato in
`.tht/<installazione>/installation-apply.json` registra gli stadi, mentre lo stato
reale dei servizi viene ricontrollato. Il retry conserva i dati; non elimina volumi
e non ricorre a una build. Dopo modifiche ai documenti o alle credenziali serve un
nuovo piano. Ctrl+C rilascia il lock; dopo un arresto forzato del processo verificare
che non sia più attivo prima di rimuovere esplicitamente il suo lock residuo.
Un rilascio differente richiede il percorso di aggiornamento, non questo comando.
## Percorso manuale da sorgenti: i due repository
Le sezioni successive documentano il percorso manuale esistente. Non eseguire i
suoi comandi di build o setup sopra un'installazione creata con `installation apply`.
Servono due repository distinti: