agAdvisor / setup_qdrant_docker.sh
tirtho149's picture
Deploy AgAdvisor
b30f068 verified
Raw
History Blame Contribute Delete
2.02 kB
#!/bin/bash
# Qdrant Docker Setup Script
echo "πŸš€ Setting up Qdrant with Docker..."
echo ""
# Check if Qdrant container already exists
if docker ps -a | grep -q qdrant; then
echo "πŸ“¦ Qdrant container found"
# Check if it's running
if docker ps | grep -q qdrant; then
echo "βœ… Qdrant is already running!"
echo ""
echo "πŸ“ Qdrant Dashboard: http://localhost:6333/dashboard"
echo "πŸ“ Qdrant API: http://localhost:6333"
else
echo "⚠️ Container exists but not running. Starting it..."
docker start qdrant
sleep 2
echo "βœ… Qdrant started!"
echo ""
echo "πŸ“ Qdrant Dashboard: http://localhost:6333/dashboard"
echo "πŸ“ Qdrant API: http://localhost:6333"
fi
else
echo "πŸ“¦ Creating new Qdrant container..."
# Run Qdrant container
docker run -d \
--name qdrant \
-p 6333:6333 \
-p 6334:6334 \
-v $(pwd)/qdrant_storage:/qdrant/storage \
qdrant/qdrant
echo ""
echo "⏳ Waiting for Qdrant to start..."
sleep 3
# Check if container is running
if docker ps | grep -q qdrant; then
echo "βœ… Qdrant is running!"
echo ""
echo "πŸ“ Qdrant Dashboard: http://localhost:6333/dashboard"
echo "πŸ“ Qdrant API: http://localhost:6333"
echo ""
echo "πŸ’Ύ Storage: ./qdrant_storage (persistent)"
else
echo "❌ Failed to start Qdrant. Check Docker logs:"
docker logs qdrant
fi
fi
echo ""
echo "πŸ§ͺ Testing connection..."
python3 -c "
from qdrant_client import QdrantClient
try:
client = QdrantClient(host='localhost', port=6333)
collections = client.get_collections().collections
print(f'βœ… Connection successful!')
print(f'πŸ“¦ Collections: {len(collections)}')
for coll in collections:
print(f' - {coll.name}')
except Exception as e:
print(f'❌ Connection failed: {e}')
"
echo ""
echo "βœ… Setup complete!"