8f1b3b7eb1
Phase B is closed (checklist Passi 1–9 [x], benchmark matrix §6–§14 recorded). Move the two finished working docs into the dated archive: plans/PhaseB-user-checklist.md → plans/archived/2026-06-07/ plans/benchmark-windows-host.md → plans/archived/2026-06-07/ plans/ now holds only the forward-looking plans (idea-3 Phase C pwsh removal, idea-4 Phase D ESXi, ideas-overview). Fixed the live links that pointed at the moved/relocated files: idea-3 §4, idea-2 §8 (relative path), and ideas-overview (idea-1/idea-2 now under archived/, Phase A+B marked ✅). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
104 lines
4.4 KiB
Markdown
104 lines
4.4 KiB
Markdown
# Fase C — Eliminazione dipendenza PowerShell dall'host Linux
|
||
|
||
> **Stato**: **pianificata**, da avviare dopo che Fase B è stabile in
|
||
> produzione (≥1 settimana di burn-in, Passo 8 completato).
|
||
> Vedi [overview](ideas-overview.md).
|
||
|
||
---
|
||
|
||
## 1. Obiettivo
|
||
|
||
Rendere l'host Linux completamente indipendente da PowerShell Core (`pwsh`).
|
||
Dopo la Fase B l'orchestrazione ordinaria (job, timer, monitoring, backup)
|
||
è già Python puro. Rimangono script PS usati per test manuali, burn-in e
|
||
validazione host che richiedono `pwsh` installato.
|
||
|
||
**C done**: nessuno script in `scripts/*.ps1` viene più eseguito
|
||
direttamente sull'host Linux; `pwsh` può essere disinstallato senza
|
||
impatti operativi. I `.ps1` rimangono nel repo come riferimento storico
|
||
e per il runner Windows (fallback dual-boot).
|
||
|
||
---
|
||
|
||
## 2. Script da portare
|
||
|
||
| Script PS | Uso attuale (Linux host) | Target Python |
|
||
| ---------------------------- | -------------------------------- | -------------------------------------------------------- |
|
||
| `Test-CapacityBurnIn.ps1` | burn-in B7: 4 job × 10 round | `python -m ci_orchestrator bench run` |
|
||
| `Start-BurnInTest.ps1` | burn-in Windows single-shot | `python -m ci_orchestrator bench run --guest-os windows` |
|
||
| `Start-BurnInTest-Linux.ps1` | burn-in Linux single-shot | `python -m ci_orchestrator bench run --guest-os linux` |
|
||
| `Validate-HostState.ps1` | verifica stato host pre-cutover | `python -m ci_orchestrator validate host` |
|
||
| `Measure-CIBenchmark.ps1` | raccolta metriche timing | integrato in `bench run --collect-metrics` |
|
||
| `Test-Smoke.ps1` | smoke end-to-end manuale | `python -m ci_orchestrator smoke run` |
|
||
| `Test-CapacityBurnIn.ps1` | già referenziato in B7 checklist | vedi sopra |
|
||
|
||
Script **non da portare** (girano solo su Windows o sono già shim):
|
||
- `Register-CIScheduledTasks.ps1` — Windows Scheduler, non serve su Linux
|
||
- `Invoke-RetentionPolicy.ps1` / `Backup-CITemplate.ps1` — già portati in B5
|
||
- Tutti gli script shim in `scripts/` — 3 righe che chiamano Python, restano
|
||
- Script guest (`Install-CIToolchain-*.ps1`, `Prepare-*.ps1`, ecc.) — girano
|
||
dentro le VM Windows, non sull'host
|
||
|
||
---
|
||
|
||
## 3. Architettura prevista
|
||
|
||
Nuovi sub-comandi CLI sotto due nuovi gruppi:
|
||
|
||
```
|
||
python -m ci_orchestrator bench run --guest-os windows|linux
|
||
--template <path>
|
||
--concurrency N
|
||
--rounds N
|
||
--collect-metrics
|
||
|
||
python -m ci_orchestrator validate host # verifica stato host
|
||
python -m ci_orchestrator smoke run # end-to-end smoke test
|
||
```
|
||
|
||
Il gruppo `bench` sostituisce i tre script `*BurnIn*.ps1` con logica
|
||
unificata: avvia N clone in parallelo, misura tempo per job, confronta
|
||
con baseline, emette un report JSON in `CI_ARTIFACTS/bench/`.
|
||
|
||
Il gruppo `validate` porta `Validate-HostState.ps1`: verifica vmrun,
|
||
template snapshot, credenziali, permessi directory, act-runner attivo.
|
||
|
||
---
|
||
|
||
## 4. Aggiornamenti collaterali
|
||
|
||
- `plans/archived/2026-06-07/PhaseB-user-checklist.md` §B7 (archiviato):
|
||
sostituire il comando `pwsh Test-CapacityBurnIn.ps1` con
|
||
`python -m ci_orchestrator bench run`.
|
||
- `deploy/systemd/README.md`: nessun riferimento a `pwsh`.
|
||
- `CLAUDE.md`: rimuovere nota "PowerShell 5.1 Constraints" se non più
|
||
rilevante per l'host (rimane valida per gli script guest Windows).
|
||
- `docs/RUNBOOK.md`: aggiornare procedure di burn-in e smoke test.
|
||
|
||
---
|
||
|
||
## 5. Prerequisiti
|
||
|
||
- Fase B completata e stabile (≥1 settimana, Passo 8 ✅).
|
||
- Nessuna dipendenza da `pwsh` nei timer systemd (già soddisfatta da B5).
|
||
|
||
---
|
||
|
||
## 6. Criteri di "C done"
|
||
|
||
- `python -m ci_orchestrator bench run --concurrency 4 --rounds 10` esegue
|
||
burn-in completo (Win + Linux) con output equivalente a `Test-CapacityBurnIn.ps1`.
|
||
- `python -m ci_orchestrator validate host` esce con 0 su host configurato
|
||
correttamente.
|
||
- `pwsh --version` può essere assente sull'host Linux senza che nessun
|
||
test, timer o script CI fallisca.
|
||
- Suite pytest ≥90% coverage, verde.
|
||
|
||
---
|
||
|
||
## 7. Rollback
|
||
|
||
I `.ps1` originali rimangono nel repo e funzionano su host Windows o su
|
||
Linux con `pwsh` installato. Il rollback è semplicemente reinstallare
|
||
`pwsh` e usare gli script esistenti.
|