k3s: llama.cpp-Server als Deployments (Task 6.1)
ci / test (push) Failing after 22s

Ein Pod je GPU-VM (Embed+Rerank bzw. Chat), Host-Netz mit den Ports aus dem
Compose, P2000 fest per UUID (NVIDIA_VISIBLE_DEVICES). Das Device Plugin
vergibt nur noch Index 0 (M4000). Rolle gpu-llamacpp: gemeinsame Vorbereitung
(prepare.yml), k3s.yml mit Image-Import und Compose-Stopp; gpu-llamacpp.yml
bricht ohne -e llamacpp_compose=true ab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Robert Rapp
2026-10-19 17:27:23 +02:00
co-authored by Claude Opus 5.5
parent 24f4066aaf
commit 986f1116fe
9 changed files with 278 additions and 37 deletions
@@ -1,11 +1,7 @@
# llama.cpp-Server je Profil (Task 6.1). Idempotent: Modelle per Prüfsumme, Image nur bauen, wenn es fehlt
# (Image-Tag enthält Stand und CUDA-Version), compose ändert nur, was sich geändert hat.
- name: Profile prüfen
ansible.builtin.assert:
that:
- llamacpp_profiles | length > 0
- llamacpp_profiles | difference(llamacpp_services.keys() | list) | length == 0
fail_msg: "llamacpp_profiles muss aus {{ llamacpp_services.keys() | list }} bestehen (Inventar, Gruppe gpu_llamacpp)"
- name: Profile, Karten, Modelle
ansible.builtin.include_tasks: prepare.yml
# Compose baut nur mit buildx (BuildKit, auch für den Git-Kontext mit Commit-Pin)
- name: docker-buildx installieren
@@ -13,37 +9,6 @@
name: docker-buildx
state: present
# --- Kartenwahl: UUID statt Index, geprüft über den Kartennamen ---
- name: Karten in der VM lesen
ansible.builtin.command: nvidia-smi --query-gpu=index,uuid,name --format=csv,noheader
register: llamacpp_smi
changed_when: false
- name: UUID je Dienst aus dem Kartennamen bestimmen
ansible.builtin.set_fact:
llamacpp_gpu_env: >-
{{ llamacpp_gpu_env | default({}) | combine({item.key: (llamacpp_smi.stdout_lines
| map('split', ', ') | selectattr(2, 'equalto', item.value) | map(attribute=1) | first | default(''))}) }}
loop: "{{ llamacpp_cards | dict2items }}"
- name: Jede gewünschte Karte ist vorhanden
ansible.builtin.assert:
that: llamacpp_gpu_env[item.key] is match('GPU-')
fail_msg: "{{ item.value }} für {{ item.key }} nicht gefunden: {{ llamacpp_smi.stdout_lines }}"
loop: "{{ llamacpp_cards | dict2items }}"
# --- Modelle ---
- name: Modelle laden (Prüfsumme gegen Hugging Face)
ansible.builtin.get_url:
url: "{{ item.url }}"
dest: "{{ llamacpp_models_dir }}/{{ item.dest }}"
checksum: "{{ item.checksum }}"
mode: "0644"
timeout: 120
loop: "{{ llamacpp_profiles | map('extract', llamacpp_models) | flatten }}"
loop_control:
label: "{{ item.dest }}"
# --- Compose-Projekt ---
- name: Projektverzeichnis
ansible.builtin.file: