BlackLake Fast Setup Guide¶
This guide provides a quick setup for the BlackLake data platform with optimized build configurations.
Prerequisites¶
- Rust 1.70+
- Docker and Docker Compose
justcommand runner (optional, for dev commands)
Quick Start¶
1. Clone and Build¶
git clone https://github.com/your-org/blacklake.git
cd blacklake
# Build all crates with optimizations
cargo build --workspace --release
# Run tests
cargo test --workspace
2. Start Services¶
# Start all services with optimized configuration
docker-compose up -d
# Or use just (if installed)
just up-dev
3. Verify Setup¶
# Check all services are running
docker-compose ps
# Check API health
curl http://localhost:8080/health
# Check database health
curl http://localhost:8080/health/db
# Check storage health
curl http://localhost:8080/health/storage
Optimized Build Configuration¶
Cargo.toml Optimizations¶
Docker Build Optimizations¶
# Multi-stage build for smaller images
FROM rust:1.70-slim as builder
WORKDIR /app
COPY . .
RUN cargo build --release
FROM debian:bookworm-slim
COPY --from=builder /app/target/release/blacklake-api /usr/local/bin/
CMD ["blacklake-api"]
Environment Variables¶
# Performance optimizations
RUST_LOG=info
RUST_BACKTRACE=1
DATABASE_POOL_SIZE=20
REDIS_POOL_SIZE=10
CACHE_TTL=3600
Development Workflow¶
Using Just Commands¶
# Show all available commands
just --list
# Start development environment
just up-dev
# Run tests
just test
# Build optimized release
just build-release
# Clean and rebuild
just clean-build
Hot Reload Development¶
# Start with hot reload
just dev
# Watch for changes
just watch
# Run specific tests
just test-unit
just test-integration
Performance Tuning¶
Database Optimization¶
# Set database connection pool size
export DATABASE_POOL_SIZE=20
# Enable query logging
export DATABASE_LOG_QUERIES=true
# Set connection timeout
export DATABASE_TIMEOUT=30s
Redis Configuration¶
# Set Redis pool size
export REDIS_POOL_SIZE=10
# Set cache TTL
export CACHE_TTL=3600
# Enable Redis clustering
export REDIS_CLUSTER=true
S3 Storage Optimization¶
# Set S3 connection pool size
export S3_POOL_SIZE=5
# Enable S3 multipart uploads
export S3_MULTIPART_THRESHOLD=100MB
# Set S3 timeout
export S3_TIMEOUT=60s
Monitoring Setup¶
Prometheus Configuration¶
# prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'blacklake-api'
static_configs:
- targets: ['api:8080']
Grafana Dashboards¶
# Import dashboards
curl -X POST http://localhost:3000/api/dashboards/db \
-H "Content-Type: application/json" \
-d @docs/grafana/dashboards/system-overview.json
Troubleshooting¶
Common Issues¶
-
Build Failures
-
Database Connection Issues
-
Storage Issues
Performance Issues¶
- Slow API Responses
- Check database connection pool
- Verify Redis connectivity
-
Monitor memory usage
-
High Memory Usage
- Reduce connection pool sizes
- Enable garbage collection
-
Monitor for memory leaks
-
Database Performance
- Check query performance
- Verify indexes
- Monitor connection pool
Production Deployment¶
Docker Compose Production¶
# Production deployment
docker-compose -f docker-compose.prod.yml up -d
# With custom configuration
BLACKLAKE_DOMAIN=blacklake.example.com docker-compose -f docker-compose.prod.yml up -d
Kubernetes Deployment¶
# Deploy to Kubernetes
kubectl apply -f k8s/
# With Helm
helm install blacklake ./helm/blacklake -f helm/blacklake/values.yaml
Additional Resources¶
Support¶
- Documentation: Documentation Home
- Issues: GitHub Issues
- Discussions: GitHub Discussions