vedantag17/devops-gpt

β˜… 0Forks 0PythonGitHub β†—Compare

README

DevOps-GPT: AI-Powered Deployment Failure Detection

A comprehensive DevOps automation framework using Mistral LLM and Model Context Protocol (MCP) for intelligent CI/CD pipeline monitoring, failure detection, and automated remediation.

🎯 Project Overview

DevOps-GPT integrates artificial intelligence into DevOps workflows to:

  • Detect deployment failures early using real-time log analysis
  • Automate root cause identification with LLM-powered diagnostics
  • Provide actionable insights for quick issue resolution
  • Reduce system downtime through intelligent automation
  • Seamlessly integrate with existing CI/CD pipelines

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Data Sources  │────│  MCP Ingestion   │────│  AI Analysis    β”‚
β”‚  β€’ Jenkins      β”‚    β”‚  β€’ Log Parsing   β”‚    β”‚  β€’ Mistral LLM  β”‚
β”‚  β€’ Prometheus   β”‚    β”‚  β€’ Metrics       β”‚    β”‚  β€’ Pattern      β”‚
β”‚  β€’ Git Logs     β”‚    β”‚  β€’ Normalization β”‚    β”‚    Detection    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Resolution    │────│  Decision Engine │────│  Real-time      β”‚
β”‚  β€’ Auto-fix     β”‚    β”‚  β€’ Risk Analysis β”‚    β”‚  Monitoring     β”‚
β”‚  β€’ Rollback     β”‚    β”‚  β€’ Recommendationsβ”‚    β”‚  β€’ Alerts       β”‚
β”‚  β€’ Scaling      β”‚    β”‚  β€’ Validation    β”‚    β”‚  β€’ Dashboards   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Features

Core Capabilities

  • Real-time Log Analysis: Process CI/CD logs using Mistral LLM
  • Anomaly Detection: ML-based pattern recognition for failure prediction
  • Automated Root Cause Analysis: Intelligent correlation of events and logs
  • Smart Remediation: AI-generated fix suggestions and automated responses
  • Pipeline Integration: Seamless integration with Jenkins, GitHub Actions, Terraform

AI-Powered Intelligence

  • Natural Language Processing: Parse and understand deployment logs
  • Predictive Analytics: Forecast potential deployment issues
  • Context-Aware Decisions: Use historical data for better recommendations
  • Continuous Learning: Improve accuracy through feedback loops

πŸ› οΈ Technology Stack

  • AI/ML: Mistral LLM, scikit-learn, pandas, numpy
  • Backend: Python 3.9+, FastAPI, SQLAlchemy
  • Message Queue: Redis, Celery
  • Monitoring: Prometheus, Grafana
  • CI/CD: Jenkins, GitHub Actions
  • Infrastructure: Docker, Kubernetes, Terraform
  • Database: PostgreSQL, InfluxDB (time-series)

πŸ“‹ Prerequisites

  • Python 3.9 or higher
  • Docker and Docker Compose
  • Git
  • Mistral API access (free tier available)

⚑ Quick Start

  1. Clone the repository:

    git clone <repository-url>
    cd devopsGPT_clone
  2. Set up environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
  3. Configure environment variables:

    cp .env.example .env
    # Edit .env with your Mistral API key and other configurations
  4. Start the services:

    docker-compose up -d
    python src/main.py
  5. Access the dashboard:

πŸ“ Project Structure

devopsGPT_clone/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ api/                 # FastAPI application
β”‚   β”œβ”€β”€ agents/              # AI agents and LLM integration
β”‚   β”œβ”€β”€ mcp/                 # Model Context Protocol implementation
β”‚   β”œβ”€β”€ monitoring/          # Monitoring and observability
β”‚   β”œβ”€β”€ pipeline/            # CI/CD pipeline integrations
β”‚   └── utils/               # Utility functions
β”œβ”€β”€ config/                  # Configuration files
β”œβ”€β”€ docker/                  # Docker configurations
β”œβ”€β”€ tests/                   # Test suites
β”œβ”€β”€ docs/                    # Documentation
β”œβ”€β”€ scripts/                 # Deployment and utility scripts
└── data/                    # Sample datasets and logs

πŸ”§ Configuration

Environment Variables

  • MISTRAL_API_KEY: Your Mistral AI API key
  • DATABASE_URL: PostgreSQL connection string
  • REDIS_URL: Redis connection string
  • JENKINS_URL: Jenkins server URL
  • PROMETHEUS_URL: Prometheus server URL

AI Model Settings

  • Model: Mistral 7B (configurable)
  • Context window: 32k tokens
  • Temperature: 0.1 (for consistent responses)

πŸ“Š Usage Examples

Basic Log Analysis

from src.agents.mistral_agent import MistralAgent

agent = MistralAgent()
result = agent.analyze_deployment_logs(log_data)
print(f"Status: {result.status}")
print(f"Issues found: {result.issues}")
print(f"Recommendations: {result.recommendations}")

Pipeline Integration

from src.pipeline.jenkins_integration import JenkinsMonitor

monitor = JenkinsMonitor()
monitor.start_monitoring()  # Auto-detects failures and triggers AI analysis

πŸ§ͺ Testing

Run the test suite:

pytest tests/ -v
python -m pytest tests/test_mistral_agent.py

πŸ“ˆ Performance Metrics

The system tracks key DevOps metrics:

  • MTTR (Mean Time To Recovery): Target < 5 minutes
  • Deployment Frequency: Support for multiple deployments per day
  • Change Failure Rate: Aim for < 15%
  • Lead Time: From commit to production

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ”’ Security

  • API authentication with JWT tokens
  • Secure storage of API keys and credentials
  • Network isolation using Docker networks
  • Regular security scanning of dependencies

πŸ“š Documentation

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Mistral AI for providing the language model
  • Model Context Protocol for data orchestration
  • DevOps Community for best practices and tools

πŸ“ž Support

For questions and support:


DevOps-GPT - Bringing Intelligence to DevOps Automation

Contributors

vedantag17

Issues