mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 06:06:02 +09:00
This commit brings v2.0.4 changes to main without problematic SQLite database files: ### 🗄️ SQLite Memory System - Enhanced SQLite Schema with 12 specialized tables - Persistent storage in .swarm/memory.db with WAL mode - Cross-session persistence for Claude Code sessions - Namespace support for organized memory management ### 🔧 MCP Server Integration - EnhancedMemory class extending SqliteMemoryStore - 14 Hook types for comprehensive operation tracking - Memory synchronization between CLI and MCP tools - Robust error handling and database integrity ### 📁 Project Organization - Archive legacy systems to archive/legacy-memory-system - Clean root structure for better maintainability - Updated documentation reflecting SQLite architecture ### 🔗 NPM Package Updates - Include memory JS/SQL files in distribution - MCP server files included in npm package - Version updated to 2.0.0-alpha.42 ### ⚙️ Configuration Updates - .gitignore excludes SQLite database files - .npmignore includes necessary memory components - CLI version consistency at 2.0.0-alpha.42 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Docker Testing Environment for claude-code-flow
This directory contains a comprehensive Docker testing environment for claude-code-flow and ruv-swarm integration.
🏗️ Architecture
Multi-Stage Docker Build
The Dockerfile implements a multi-stage build process:
- Base Stage: Common system dependencies and Node.js setup
- Dependencies Stage: Optimized dependency installation
- Development Stage: Full development environment with source code
- Testing Stage: Test-specific configuration and tools
- Production Stage: Minimal production runtime
- Swarm Integration Stage: ruv-swarm MCP integration testing
Docker Compose Orchestration
The docker-compose.yml provides:
- claude-flow-dev: Development environment with hot reloading
- claude-flow-test: Automated testing environment
- claude-flow-prod: Production-ready deployment
- ruv-swarm-integration: Swarm coordination testing
- Database Services: SQLite databases for both services
- Monitoring: Performance monitoring and metrics collection
- Load Balancer: Nginx for production load balancing
🚀 Quick Start
1. Build and Test Everything
# Run complete build and test pipeline
./scripts/build-and-test.sh
2. Development Environment
# Start development environment
docker-compose up -d claude-flow-dev
# View logs
docker-compose logs -f claude-flow-dev
# Access the application
open http://localhost:3000
3. Testing Environment
# Run all tests
docker-compose --profile testing up test-runner
# Run specific test suites
docker-compose run --rm claude-flow-test npm run test:unit
docker-compose run --rm claude-flow-test npm run test:integration
4. Swarm Integration Testing
# Start swarm integration environment
docker-compose --profile swarm up -d
# Run swarm tests
docker-compose run --rm ruv-swarm-integration npm run test:swarm
# Monitor swarm coordination
docker-compose logs -f ruv-swarm-integration
5. Production Deployment
# Start production environment
docker-compose --profile production up -d
# Access production instance
open http://localhost:3002
# Check health
curl http://localhost:3002/health
📊 Monitoring and Metrics
Performance Monitoring
The environment includes comprehensive monitoring:
# Start performance monitoring
docker-compose --profile monitoring up -d performance-monitor
# View metrics
curl http://localhost/metrics
# Check performance reports
cat infrastructure/docker/testing/volumes/shared/performance-report.json
Health Checks
All services include health checks:
# Check all service health
docker-compose ps
# Manual health check
curl http://localhost:3000/health
🔧 Configuration
Environment Variables
Key environment variables:
# Development
NODE_ENV=development
DEBUG=claude-flow:*
SWARM_MODE=true
MCP_ENABLED=true
# Testing
NODE_ENV=test
CI=true
PARALLEL_TESTS=true
# Production
NODE_ENV=production
PORT=3000
Volume Mounts
The environment uses strategic volume mounting:
- Source Code: Live mounting for development
- Node Modules: Cached for performance
- Shared Data: Cross-container communication
- Test Results: Persistent test artifacts
- Database: Persistent data storage
🧪 Testing Strategy
Test Suites
- Unit Tests: Component-level testing
- Integration Tests: Service integration testing
- E2E Tests: End-to-end workflow testing
- Performance Tests: Load and stress testing
- Swarm Tests: Multi-agent coordination testing
- MCP Tests: Protocol integration testing
Test Execution
# Run all tests
./scripts/run-all-tests.sh
# Run specific test categories
docker-compose run --rm claude-flow-test npm run test:unit
docker-compose run --rm claude-flow-test npm run test:integration
docker-compose run --rm claude-flow-test npm run test:performance
📂 Directory Structure
infrastructure/docker/testing/
├── Dockerfile # Multi-stage build definition
├── docker-compose.yml # Service orchestration
├── docker-compose.test.yml # Test-specific orchestration
├── docker-compose.override.yml # Local overrides
├── .dockerignore # Build context exclusions
├── nginx.conf # Load balancer configuration
├── README.md # This file
├── scripts/
│ ├── build-and-test.sh # Main build and test pipeline
│ ├── run-all-tests.sh # Comprehensive test runner
│ └── performance-monitor.js # Performance monitoring
└── volumes/
├── claude-flow/ # claude-code-flow specific data
├── ruv-swarm/ # ruv-swarm specific data
└── shared/ # Cross-container shared data
🔄 CI/CD Integration
GitHub Actions Integration
The Docker environment is designed for CI/CD:
# Example GitHub Actions workflow
name: Docker Test Pipeline
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Docker Tests
run: |
cd infrastructure/docker/testing
./scripts/build-and-test.sh
Automated Testing
The pipeline includes:
- Multi-stage builds for different environments
- Parallel test execution for faster feedback
- Comprehensive reporting with detailed metrics
- Automated cleanup to prevent resource leaks
- Health monitoring for service reliability
🛠️ Troubleshooting
Common Issues
- Port Conflicts: Ensure ports 3000-3002, 8080 are available
- Docker Memory: Increase Docker memory allocation if needed
- Volume Permissions: Check volume mount permissions
- Network Issues: Verify Docker network configuration
Debug Commands
# View container logs
docker-compose logs -f [service-name]
# Execute interactive shell
docker-compose exec claude-flow-dev /bin/bash
# Check container resource usage
docker stats
# Inspect container configuration
docker-compose config
Performance Optimization
For optimal performance:
- Use
.dockerignoreto reduce build context - Layer caching for faster builds
- Multi-stage builds for smaller images
- Volume mounting for development efficiency
- Health checks for reliability
📋 Testing Checklist
Before deployment, verify:
- All Docker images build successfully
- Unit tests pass
- Integration tests pass
- E2E tests pass
- Performance tests meet requirements
- Swarm integration works correctly
- MCP protocol integration functions
- Health checks are responsive
- Monitoring captures metrics
- Production deployment is secure
🚀 Next Steps
- CI/CD Integration: Add to GitHub Actions
- Kubernetes Deployment: Create K8s manifests
- Multi-Architecture: Support ARM64 builds
- Security Scanning: Add vulnerability scanning
- Documentation: Update deployment guides
📞 Support
For issues or questions:
- GitHub Issues: https://github.com/ruvnet/claude-code-flow/issues
- Documentation: https://github.com/ruvnet/claude-code-flow/docs
- Discord: Community support channel
Note: This Docker environment is optimized for testing claude-code-flow and ruv-swarm integration. For production deployments, review security configurations and resource limits.