-
Notifications
You must be signed in to change notification settings - Fork 0
1.10 Step | CreateVirtualenv
Crea il virtualenv Python in
<install_dir>/sandbox, in modo reversibile. Vive insrc/steps/create_virtualenv.rs. Secondo dei tre sotto-step dei sorgenti (1.9 CloneOdooRepo → venv → 1.11 InstallPythonRequirements). Come utente odoo.
| Fase | Comportamento |
|---|---|
| snapshot |
<venv>/bin/python3 eseguibile esiste? → Preexisting/Untracked
|
| run |
Preexisting → skip. Altrimenti verifica python3 -m venv disponibile (dalle dipendenze di Fase 4), poi sudo -u odoo python3 -m venv <venv>, poi CreatedByUs. dry_run → log |
| undo | solo CreatedByUs: rm -rf <venv>. Idempotente, best-effort |
Se python3-venv non è disponibile → errore chiaro (non un fallimento oscuro più avanti).
Il punto architetturale: rm -rf sandbox non rimuove solo il venv, ma tutti i pacchetti pip al suo
interno. Per questo 1.11 InstallPythonRequirements non
ha un undo proprio: sarebbe ridondante e fragile disinstallare i pacchetti uno a uno quando basta
rimuovere il contenitore.
rollback (ordine inverso):
undo pip → NO-OP
undo venv → rm -rf sandbox ← rimuove venv + tutti i pacchetti pip
undo clone → rm -rf odoo
È il contenitore (venv) che possiede la rimozione del contenuto (pip). Modello per le scomposizioni future.
- Se il venv era
Preexisting(non nostro), l'undo lo lascia intatto — e di conseguenza anche i suoi pacchetti. -
rm -rflegittimo: il venv è sotto<install_dir>, nostro perimetro. - Test: assente (crea + undo rm -rf),
Preexisting(no-op),python3-venvmancante (errore).
Start here
Key concepts
References
For developers
Technical detail — how it works inside
Steps:
- 1.1 PrepareOptRoot
- 1.2 CreateOdooUser
- 1.3 SetupLogDir
- 1.3b SetupCacheDir
- 1.4 AptPackages (delta)
- 1.5 InstallWkhtmltopdf
- 1.6 SetupPostgres
- 1.7 CreateDbRole
- 1.8 CreateDatabase
- 1.9 CloneOdooRepo
- 1.10 CreateVirtualenv
- 1.11 InstallPythonRequirements
- 1.12 GenerateConfig
- 1.12b SetupDataDir
- 1.13 InitializeOdooDatabase
- 1.14 SetupSystemd
- 1.15 Nginx (6 sub-steps)
- 1.16 WriteControlScript + PatchBashrc
Cross-cutting: