Compare commits

..
Author SHA1 Message Date
hermes 04e990eb5e feat: down/rm de runs previos antes del up
- openwebui/wordpress: docker compose down antes del up para que los
  puertos nuevos apliquen (volumenes preservados: el modelo no se
  re-descarga). Sin comillas anidadas en cmd /c (tokens separados,
  stderr descartado de forma segura con EAP=Stop).
- hermes/openclaw: docker rm -f del contenedor previo antes del run
  (un contenedor parado de un run anterior causaba Conflict).
2026-09-12 20:55:28 +02:00
4 changed files with 16 additions and 96 deletions

No files matched your search

+4 -24
View File
@@ -122,40 +122,20 @@ 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 @ProxyEnv d0a1-hermes-ollama ollama pull llama3.2:3b docker exec 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) {
# --- Fallback: mismo modelo via HuggingFace (otro CDN, no el registry de Ollama) --- Err 'Fallo la descarga del modelo tras 3 intentos.'
Warn 'Registry de Ollama no accesible. Probando via HuggingFace (mismo modelo)...' Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf' Write-Host ' docker exec d0a1-hermes-ollama ollama pull llama3.2:3b'
curl.exe -L -# --retry 3 --max-time 1800 -o "$Gguf" 'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
if ($LASTEXITCODE -eq 0 -and (Get-Item $Gguf).Length -gt 1900000000) {
docker cp "$Gguf" d0a1-hermes-ollama:/root/.ollama/import.gguf
docker exec d0a1-hermes-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-hermes-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($CreateOk) { $PullOk = $true }
else { Err 'Fallo al importar el modelo desde el GGUF.' }
} else {
Err 'No se pudo descargar el modelo (ni registry ni HuggingFace).'
if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
exit 1 exit 1
} }
}
Ok "Ollama corriendo en http://localhost:${OllamaPort}" Ok "Ollama corriendo en http://localhost:${OllamaPort}"
# --- 2. Instalar Hermes Agent ------------------------------------------------ # --- 2. Instalar Hermes Agent ------------------------------------------------
+4 -24
View File
@@ -122,40 +122,20 @@ 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 @ProxyEnv d0a1-openclaw-ollama ollama pull llama3.2:3b docker exec 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) {
# --- Fallback: mismo modelo via HuggingFace (otro CDN, no el registry de Ollama) --- Err 'Fallo la descarga del modelo tras 3 intentos.'
Warn 'Registry de Ollama no accesible. Probando via HuggingFace (mismo modelo)...' Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf' Write-Host ' docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b'
curl.exe -L -# --retry 3 --max-time 1800 -o "$Gguf" 'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
if ($LASTEXITCODE -eq 0 -and (Get-Item $Gguf).Length -gt 1900000000) {
docker cp "$Gguf" d0a1-openclaw-ollama:/root/.ollama/import.gguf
docker exec d0a1-openclaw-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-openclaw-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($CreateOk) { $PullOk = $true }
else { Err 'Fallo al importar el modelo desde el GGUF.' }
} else {
Err 'No se pudo descargar el modelo (ni registry ni HuggingFace).'
if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
exit 1 exit 1
} }
}
Ok "Ollama corriendo en http://localhost:${OllamaPort}" Ok "Ollama corriendo en http://localhost:${OllamaPort}"
# --- 2. Instalar OpenClaw ----------------------------------------------------- # --- 2. Instalar OpenClaw -----------------------------------------------------
+4 -24
View File
@@ -139,40 +139,20 @@ 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 @ProxyEnv d0a1-ollama ollama pull llama3.2:3b docker exec 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) {
# --- Fallback: mismo modelo via HuggingFace (otro CDN, no el registry de Ollama) --- Err 'Fallo la descarga del modelo tras 3 intentos.'
Warn 'Registry de Ollama no accesible. Probando via HuggingFace (mismo modelo)...' Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf' Write-Host ' docker exec d0a1-ollama ollama pull llama3.2:3b'
curl.exe -L -# --retry 3 --max-time 1800 -o "$Gguf" 'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
if ($LASTEXITCODE -eq 0 -and (Get-Item $Gguf).Length -gt 1900000000) {
docker cp "$Gguf" d0a1-ollama:/root/.ollama/import.gguf
docker exec d0a1-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($CreateOk) { $PullOk = $true }
else { Err 'Fallo al importar el modelo desde el GGUF.' }
} else {
Err 'No se pudo descargar el modelo (ni registry ni HuggingFace).'
if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
exit 1 exit 1
} }
}
# --- Done ------------------------------------------------------------------- # --- Done -------------------------------------------------------------------
Write-Host '' Write-Host ''
+4 -24
View File
@@ -175,40 +175,20 @@ 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 @ProxyEnv d0a1-wp-ollama ollama pull llama3.2:3b docker exec 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) {
# --- Fallback: mismo modelo via HuggingFace (otro CDN, no el registry de Ollama) --- Err 'Fallo la descarga del modelo tras 3 intentos.'
Warn 'Registry de Ollama no accesible. Probando via HuggingFace (mismo modelo)...' Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
$Gguf = Join-Path $ScriptDir 'llama3.2-3b-q4.gguf' Write-Host ' docker exec d0a1-wp-ollama ollama pull llama3.2:3b'
curl.exe -L -# --retry 3 --max-time 1800 -o "$Gguf" 'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
if ($LASTEXITCODE -eq 0 -and (Get-Item $Gguf).Length -gt 1900000000) {
docker cp "$Gguf" d0a1-wp-ollama:/root/.ollama/import.gguf
docker exec d0a1-wp-ollama sh -c 'echo FROM /root/.ollama/import.gguf > /tmp/mf && ollama create llama3.2:3b -f /tmp/mf'
$CreateOk = ($LASTEXITCODE -eq 0)
docker exec d0a1-wp-ollama rm -f /root/.ollama/import.gguf | Out-Null
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
if ($CreateOk) { $PullOk = $true }
else { Err 'Fallo al importar el modelo desde el GGUF.' }
} else {
Err 'No se pudo descargar el modelo (ni registry ni HuggingFace).'
if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red bloquea ambos. Si tienes proxy/VPN:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
exit 1 exit 1
} }
}
# --- Done ------------------------------------------------------------------- # --- Done -------------------------------------------------------------------
Write-Host '' Write-Host ''