Compare commits

...
Author SHA1 Message Date
hermes a2037ee290 fix: IP del modo VPS via interfaz de la ruta por defecto
10.5.0.2 (vEthernet WSL) salia como URL: el filtro por rango 172.16-31
no cubre las IPs internas 10.x de WSL/Hyper-V. Ahora se coge la IP de la
interfaz que tiene la ruta 0.0.0.0/0 — la que de verdad va a la LAN.
Fallback TU_IP si no hay ruta.
2026-09-12 20:49:16 +02:00
hermes 284d611b0c feat: reintento del ollama pull (3 intentos) (#4)
Co-authored-by: Hermes Agent <hermes@d0a1.es>
2026-09-12 20:45:40 +02:00
4 changed files with 62 additions and 6 deletions

No files matched your search

+13 -1
View File
@@ -121,8 +121,20 @@ while ($true) {
} }
} }
Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...' Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...'
$PullOk = $false
foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-hermes-ollama ollama pull llama3.2:3b docker exec d0a1-hermes-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -ne 0) { Err 'Fallo la descarga del modelo.'; exit 1 } if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
Write-Host ' docker exec d0a1-hermes-ollama ollama pull llama3.2:3b'
exit 1
}
Ok "Ollama corriendo en http://localhost:${OllamaPort}" Ok "Ollama corriendo en http://localhost:${OllamaPort}"
# --- 2. Instalar Hermes Agent ------------------------------------------------ # --- 2. Instalar Hermes Agent ------------------------------------------------
+13 -1
View File
@@ -121,8 +121,20 @@ while ($true) {
} }
} }
Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...' Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...'
$PullOk = $false
foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -ne 0) { Err 'Fallo la descarga del modelo.'; exit 1 } if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
Write-Host ' docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b'
exit 1
}
Ok "Ollama corriendo en http://localhost:${OllamaPort}" Ok "Ollama corriendo en http://localhost:${OllamaPort}"
# --- 2. Instalar OpenClaw ----------------------------------------------------- # --- 2. Instalar OpenClaw -----------------------------------------------------
+18 -2
View File
@@ -96,8 +96,12 @@ if ($Mode -eq 'local') {
Write-Host " URL: ${Cyan}http://localhost:${WebUiPort}${NC}" Write-Host " URL: ${Cyan}http://localhost:${WebUiPort}${NC}"
} else { } else {
Warn 'Modo: VPS (accesible desde fuera)' Warn 'Modo: VPS (accesible desde fuera)'
# IP real de LAN: la de la interfaz con la ruta por defecto (evita vEthernet
# WSL/Hyper-V, Docker, VPN — que son 172.16-31.*, 10.x internos, etc.)
$GwIf = (Get-NetRoute -DestinationPrefix '0.0.0.0/0' -ErrorAction SilentlyContinue |
Sort-Object RouteMetric | Select-Object -First 1).ifIndex
$Ip = (Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue | $Ip = (Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue |
Where-Object { $_.IPAddress -notlike '127.*' -and $_.IPAddress -notlike '169.254.*' -and $_.IPAddress -notmatch '^172\.(1[6-9]|2[0-9]|3[01])\.' } | Where-Object { $_.ifIndex -eq $GwIf -and $_.IPAddress -notlike '127.*' } |
Select-Object -First 1).IPAddress Select-Object -First 1).IPAddress
if (-not $Ip) { $Ip = 'TU_IP' } if (-not $Ip) { $Ip = 'TU_IP' }
Write-Host " URL: ${Cyan}http://${Ip}:${WebUiPort}${NC}" Write-Host " URL: ${Cyan}http://${Ip}:${WebUiPort}${NC}"
@@ -132,8 +136,20 @@ while ($true) {
exit 1 exit 1
} }
} }
$PullOk = $false
foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-ollama ollama pull llama3.2:3b docker exec d0a1-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -ne 0) { Err 'Fallo la descarga del modelo.'; exit 1 } if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
Write-Host ' docker exec d0a1-ollama ollama pull llama3.2:3b'
exit 1
}
# --- Done ------------------------------------------------------------------- # --- Done -------------------------------------------------------------------
Write-Host '' Write-Host ''
+18 -2
View File
@@ -131,8 +131,12 @@ if ($Mode -eq 'local') {
Write-Host " IA (chat): ${Cyan}http://localhost:${WebUiPort}${NC}" Write-Host " IA (chat): ${Cyan}http://localhost:${WebUiPort}${NC}"
} else { } else {
Warn 'Modo: VPS (accesible desde fuera)' Warn 'Modo: VPS (accesible desde fuera)'
# IP real de LAN: la de la interfaz con la ruta por defecto (evita
# vEthernet WSL/Hyper-V, Docker, VPN)
$GwIf = (Get-NetRoute -DestinationPrefix '0.0.0.0/0' -ErrorAction SilentlyContinue |
Sort-Object RouteMetric | Select-Object -First 1).ifIndex
$Ip = (Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue | $Ip = (Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue |
Where-Object { $_.IPAddress -notlike '127.*' -and $_.IPAddress -notlike '169.254.*' -and $_.IPAddress -notmatch '^172\.(1[6-9]|2[0-9]|3[01])\.' } | Where-Object { $_.ifIndex -eq $GwIf -and $_.IPAddress -notlike '127.*' } |
Select-Object -First 1).IPAddress Select-Object -First 1).IPAddress
if (-not $Ip) { $Ip = 'TU_IP' } if (-not $Ip) { $Ip = 'TU_IP' }
Write-Host " WordPress: ${Cyan}http://${Ip}:${WpPort}${NC}" Write-Host " WordPress: ${Cyan}http://${Ip}:${WpPort}${NC}"
@@ -170,8 +174,20 @@ while ($true) {
exit 1 exit 1
} }
} }
$PullOk = $false
foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-wp-ollama ollama pull llama3.2:3b docker exec d0a1-wp-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -ne 0) { Err 'Fallo la descarga del modelo.'; exit 1 } if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
Write-Host ' docker exec d0a1-wp-ollama ollama pull llama3.2:3b'
exit 1
}
# --- Done ------------------------------------------------------------------- # --- Done -------------------------------------------------------------------
Write-Host '' Write-Host ''