fix(ci): RAG ingestion uses git-cloned workspace instead of deploy dir
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 39s
CI/CD / test-python-backend-compliance (push) Successful in 44s
CI/CD / test-python-document-crawler (push) Successful in 31s
CI/CD / test-python-dsms-gateway (push) Successful in 26s
CI/CD / deploy-hetzner (push) Failing after 2s
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 39s
CI/CD / test-python-backend-compliance (push) Successful in 44s
CI/CD / test-python-document-crawler (push) Successful in 31s
CI/CD / test-python-dsms-gateway (push) Successful in 26s
CI/CD / deploy-hetzner (push) Failing after 2s
The runner container doesn't always have /opt/breakpilot-compliance mounted. Use the git-cloned workspace (current dir) and add multi-fallback for RAG API URL (container network → localhost → host.docker.internal). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -34,24 +34,24 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
PHASE="${{ github.event.inputs.phase }}"
|
PHASE="${{ github.event.inputs.phase }}"
|
||||||
DEPLOY_DIR="/opt/breakpilot-compliance"
|
|
||||||
|
|
||||||
echo "=== RAG Ingestion: Phase ${PHASE} ==="
|
echo "=== RAG Ingestion: Phase ${PHASE} ==="
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Script aus dem Deploy-Dir nutzen (aktuellster Stand nach git pull)
|
# Code wurde im Checkout-Step ins aktuelle Verzeichnis geklont
|
||||||
cd "${DEPLOY_DIR}"
|
# Kein cd noetig — wir sind bereits im Workspace
|
||||||
|
|
||||||
# RAG-Service laeuft im Docker-Netzwerk als bp-core-rag-service
|
|
||||||
# Qdrant ist extern erreichbar
|
|
||||||
export WORK_DIR="/tmp/rag-ingestion"
|
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 QDRANT_URL="https://qdrant-dev.breakpilot.ai"
|
||||||
|
|
||||||
|
# RAG-Service: Versuche Container-Netzwerk, dann Host-Netzwerk
|
||||||
|
export RAG_URL="http://bp-core-rag-service:8097/api/v1/documents/upload"
|
||||||
export SDK_URL="http://bp-compliance-ai-sdk:8090"
|
export SDK_URL="http://bp-compliance-ai-sdk:8090"
|
||||||
|
|
||||||
# Source .env fuer DB_URL falls vorhanden
|
# Source .env aus Deploy-Dir falls vorhanden (fuer DB_URL)
|
||||||
if [ -f .env ]; then
|
DEPLOY_ENV="/opt/breakpilot-compliance/.env"
|
||||||
export DB_URL=$(grep COMPLIANCE_DATABASE_URL .env 2>/dev/null | cut -d= -f2- || echo "")
|
if [ -f "$DEPLOY_ENV" ]; then
|
||||||
|
export DB_URL=$(grep COMPLIANCE_DATABASE_URL "$DEPLOY_ENV" 2>/dev/null | cut -d= -f2- || echo "")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$WORK_DIR"/{pdfs,repos,texts}
|
mkdir -p "$WORK_DIR"/{pdfs,repos,texts}
|
||||||
@@ -59,17 +59,27 @@ jobs:
|
|||||||
echo "RAG API: $RAG_URL"
|
echo "RAG API: $RAG_URL"
|
||||||
echo "Qdrant: $QDRANT_URL"
|
echo "Qdrant: $QDRANT_URL"
|
||||||
echo "Work Dir: $WORK_DIR"
|
echo "Work Dir: $WORK_DIR"
|
||||||
|
echo "PWD: $(pwd)"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Health Check: RAG erreichbar?
|
# Health Check: RAG erreichbar?
|
||||||
# Runner muss im breakpilot-network sein fuer bp-core-rag-service
|
# Runner muss im breakpilot-network sein fuer bp-core-rag-service
|
||||||
# Fallback: Host-Netzwerk via host.docker.internal
|
# Fallback: Host-Netzwerk via localhost (act_runner laeuft auf dem Host)
|
||||||
if ! curl -sf "$RAG_URL" -X POST 2>/dev/null | head -c 100 | grep -q .; then
|
if ! curl -sf "$RAG_URL" -X POST -o /dev/null 2>/dev/null; then
|
||||||
echo "RAG API nicht im Container-Netzwerk erreichbar."
|
echo "RAG API nicht im Container-Netzwerk erreichbar."
|
||||||
echo "Versuche Host-Netzwerk (host.docker.internal)..."
|
echo "Versuche localhost:8097..."
|
||||||
export RAG_URL="http://host.docker.internal:8097/api/v1/documents/upload"
|
export RAG_URL="http://localhost:8097/api/v1/documents/upload"
|
||||||
|
export SDK_URL="http://localhost:8090"
|
||||||
|
if ! curl -sf "$RAG_URL" -X POST -o /dev/null 2>/dev/null; then
|
||||||
|
echo "Versuche host.docker.internal:8097..."
|
||||||
|
export RAG_URL="http://host.docker.internal:8097/api/v1/documents/upload"
|
||||||
|
export SDK_URL="http://host.docker.internal:8090"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Finale RAG URL: $RAG_URL"
|
||||||
|
echo ""
|
||||||
|
|
||||||
if [ "$PHASE" = "all" ]; then
|
if [ "$PHASE" = "all" ]; then
|
||||||
bash scripts/ingest-legal-corpus.sh
|
bash scripts/ingest-legal-corpus.sh
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user