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 47s
CI/CD / test-python-backend-compliance (push) Successful in 47s
CI/CD / test-python-document-crawler (push) Successful in 30s
CI/CD / test-python-dsms-gateway (push) Successful in 25s
CI/CD / deploy-hetzner (push) Failing after 2s
Runner needs access to /opt/breakpilot-compliance and Docker network for RAG service (bp-core-rag-service:8097). Falls back to host.docker.internal if container network unavailable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
81 lines
2.7 KiB
YAML
81 lines
2.7 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.
|
|
|
|
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 python3 > /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 ""
|
|
|
|
# Script aus dem Deploy-Dir nutzen (aktuellster Stand nach git pull)
|
|
cd "${DEPLOY_DIR}"
|
|
|
|
# RAG-Service laeuft im Docker-Netzwerk als bp-core-rag-service
|
|
# Qdrant ist extern erreichbar
|
|
export WORK_DIR="/tmp/rag-ingestion"
|
|
export RAG_URL="http://bp-core-rag-service:8097/api/v1/documents/upload"
|
|
export QDRANT_URL="https://qdrant-dev.breakpilot.ai"
|
|
export SDK_URL="http://bp-compliance-ai-sdk:8090"
|
|
|
|
# Source .env fuer DB_URL falls vorhanden
|
|
if [ -f .env ]; then
|
|
export DB_URL=$(grep COMPLIANCE_DATABASE_URL .env 2>/dev/null | cut -d= -f2- || echo "")
|
|
fi
|
|
|
|
mkdir -p "$WORK_DIR"/{pdfs,repos,texts}
|
|
|
|
echo "RAG API: $RAG_URL"
|
|
echo "Qdrant: $QDRANT_URL"
|
|
echo "Work Dir: $WORK_DIR"
|
|
echo ""
|
|
|
|
# Health Check: RAG erreichbar?
|
|
# Runner muss im breakpilot-network sein fuer bp-core-rag-service
|
|
# Fallback: Host-Netzwerk via host.docker.internal
|
|
if ! curl -sf "$RAG_URL" -X POST 2>/dev/null | head -c 100 | grep -q .; then
|
|
echo "RAG API nicht im Container-Netzwerk erreichbar."
|
|
echo "Versuche Host-Netzwerk (host.docker.internal)..."
|
|
export RAG_URL="http://host.docker.internal:8097/api/v1/documents/upload"
|
|
fi
|
|
|
|
if [ "$PHASE" = "all" ]; then
|
|
bash scripts/ingest-legal-corpus.sh
|
|
else
|
|
bash scripts/ingest-legal-corpus.sh --only "$PHASE"
|
|
fi
|
|
|
|
echo ""
|
|
echo "=== Ingestion abgeschlossen ==="
|