Sparki.tools DevOps & CI/CD Guide
Complete guide for setting up development, testing, and production environments for Sparki.tools.Table of Contents
- Local Development Setup
- Docker Setup
- Testing
- CI/CD Pipeline
- Kubernetes Deployment
- Monitoring & Observability
- Database Management
Local Development Setup
Prerequisites
- Go 1.24+
- Docker & Docker Compose 3.8+
- Make
- PostgreSQL client tools (optional)
Quick Start
Available Make Commands
Docker Setup
Development Environment
Thedocker-compose.dev.yml provides complete local development environment:
Building Docker Images
Testing
Unit Tests
Integration Tests
Requirements:- PostgreSQL running on
localhost:5432 - Redis running on
localhost:6379
Benchmark Tests
Load Testing
CI/CD Pipeline
GitHub Actions Workflow
The.github/workflows/ci-cd.yml provides automated testing and deployment:
Triggers:
- Push to
mainordevelop - Pull requests to
mainordevelop - Push to release branches
- Lint - Code quality checks with golangci-lint
- Test Unit - Unit tests on Go 1.24 and 1.25
- Test Integration - Integration tests with PostgreSQL and Redis
- Security - Gosec and Nancy vulnerability scanning
- Build Docker - Build and push Docker images
- Deploy Staging - Deploy to staging on develop push
- Deploy Production - Deploy to production on release branch
Running Locally
Secrets Required in GitHub
Kubernetes Deployment
Prerequisites
- Kubernetes 1.24+
- kubectl configured
- cert-manager for TLS
- nginx-ingress-controller
Deploying to Kubernetes
Accessing Services
Scaling
Updating Deployment
Monitoring & Observability
Prometheus
Metrics:- Application metrics:
:8080/metrics - HTTP request latency, errors, status codes
- Go runtime metrics (goroutines, memory, GC)
- Docker executor metrics
Grafana
Default Login:- Username:
admin - Password:
admin
- Application Overview
- HTTP Metrics
- Docker Executor
- Database Performance
Jaeger Distributed Tracing
Access: http://localhost:16686 Traces include:- API request flows
- Database queries
- Docker executor operations
Health Checks
Database Management
Migrations
Backup and Restore
Database Reset (Development Only)
Environment Variables
Development
Production
Troubleshooting
Database Connection Issues
Redis Connection Issues
API Won’t Start
Tests Failing
Performance Tuning
Database Pool Settings
Redis Configuration
- Use persistence:
appendonly yes - Set eviction:
maxmemory-policy allkeys-lru - Increase client output buffer:
client-output-buffer-limit