Run the containers with the systemd configuration, 1:1

The containers now read the unchanged .env of the matching systemd instance
(/home/llmadmin/mindnet_dev/.env, /home/llmadmin/mindnet/.env) and use the
same Qdrant, Ollama, vault and collection prefix, so both can be compared
side by side. Only container-specific values are overridden: host service
addresses (host.docker.internal instead of 127.0.0.1) and the read-only vault.

- deploy/appenv.py derives the vault mount and prefix from that .env and
  rejects application keys in the container-only file.
- Remove the separate dev Qdrant, the synthetic test vault and the import step.
- UI binds 0.0.0.0 like systemd; API stays loopback by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-10-28 17:22:08 +01:00
1 parent eae30775e3
commit 6cdad8b046
20 files changed
+373 -415

No files matched your search

+13 -25
View File
@@ -1,6 +1,6 @@
# Mindnet DEV als Container: jeder Push auf develop baut und startet den Dev-Stack
# auf dem Runner-Host (Muster wie Kansho). Läuft parallel zu systemd; Prod-Qdrant,
# Prod-Vault und die systemd-Dienste werden nicht angefasst.
# auf dem Runner-Host (Muster wie Kansho). Gleiche Konfiguration wie die systemd-
# Dev-Instanz (8002/8502), parallel auf 8012/8512. systemd und Prod bleiben unberührt.
# Ablauf und Abbruchbedingungen: deploy/deploy.sh. Prod-Gegenstück (noch inaktiv):
# deploy/gitea-workflows/deploy-prod.yml.
@@ -18,11 +18,13 @@ concurrency:
jobs:
deploy:
# Runner auf dem Zielhost (heute llm-node). Bei einem Umzug auf einen anderen
# Mini-PC nur das Label und den Pfad der env-Datei anpassen.
# Mini-PC nur das Label und die beiden Pfade anpassen.
runs-on: linux_host
env:
# Liegt auf dem Host, außerhalb von Git (Vorlage: deploy/env/dev.env.example).
MINDNET_ENV_FILE: /home/llmadmin/docker/mindnet-dev/dev.env
# Unveränderte Konfiguration der systemd-Dev-Instanz.
MINDNET_APP_ENV_FILE: /home/llmadmin/mindnet_dev/.env
# Nur Container-Angaben (Vorlage: deploy/env/dev.env.example).
MINDNET_ENV_FILE: /home/llmadmin/docker/mindnet-dev/container.env
steps:
# Ohne actions/checkout: kein Abruf von github.com (DNS/Internet auf dem Host
# nicht nötig). Holt genau den Commit des Pushes vom eigenen Gitea, mit Job-Token.
@@ -30,36 +32,22 @@ jobs:
run: |
set -euo pipefail
git init -q .
git -c http.extraHeader="Authorization: token ${{ github.token }}" fetch -q --depth 1 "${{ github.server_url }}/${{ github.repository }}.git" "${{ github.sha }}"
git -c http.extraHeader="Authorization: token ${{ github.token }}" \
fetch -q --depth 1 "${{ github.server_url }}/${{ github.repository }}.git" "${{ github.sha }}"
git checkout -q --force FETCH_HEAD
git clean -q -ffdx
git log -1 --format='Checkout %H %s'
- name: Host vorbereiten (synthetischer Test-Vault, dev.env beim ersten Lauf)
- name: Container-Datei beim ersten Lauf anlegen
run: |
set -euo pipefail
HOST_DIR="$(dirname "$MINDNET_ENV_FILE")"
install -d -m 0750 "$HOST_DIR"
install -d -m 0755 "$HOST_DIR/testvault"
# Nur synthetische Daten aus dem Repo; für UID 10001 im Container lesbar.
rsync -a --delete --chmod=D755,F644 deploy/testvault/ "$HOST_DIR/testvault/"
install -d -m 0750 "$(dirname "$MINDNET_ENV_FILE")"
if [ ! -f "$MINDNET_ENV_FILE" ]; then
sed "s#^MINDNET_VAULT_HOST_PATH=.*#MINDNET_VAULT_HOST_PATH=$HOST_DIR/testvault#" \
deploy/env/dev.env.example > "$MINDNET_ENV_FILE"
chmod 600 "$MINDNET_ENV_FILE"
echo "dev.env aus Vorlage angelegt: $MINDNET_ENV_FILE"
install -m 0600 deploy/env/dev.env.example "$MINDNET_ENV_FILE"
echo "Container-Datei aus Vorlage angelegt: $MINDNET_ENV_FILE"
fi
docker version --format 'Docker {{.Server.Version}}'
docker compose version
- name: Test, Build, Preflight, Start, Smoke
run: bash deploy/deploy.sh dev
- name: Test-Vault importieren (nur Dev, synthetisch, hash-idempotent) und Smoke mit Daten
run: |
set -euo pipefail
export MINDNET_IMAGE_TAG="dev-$(git rev-parse --short=12 HEAD)"
dc() { docker compose -f deploy/compose.dev.yml --env-file "$MINDNET_ENV_FILE" "$@"; }
dc run --rm --entrypoint python api -m scripts.import_markdown --vault /vault --prefix mindnet_dev --apply
python3 deploy/smoke.py --api "http://$(dc port api 8000)" --ui "http://$(dc port ui 8501 | head -n 1)" \
--prefix mindnet_dev --require-data