Add comprehensive Docker setup with PostgreSQL, Redis, ChromaDB, and Qdrant
- Enhanced install.py with Docker detection and automatic service setup - Added docker-compose.services.yml for standalone database services - Created docker-services.sh management script for easy service control - Added DOCKER.md documentation with complete setup instructions - Updated requirements.txt for Python 3.13 compatibility - Added multiple test scripts and configuration files - Enhanced collaborative creative projects with proper database integration - Fixed SQLAlchemy metadata field conflicts in database models - Added comprehensive quickstart and testing guides Services now available: - PostgreSQL with Docker - Redis with Docker - ChromaDB vector database - Qdrant vector database (recommended) - PgAdmin for database administration The setup script now automatically detects Docker and offers streamlined installation with one-command service deployment.
This commit is contained in:
126
setup_test.py
Normal file
126
setup_test.py
Normal file
@@ -0,0 +1,126 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Quick setup script for testing Discord Fishbowl
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
def run_command(command, check=True):
|
||||
"""Run a command and return the result"""
|
||||
print(f"Running: {command}")
|
||||
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
||||
if check and result.returncode != 0:
|
||||
print(f"Error: {result.stderr}")
|
||||
return False
|
||||
return True
|
||||
|
||||
def main():
|
||||
print("🐠 Discord Fishbowl Quick Test Setup")
|
||||
print("=" * 50)
|
||||
|
||||
# Install dependencies
|
||||
print("\n📦 Installing dependencies...")
|
||||
if not run_command("pip install -r requirements.txt"):
|
||||
print("❌ Failed to install dependencies")
|
||||
return False
|
||||
|
||||
print("✅ Dependencies installed")
|
||||
|
||||
# Create config directory
|
||||
config_dir = Path("config")
|
||||
config_dir.mkdir(exist_ok=True)
|
||||
|
||||
# Create basic config for testing
|
||||
config = {
|
||||
"database": {
|
||||
"url": "sqlite+aiosqlite:///fishbowl_test.db",
|
||||
"echo": False
|
||||
},
|
||||
"llm": {
|
||||
"provider": "ollama",
|
||||
"base_url": "http://localhost:11434",
|
||||
"model": "llama2",
|
||||
"max_tokens": 300,
|
||||
"temperature": 0.8,
|
||||
"timeout": 30
|
||||
},
|
||||
"discord": {
|
||||
"token": "your_discord_token_here",
|
||||
"application_id": "your_app_id_here",
|
||||
"guild_id": "your_guild_id_here"
|
||||
},
|
||||
"conversation": {
|
||||
"min_delay_seconds": 30,
|
||||
"max_delay_seconds": 180,
|
||||
"max_conversation_length": 20,
|
||||
"quiet_hours_start": 23,
|
||||
"quiet_hours_end": 7
|
||||
},
|
||||
"admin": {
|
||||
"host": "localhost",
|
||||
"port": 8000,
|
||||
"secret_key": "test-secret-key",
|
||||
"cors_origins": ["http://localhost:3000"]
|
||||
},
|
||||
"vector_store": {
|
||||
"storage_path": "./data/vector_stores",
|
||||
"collection_name": "fishbowl_memories"
|
||||
}
|
||||
}
|
||||
|
||||
config_file = config_dir / "fishbowl_config.json"
|
||||
with open(config_file, 'w') as f:
|
||||
json.dump(config, f, indent=2)
|
||||
|
||||
print(f"✅ Config created at {config_file}")
|
||||
|
||||
# Create .env file
|
||||
env_content = """# Discord Fishbowl Environment Variables
|
||||
ENVIRONMENT=development
|
||||
LOG_LEVEL=INFO
|
||||
DATABASE_URL=sqlite+aiosqlite:///fishbowl_test.db
|
||||
SECRET_KEY=test-secret-key
|
||||
|
||||
# LLM Configuration
|
||||
LLM_PROVIDER=ollama
|
||||
LLM_BASE_URL=http://localhost:11434
|
||||
LLM_MODEL=llama2
|
||||
|
||||
# Discord (replace with your actual tokens)
|
||||
DISCORD_TOKEN=your_discord_token_here
|
||||
DISCORD_APPLICATION_ID=your_app_id_here
|
||||
DISCORD_GUILD_ID=your_guild_id_here
|
||||
"""
|
||||
|
||||
with open(".env", 'w') as f:
|
||||
f.write(env_content)
|
||||
|
||||
print("✅ .env file created")
|
||||
|
||||
# Create data directories
|
||||
Path("data/vector_stores").mkdir(parents=True, exist_ok=True)
|
||||
Path("logs").mkdir(exist_ok=True)
|
||||
|
||||
print("✅ Data directories created")
|
||||
|
||||
# Run database migrations
|
||||
print("\n🗄️ Setting up database...")
|
||||
if run_command("alembic upgrade head", check=False):
|
||||
print("✅ Database migrations completed")
|
||||
else:
|
||||
print("⚠️ Database migrations failed (this is normal for first setup)")
|
||||
|
||||
print("\n🎉 Setup complete!")
|
||||
print("\nNext steps:")
|
||||
print("1. Install Ollama and pull a model: ollama pull llama2")
|
||||
print("2. Update Discord tokens in .env file")
|
||||
print("3. Run: python src/main.py")
|
||||
print("\nFor admin interface:")
|
||||
print("4. cd admin-frontend && npm install && npm start")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user