Update ISO installer tiers and backend deployment
This commit is contained in:
1 parent
79784a6743
commit
56668f7bdc
38 files changed
+7206
-175
No files matched your search
@@ -28,7 +28,7 @@
|
||||
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
Environment="OLLAMA_HOST=0.0.0.0:11434"
|
||||
Environment="OLLAMA_MODELS=/opt/cezen/models/ollama"
|
||||
Environment="CUDA_VISIBLE_DEVICES=0,1,2"
|
||||
Environment="CUDA_VISIBLE_DEVICES=0"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -54,50 +54,49 @@
|
||||
port: 11434
|
||||
timeout: 60
|
||||
|
||||
- name: Pull default models (Llama 3.1 8B + Mistral 7B)
|
||||
- name: Select tier model set
|
||||
set_fact:
|
||||
ollama_models: >-
|
||||
{{
|
||||
{
|
||||
'starter': ['phi3:mini', 'nomic-embed-text'],
|
||||
'basic': ['llama3.1:8b', 'mistral:7b', 'nomic-embed-text', 'codellama:13b'],
|
||||
'entry': ['llama3.1:8b', 'mistral:7b', 'nomic-embed-text', 'codellama:13b'],
|
||||
'pro': ['llama3.1:8b', 'mistral:7b', 'nomic-embed-text', 'codellama:13b', 'llama3.1:70b', 'mixtral:8x7b', 'deepseek-coder-v2:16b'],
|
||||
'max': ['llama3.1:8b', 'mistral:7b', 'nomic-embed-text', 'codellama:13b', 'llama3.1:70b', 'mixtral:8x7b', 'deepseek-coder-v2:16b', 'llama3.1:405b', 'mixtral:8x22b']
|
||||
}.get(tier | default('basic'), ['llama3.1:8b', 'mistral:7b', 'nomic-embed-text'])
|
||||
}}
|
||||
|
||||
- name: Pull tier Ollama models
|
||||
become_user: cezen
|
||||
command: ollama pull {{ item }}
|
||||
loop:
|
||||
- llama3.1:8b
|
||||
- mistral:7b
|
||||
loop: "{{ ollama_models }}"
|
||||
environment:
|
||||
OLLAMA_HOST: "http://localhost:11434"
|
||||
retries: 3
|
||||
delay: 15
|
||||
# NOTE: Models are large (~5GB each). This step takes time on first run.
|
||||
# Skip by setting: ansible-playbook ... -e "skip_model_pull=true"
|
||||
# NOTE: Pro/Max models are very large. Skip with --skip-model-pull for
|
||||
# bandwidth-constrained installs, then run models/pull-models.sh later.
|
||||
when: not (skip_model_pull | default(false))
|
||||
|
||||
# Open WebUI (chat interface on top of Ollama)
|
||||
- name: Deploy Open WebUI via Docker
|
||||
community.docker.docker_container:
|
||||
name: open-webui
|
||||
image: ghcr.io/open-webui/open-webui:main
|
||||
state: started
|
||||
restart_policy: always
|
||||
ports:
|
||||
- "3001:8080"
|
||||
volumes:
|
||||
- open-webui:/app/backend/data
|
||||
env:
|
||||
OLLAMA_BASE_URL: "http://host-gateway:11434"
|
||||
etc_hosts:
|
||||
host-gateway: "172.17.0.1"
|
||||
# Note: Requires docker community collection. Install with:
|
||||
# ansible-galaxy collection install community.docker
|
||||
ignore_errors: true # Falls back gracefully if docker collection not available
|
||||
|
||||
- name: Alternative Open WebUI start (if community.docker not available)
|
||||
- name: Start Open WebUI via Docker CLI
|
||||
shell: |
|
||||
docker run -d \
|
||||
--name open-webui \
|
||||
--restart always \
|
||||
-p 3001:8080 \
|
||||
--add-host=host-gateway:172.17.0.1 \
|
||||
-v open-webui:/app/backend/data \
|
||||
-e OLLAMA_BASE_URL=http://host-gateway:11434 \
|
||||
ghcr.io/open-webui/open-webui:main
|
||||
if docker ps -a --format '{{ "{{" }}.Names{{ "}}" }}' | grep -qx open-webui; then
|
||||
docker start open-webui
|
||||
else
|
||||
docker run -d \
|
||||
--name open-webui \
|
||||
--restart always \
|
||||
-p 3001:8080 \
|
||||
--add-host=host-gateway:172.17.0.1 \
|
||||
-v open-webui:/app/backend/data \
|
||||
-e OLLAMA_BASE_URL=http://host-gateway:11434 \
|
||||
ghcr.io/open-webui/open-webui:main
|
||||
fi
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: webui_result
|
||||
failed_when: webui_result.rc != 0 and 'already in use' not in webui_result.stderr
|
||||
changed_when: webui_result.rc == 0
|
||||
failed_when: webui_result.rc != 0 and 'already in use' not in (webui_result.stderr | default(''))
|
||||
ignore_errors: true
|
||||
Reference in new issue
Block a user