Compare commits

...
Author SHA1 Message Date
hermes 9ac790f8f3 feat: pull del modelo respeta HTTPS_PROXY
Tu red no llega al registry de Ollama (R2/Cloudflare). Si hay proxy
definido en HTTPS_PROXY, se pasa al contenedor en el pull (doc oficial
de Ollama para Docker). Sin proxy, el mensaje de error explica como
definirlo y relanzar.
2026-09-12 20:58:42 +02:00
hermes 912105f16f feat: down/rm de runs previos antes del up (#6)
Co-authored-by: Hermes Agent <hermes@d0a1.es>
2026-09-12 20:55:43 +02:00
hermes 8bd5bbf366 fix: IP del modo VPS via interfaz de la ruta por defecto (#5)
Co-authored-by: Hermes Agent <hermes@d0a1.es>
2026-09-12 20:49:29 +02:00
4 changed files with 56 additions and 10 deletions

No files matched your search

+11 -2
View File
@@ -96,6 +96,7 @@ Write-Host ''
# --- 1. Arrancar Ollama (Docker) ------------------------------------------- # --- 1. Arrancar Ollama (Docker) -------------------------------------------
Warn '[1/3] Arrancando Ollama (IA local)...' Warn '[1/3] Arrancando Ollama (IA local)...'
cmd /c docker rm -f d0a1-hermes-ollama '>' NUL '2>&1'
$running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-hermes-ollama' $running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-hermes-ollama'
if (-not $running) { if (-not $running) {
docker run -d --name d0a1-hermes-ollama ` docker run -d --name d0a1-hermes-ollama `
@@ -121,17 +122,25 @@ while ($true) {
} }
} }
Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...' Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...'
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false $PullOk = $false
foreach ($Attempt in 1..3) { foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." } if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-hermes-ollama ollama pull llama3.2:3b docker exec @ProxyEnv d0a1-hermes-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break } if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...' Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5 Start-Sleep -Seconds 5
} }
if (-not $PullOk) { if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.' Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:' if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red no llega al registry de Ollama. Si tienes proxy/VPN, lanzalo y:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (ajusta al puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
Write-Host ' O reintenta a mano:'
Write-Host ' docker exec d0a1-hermes-ollama ollama pull llama3.2:3b' Write-Host ' docker exec d0a1-hermes-ollama ollama pull llama3.2:3b'
exit 1 exit 1
} }
+11 -2
View File
@@ -96,6 +96,7 @@ Write-Host ''
# --- 1. Arrancar Ollama (Docker) ------------------------------------------- # --- 1. Arrancar Ollama (Docker) -------------------------------------------
Warn '[1/3] Arrancando Ollama (IA local)...' Warn '[1/3] Arrancando Ollama (IA local)...'
cmd /c docker rm -f d0a1-openclaw-ollama '>' NUL '2>&1'
$running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-openclaw-ollama' $running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-openclaw-ollama'
if (-not $running) { if (-not $running) {
docker run -d --name d0a1-openclaw-ollama ` docker run -d --name d0a1-openclaw-ollama `
@@ -121,17 +122,25 @@ while ($true) {
} }
} }
Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...' Warn ' Descargando modelo (llama3.2:3b, ~2 GB)...'
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false $PullOk = $false
foreach ($Attempt in 1..3) { foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." } if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b docker exec @ProxyEnv d0a1-openclaw-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break } if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...' Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5 Start-Sleep -Seconds 5
} }
if (-not $PullOk) { if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.' Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:' if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red no llega al registry de Ollama. Si tienes proxy/VPN, lanzalo y:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (ajusta al puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
Write-Host ' O reintenta a mano:'
Write-Host ' docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b' Write-Host ' docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b'
exit 1 exit 1
} }
+18 -3
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}"
@@ -112,6 +116,9 @@ if ($WebUiPort -ne 3000) { Warn "Puerto 3000 ocupado, usando $WebUiPort" }
Write-Host '' Write-Host ''
# --- Deploy ---------------------------------------------------------------- # --- Deploy ----------------------------------------------------------------
# Si hay un deploy previo del pack, tumbarlo primero (mantiene los volumenes:
# el modelo ya descargado no se re-descarga) para que los nuevos puertos apliquen.
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
Warn 'Descargando contenedores (2-3 min la primera vez)...' Warn 'Descargando contenedores (2-3 min la primera vez)...'
$env:OLLAMA_PORT = "$OllamaPort" $env:OLLAMA_PORT = "$OllamaPort"
$env:WEBUI_PORT = "$WebUiPort" $env:WEBUI_PORT = "$WebUiPort"
@@ -132,17 +139,25 @@ while ($true) {
exit 1 exit 1
} }
} }
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false $PullOk = $false
foreach ($Attempt in 1..3) { foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." } if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-ollama ollama pull llama3.2:3b docker exec @ProxyEnv d0a1-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break } if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...' Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5 Start-Sleep -Seconds 5
} }
if (-not $PullOk) { if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.' Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:' if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red no llega al registry de Ollama. Si tienes proxy/VPN, lanzalo y:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (ajusta al puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
Write-Host ' O reintenta a mano:'
Write-Host ' docker exec d0a1-ollama ollama pull llama3.2:3b' Write-Host ' docker exec d0a1-ollama ollama pull llama3.2:3b'
exit 1 exit 1
} }
+16 -3
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}"
@@ -150,6 +154,7 @@ Write-Host ''
# --- Deploy ---------------------------------------------------------------- # --- Deploy ----------------------------------------------------------------
Warn 'Descargando contenedores (3-5 min la primera vez)...' Warn 'Descargando contenedores (3-5 min la primera vez)...'
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
$env:OLLAMA_PORT = "$OllamaPort" $env:OLLAMA_PORT = "$OllamaPort"
$env:WP_PORT = "$WpPort" $env:WP_PORT = "$WpPort"
$env:WEBUI_PORT = "$WebUiPort" $env:WEBUI_PORT = "$WebUiPort"
@@ -170,17 +175,25 @@ while ($true) {
exit 1 exit 1
} }
} }
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false $PullOk = $false
foreach ($Attempt in 1..3) { foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." } if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-wp-ollama ollama pull llama3.2:3b docker exec @ProxyEnv d0a1-wp-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break } if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...' Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5 Start-Sleep -Seconds 5
} }
if (-not $PullOk) { if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.' Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:' if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red no llega al registry de Ollama. Si tienes proxy/VPN, lanzalo y:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (ajusta al puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
Write-Host ' O reintenta a mano:'
Write-Host ' docker exec d0a1-wp-ollama ollama pull llama3.2:3b' Write-Host ' docker exec d0a1-wp-ollama ollama pull llama3.2:3b'
exit 1 exit 1
} }