feat: Add OpenAPI configuration for API documentation with security scheme feat: Create KnowledgeTreeController for file and video uploads with enhanced metadata handling feat: Define DTOs for agent search requests and responses, including metadata filtering feat: Implement DeleteDocumentResponse DTO for document deletion responses feat: Create KnowledgeSystemNode DTO for representing knowledge tree structure chore: Add startup script for ChromaDB instance with Docker integration
86 lines
2.8 KiB
Bash
Executable File
86 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# ChromaDB Startup Script
|
|
# This script starts a ChromaDB instance using Docker
|
|
|
|
echo "Starting ChromaDB instance..."
|
|
|
|
# Check if Docker is running
|
|
if ! docker info > /dev/null 2>&1; then
|
|
echo "Error: Docker is not running. Please start Docker first."
|
|
exit 1
|
|
fi
|
|
|
|
# ChromaDB configuration
|
|
CHROMA_PORT=8000
|
|
CHROMA_CONTAINER_NAME="chromadb-olympus"
|
|
CHROMA_IMAGE="ghcr.io/chroma-core/chroma:1.3.5"
|
|
CHROMA_DATA_DIR="./chroma-data"
|
|
|
|
# Create data directory if it doesn't exist
|
|
mkdir -p "$CHROMA_DATA_DIR"
|
|
|
|
# Check if container already exists
|
|
if [ "$(docker ps -aq -f name=$CHROMA_CONTAINER_NAME)" ]; then
|
|
echo "ChromaDB container already exists."
|
|
|
|
# Check if it's running
|
|
if [ "$(docker ps -q -f name=$CHROMA_CONTAINER_NAME)" ]; then
|
|
echo "ChromaDB is already running on port $CHROMA_PORT"
|
|
echo "Access it at: http://localhost:$CHROMA_PORT"
|
|
exit 0
|
|
else
|
|
echo "Starting existing ChromaDB container..."
|
|
docker start $CHROMA_CONTAINER_NAME
|
|
fi
|
|
else
|
|
echo "Creating and starting new ChromaDB container..."
|
|
docker run -d \
|
|
--name $CHROMA_CONTAINER_NAME \
|
|
-p $CHROMA_PORT:8000 \
|
|
-v "$(pwd)/$CHROMA_DATA_DIR:/chroma/chroma" \
|
|
$CHROMA_IMAGE
|
|
fi
|
|
|
|
# Wait for ChromaDB to be ready
|
|
echo "Waiting for ChromaDB to be ready..."
|
|
sleep 3
|
|
|
|
# Check if ChromaDB is responding (with timeout)
|
|
if curl -s --max-time 5 http://localhost:$CHROMA_PORT/api/v1/heartbeat > /dev/null 2>&1; then
|
|
echo "✅ ChromaDB is up and running!"
|
|
echo " - URL: http://localhost:$CHROMA_PORT"
|
|
echo " - Data directory: $CHROMA_DATA_DIR"
|
|
echo " - Container name: $CHROMA_CONTAINER_NAME"
|
|
echo ""
|
|
echo "To stop ChromaDB, run: docker stop $CHROMA_CONTAINER_NAME"
|
|
echo "To view logs, run: docker logs -f $CHROMA_CONTAINER_NAME"
|
|
else
|
|
echo "⚠️ ChromaDB container started. Checking if it's ready..."
|
|
# Try without API endpoint - just check if container is running
|
|
if docker ps | grep -q $CHROMA_CONTAINER_NAME; then
|
|
echo "✅ ChromaDB container is running!"
|
|
echo " - URL: http://localhost:$CHROMA_PORT"
|
|
echo " - Data directory: $CHROMA_DATA_DIR"
|
|
echo " - Container name: $CHROMA_CONTAINER_NAME"
|
|
echo " - Note: API may take a few more seconds to be ready"
|
|
echo ""
|
|
echo "To stop ChromaDB, run: docker stop $CHROMA_CONTAINER_NAME"
|
|
echo "To view logs, run: docker logs -f $CHROMA_CONTAINER_NAME"
|
|
else
|
|
echo "❌ ChromaDB container failed to start"
|
|
echo " Check logs with: docker logs $CHROMA_CONTAINER_NAME"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
echo ""
|
|
echo "Update your application.yml with:"
|
|
echo " spring:"
|
|
echo " ai:"
|
|
echo " vectorstore:"
|
|
echo " chroma:"
|
|
echo " client:"
|
|
echo " host: \"http://localhost\""
|
|
echo " port: \"$CHROMA_PORT\""
|