Some checks failed
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 37s
CI/CD / test-python-backend-compliance (push) Successful in 36s
CI/CD / test-python-document-crawler (push) Successful in 23s
CI/CD / test-python-dsms-gateway (push) Successful in 21s
CI/CD / deploy-hetzner (push) Failing after 7s
Problems fixed: 1. Deploy step couldn't access /opt/breakpilot-compliance (host path not mounted in runner container). Now uses alpine/git helper container with host bind-mount for git ops, then docker compose with host paths. 2. breakpilot-network was external:true but Core doesn't run on Hetzner. Override in hetzner.yml creates the network automatically. 3. core-health-check blocks startup waiting for Core. Override in hetzner.yml makes it exit immediately. 4. RAG ingestion script now respects RAG_URL/QDRANT_URL env vars. 5. RAG workflow discovers network dynamically from running containers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
93 lines
3.4 KiB
YAML
93 lines
3.4 KiB
YAML
# Gitea Actions — RAG Legal Corpus Ingestion
|
|
#
|
|
# Manuell triggerbarer Workflow zur Ingestion von Rechtstexten in Qdrant.
|
|
# Trigger: Gitea UI → Actions → "RAG Ingestion" → Run
|
|
#
|
|
# Phasen: gesetze, eu, templates, datenschutz, verbraucherschutz, verify, version, all
|
|
#
|
|
# Voraussetzung: RAG-Service und Qdrant muessen auf Hetzner laufen.
|
|
# Die BreakPilot-Services muessen deployed sein (ci.yaml deploy-hetzner).
|
|
|
|
name: RAG Ingestion
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
phase:
|
|
description: 'Ingestion Phase (gesetze, eu, templates, datenschutz, verbraucherschutz, verify, version, all)'
|
|
required: true
|
|
default: 'verbraucherschutz'
|
|
|
|
jobs:
|
|
ingest:
|
|
runs-on: docker
|
|
container: docker:27-cli
|
|
steps:
|
|
- name: Setup
|
|
run: |
|
|
apk add --no-cache git curl bash > /dev/null 2>&1
|
|
|
|
- name: Checkout
|
|
run: |
|
|
git clone --depth 1 --branch main ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git .
|
|
|
|
- name: Run Ingestion
|
|
run: |
|
|
set -euo pipefail
|
|
PHASE="${{ github.event.inputs.phase }}"
|
|
DEPLOY_DIR="/opt/breakpilot-compliance"
|
|
|
|
echo "=== RAG Ingestion: Phase ${PHASE} ==="
|
|
echo ""
|
|
|
|
# Pruefen ob Services laufen
|
|
echo "--- BreakPilot Container ---"
|
|
docker ps --filter name=bp- --format "{{.Names}}: {{.Status}}" 2>/dev/null || true
|
|
echo ""
|
|
|
|
# Netzwerk finden in dem die bp-Services laufen
|
|
BP_NETWORK=$(docker inspect bp-core-rag-service --format '{{range $k,$v := .NetworkSettings.Networks}}{{$k}}{{end}}' 2>/dev/null || echo "")
|
|
if [ -z "$BP_NETWORK" ]; then
|
|
# Fallback: Netzwerk vom Compliance-Backend nehmen
|
|
BP_NETWORK=$(docker inspect bp-compliance-backend --format '{{range $k,$v := .NetworkSettings.Networks}}{{$k}}{{end}}' 2>/dev/null || echo "")
|
|
fi
|
|
|
|
if [ -z "$BP_NETWORK" ]; then
|
|
echo "FEHLER: Keine BreakPilot-Container gefunden."
|
|
echo "Bitte zuerst deployen (CI/CD Pipeline oder manuell)."
|
|
echo ""
|
|
echo "Verfuegbare Container:"
|
|
docker ps --format " {{.Names}}" 2>/dev/null || true
|
|
echo ""
|
|
echo "Verfuegbare Netzwerke:"
|
|
docker network ls --format " {{.Name}}" 2>/dev/null || true
|
|
exit 1
|
|
fi
|
|
|
|
echo "BreakPilot Netzwerk: $BP_NETWORK"
|
|
echo ""
|
|
|
|
# Ingestion in einem Container auf dem BP-Netzwerk ausfuehren,
|
|
# mit Zugriff auf die Scripts aus dem Deploy-Dir
|
|
docker run --rm \
|
|
--network "$BP_NETWORK" \
|
|
-v "${DEPLOY_DIR}/scripts:/workspace/scripts:ro" \
|
|
-e "WORK_DIR=/tmp/rag-ingestion" \
|
|
-e "RAG_URL=http://bp-core-rag-service:8097/api/v1/documents/upload" \
|
|
-e "QDRANT_URL=https://qdrant-dev.breakpilot.ai" \
|
|
-e "SDK_URL=http://bp-compliance-ai-sdk:8090" \
|
|
alpine:3.19 \
|
|
sh -c "
|
|
apk add --no-cache curl bash coreutils > /dev/null 2>&1
|
|
mkdir -p /tmp/rag-ingestion/{pdfs,repos,texts}
|
|
cd /workspace
|
|
if [ '${PHASE}' = 'all' ]; then
|
|
bash scripts/ingest-legal-corpus.sh
|
|
else
|
|
bash scripts/ingest-legal-corpus.sh --only '${PHASE}'
|
|
fi
|
|
"
|
|
|
|
echo ""
|
|
echo "=== Ingestion abgeschlossen ==="
|