Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf6ba1d32b | ||
|
|
938ca2b268 | ||
|
|
6e311050e5 | ||
|
|
ebc420656a |
No files matched your search
+7
-5
@@ -80,6 +80,9 @@ if ($TotalRamGb -lt 3.5) {
|
||||
}
|
||||
Ok "RAM: $TotalRamGb GB"
|
||||
|
||||
# --- Tumbar deploy previo (antes de detectar puertos) -----------------------
|
||||
cmd /c docker rm -f d0a1-hermes-ollama '>' NUL '2>&1'
|
||||
|
||||
# --- Auto-detect Ollama port ------------------------------------------------
|
||||
$OllamaPort = Find-FreePort 11434
|
||||
|
||||
@@ -96,10 +99,9 @@ Write-Host ''
|
||||
|
||||
# --- 1. Arrancar Ollama (Docker) -------------------------------------------
|
||||
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'
|
||||
if (-not $running) {
|
||||
docker run -d --name d0a1-hermes-ollama `
|
||||
docker run -d --name d0a1-hermes-ollama --memory 6g `
|
||||
-p "${OllamaPort}:11434" `
|
||||
-v d0a1_hermes_ollama:/root/.ollama `
|
||||
-e OLLAMA_HOST=0.0.0.0 `
|
||||
@@ -131,12 +133,12 @@ $HfUrls = @(
|
||||
'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf',
|
||||
'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
|
||||
)
|
||||
foreach ($Url in $HfUrls) {
|
||||
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
|
||||
curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url
|
||||
foreach ($Url in $HfUrls) {
|
||||
curl.exe -# -L --retry 3 --max-time 1800 -o "$Gguf" $Url
|
||||
if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
|
||||
Warn "Mirror no accesible, probando el siguiente..."
|
||||
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
|
||||
if ($Url -ne $HfUrls[-1]) { Warn 'Mirror no accesible, probando el siguiente...' }
|
||||
}
|
||||
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
|
||||
Info 'Importando modelo en Ollama...'
|
||||
|
||||
+7
-5
@@ -80,6 +80,9 @@ if ($TotalRamGb -lt 3.5) {
|
||||
}
|
||||
Ok "RAM: $TotalRamGb GB"
|
||||
|
||||
# --- Tumbar deploy previo (antes de detectar puertos) -----------------------
|
||||
cmd /c docker rm -f d0a1-openclaw-ollama '>' NUL '2>&1'
|
||||
|
||||
# --- Auto-detect Ollama port ------------------------------------------------
|
||||
$OllamaPort = Find-FreePort 11434
|
||||
|
||||
@@ -96,10 +99,9 @@ Write-Host ''
|
||||
|
||||
# --- 1. Arrancar Ollama (Docker) -------------------------------------------
|
||||
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'
|
||||
if (-not $running) {
|
||||
docker run -d --name d0a1-openclaw-ollama `
|
||||
docker run -d --name d0a1-openclaw-ollama --memory 6g `
|
||||
-p "${OllamaPort}:11434" `
|
||||
-v d0a1_openclaw_ollama:/root/.ollama `
|
||||
-e OLLAMA_HOST=0.0.0.0 `
|
||||
@@ -131,12 +133,12 @@ $HfUrls = @(
|
||||
'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf',
|
||||
'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
|
||||
)
|
||||
foreach ($Url in $HfUrls) {
|
||||
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
|
||||
curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url
|
||||
foreach ($Url in $HfUrls) {
|
||||
curl.exe -# -L --retry 3 --max-time 1800 -o "$Gguf" $Url
|
||||
if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
|
||||
Warn "Mirror no accesible, probando el siguiente..."
|
||||
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
|
||||
if ($Url -ne $HfUrls[-1]) { Warn 'Mirror no accesible, probando el siguiente...' }
|
||||
}
|
||||
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
|
||||
Info 'Importando modelo en Ollama...'
|
||||
|
||||
@@ -86,6 +86,11 @@ if ($TotalRamGb -lt 3.5) {
|
||||
}
|
||||
Ok "RAM: $TotalRamGb GB"
|
||||
|
||||
# --- Tumbar deploy previo (antes de detectar puertos) ----------------------
|
||||
# Mantiene los volumenes (el modelo ya descargado no se re-descarga) y libera
|
||||
# los puertos para que Find-FreePort vea el estado REAL tras el down.
|
||||
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
|
||||
|
||||
# --- Auto-detect ports ----------------------------------------------------
|
||||
$OllamaPort = Find-FreePort 11434
|
||||
$WebUiPort = Find-FreePort 3000
|
||||
@@ -116,9 +121,6 @@ if ($WebUiPort -ne 3000) { Warn "Puerto 3000 ocupado, usando $WebUiPort" }
|
||||
Write-Host ''
|
||||
|
||||
# --- 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)...'
|
||||
$env:OLLAMA_PORT = "$OllamaPort"
|
||||
$env:WEBUI_PORT = "$WebUiPort"
|
||||
@@ -126,7 +128,7 @@ docker compose -f $ComposeFile up -d
|
||||
if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE)."; exit 1 }
|
||||
|
||||
# --- Pull model -------------------------------------------------------------
|
||||
Warn 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
|
||||
Info 'Esperando a que Ollama arranque...'
|
||||
$MaxWait = 60; $Waited = 0
|
||||
while ($true) {
|
||||
# Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
|
||||
@@ -148,12 +150,12 @@ $HfUrls = @(
|
||||
'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf',
|
||||
'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
|
||||
)
|
||||
foreach ($Url in $HfUrls) {
|
||||
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
|
||||
curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url
|
||||
foreach ($Url in $HfUrls) {
|
||||
curl.exe -# -L --retry 3 --max-time 1800 -o "$Gguf" $Url
|
||||
if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
|
||||
Warn "Mirror no accesible, probando el siguiente..."
|
||||
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
|
||||
if ($Url -ne $HfUrls[-1]) { Warn 'Mirror no accesible, probando el siguiente...' }
|
||||
}
|
||||
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
|
||||
Info 'Importando modelo en Ollama...'
|
||||
|
||||
@@ -26,6 +26,10 @@ services:
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 6G
|
||||
|
||||
openwebui:
|
||||
container_name: d0a1-openwebui
|
||||
|
||||
@@ -120,6 +120,9 @@ if (-not (Test-Path $EnvFile)) {
|
||||
}
|
||||
|
||||
# --- Auto-detect ports ----------------------------------------------------
|
||||
# --- Tumbar deploy previo (antes de detectar puertos) ----------------------
|
||||
cmd /c docker compose -f $ComposeFile down '>' NUL '2>&1'
|
||||
|
||||
$OllamaPort = Find-FreePort 11434
|
||||
$WpPort = Find-FreePort 8080
|
||||
$WebUiPort = Find-FreePort 3000
|
||||
@@ -162,7 +165,7 @@ docker compose -f $ComposeFile up -d
|
||||
if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE)."; exit 1 }
|
||||
|
||||
# --- Pull model -------------------------------------------------------------
|
||||
Warn 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
|
||||
Info 'Esperando a que Ollama arranque...'
|
||||
$MaxWait = 60; $Waited = 0
|
||||
while ($true) {
|
||||
# Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
|
||||
@@ -184,12 +187,12 @@ $HfUrls = @(
|
||||
'https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf',
|
||||
'https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q4_K_M.gguf'
|
||||
)
|
||||
foreach ($Url in $HfUrls) {
|
||||
Info 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
|
||||
curl.exe -sL --retry 3 --max-time 1800 -o "$Gguf" $Url
|
||||
foreach ($Url in $HfUrls) {
|
||||
curl.exe -# -L --retry 3 --max-time 1800 -o "$Gguf" $Url
|
||||
if ($LASTEXITCODE -eq 0 -and (Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) { break }
|
||||
Warn "Mirror no accesible, probando el siguiente..."
|
||||
Remove-Item "$Gguf" -Force -ErrorAction SilentlyContinue
|
||||
if ($Url -ne $HfUrls[-1]) { Warn 'Mirror no accesible, probando el siguiente...' }
|
||||
}
|
||||
if ((Test-Path $Gguf) -and (Get-Item $Gguf).Length -gt 1900000000) {
|
||||
Info 'Importando modelo en Ollama...'
|
||||
|
||||
@@ -59,6 +59,10 @@ services:
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 6G
|
||||
|
||||
openwebui:
|
||||
container_name: d0a1-wp-openwebui
|
||||
|
||||
Reference in new issue
Block a user