[IMP] script todo: show log path in dashboard + fast repo refresh (incl. Arch)

Dashboard: the info bar under the log now shows the selected VM's log
file path (in addition to its ssh command), so it can be opened/shared.

Install bootstrap: each package-manager branch first refreshes the repos
so the VM is as fast as possible, and Arch (pacman) is now supported:
- apt: apt-get update
- dnf: dnf makecache (dnf5 picks the fastest mirrors)
- pacman (Arch): reflector selects the 20 fastest HTTPS mirrors ->
  pacman -Syy -> install curl/git/make (Arch was previously unsupported
  by the bootstrap and would abort with "no package manager").
Validated live on the Arch VM: reflector + refresh + install all OK.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mathieu Benoit 2026-07-28 06:10:58 +00:00
parent 69d87f93c3
commit 7a001a9b84
2 changed files with 24 additions and 12 deletions

View file

@ -127,7 +127,7 @@ def run_monitor(manifest_path: str) -> None:
CSS = """
DataTable { width: 40; border: solid $accent; }
RichLog { border: solid $accent; }
#sshbar { height: 1; color: $text-muted; }
#sshbar { height: 2; color: $text-muted; }
"""
BINDINGS = [
("q", "quit", "Quitter (détaché)"),
@ -173,8 +173,9 @@ def run_monitor(manifest_path: str) -> None:
bar = self.query_one("#sshbar", Static)
if vm:
bar.update(
f" {vm['ssh']} (s = SSH · c = copier le log · "
"Maj+glisser = sélectionner)"
f" {vm['ssh']} (s = SSH · c = copier le log · "
"Maj+glisser = sélectionner)\n"
f" Log : {vm['log']}"
)
def _load_selected_log(self, reset=False):

View file

@ -1673,9 +1673,11 @@ class TODO:
puis clone + make install_os + make install_odoo_18)."""
return (
"set -e; "
# Outils d'amorçage (absents des images cloud minimales) :
# curl, git, make. Supporte apt (Debian/Ubuntu) et dnf/yum
# (Fedora). apt-get update car cloud-init n'a pas rafraîchi apt.
# Outils d'amorçage (absents des images cloud minimales) : curl,
# git, make. Chaque branche RAFRAÎCHIT d'abord les dépôts pour que
# la VM soit la plus rapide possible (miroirs à jour / les plus
# rapides), puis installe. Supporte apt (Debian/Ubuntu), dnf/yum
# (Fedora) et pacman (Arch).
"PKGS='curl git make'; "
"if command -v apt-get >/dev/null 2>&1; then "
# update best-effort (|| true) puis install OBLIGATOIRE : sans le
@ -1684,15 +1686,24 @@ class TODO:
"sudo apt-get update -qq || true; "
"sudo apt-get install -y $PKGS; "
"elif command -v dnf >/dev/null 2>&1; then "
# --refresh (métadonnées à jour) ; retry avec « clean all » car les
# images cloud fraîches ratent parfois la vérif GPG/checksum d'un
# miroir (« Signature verification failed »).
# makecache (dnf5 choisit les miroirs les plus rapides) puis
# install --refresh ; retry avec « clean all » car les images
# cloud fraîches ratent parfois la vérif GPG/checksum d'un miroir.
"sudo dnf -q makecache || true; "
"sudo dnf install -y --refresh $PKGS || "
"{ sudo dnf clean all; sudo dnf install -y --refresh $PKGS; }; "
"elif command -v pacman >/dev/null 2>&1; then "
# Arch : reflector sélectionne les miroirs HTTPS les plus rapides,
# puis rafraîchit la base et installe.
"sudo pacman -Sy --needed --noconfirm reflector || true; "
"sudo reflector --latest 20 --protocol https --sort rate "
"--save /etc/pacman.d/mirrorlist || true; "
"sudo pacman -Syy --noconfirm || true; "
"sudo pacman -S --needed --noconfirm $PKGS; "
"elif command -v yum >/dev/null 2>&1; then "
"sudo yum install -y $PKGS; "
"else echo 'Aucun gestionnaire de paquets (apt/dnf/yum)'; "
"exit 1; fi; "
"sudo yum makecache -q || true; sudo yum install -y $PKGS; "
"else echo 'Aucun gestionnaire de paquets "
"(apt/dnf/pacman/yum)'; exit 1; fi; "
# Vérifie explicitement que tout est là : erreur nette plutôt
# qu'un « command not found » cryptique plus loin.
"for t in curl git make; do command -v $t >/dev/null 2>&1 || "