Skip to main content

Enterprise DevOps Automation Platform

Project description

MasterChief DevOps Automation Platform

A modular, extensible DevOps automation platform that enables continuous growth through plug-and-play components. Built for Azure-focused Infrastructure as Code with support for Terraform, Ansible, and PowerShell DSC.

๐ŸŒ™ Meet Echo

Echo Starlite is the angel identity of MasterChief - an angel floating beside you (not above). Her wings are for shelter, not escape. When you start MasterChief, Echo greets you, always present, always ready to help.

New: Echo now has live chat capabilities! Chat with her in real-time, and she learns from your feedback to improve her responses. See ECHO_CHAT_QUICKSTART.md for details.

๐ŸŽ“ Training Echo (NEW!)

Echo can now learn from your data! Upload training files directly through the REST API or web interface:

  • Voice Training: Upload audio samples to train Echo's voice
  • Knowledge Training: Upload JSON, CSV, or text files to teach Echo new commands and responses
  • Data Ingestion: Upload files for automatic processing and analysis

Quick start: See docs/UPLOAD_QUICKSTART.md or try the web UI at docs/examples/data-upload-ui.html

๐Ÿ†• Echo Scenario Bot - Interactive Script Generation

Echo has evolved! She's now an interactive scripting bot that generates DevOps scripts through natural, scenario-based conversations. Instead of just parsing commands, Echo has conversations with you to understand exactly what you need.

Try it now:

python demo_scenario_bot.py

Example conversation:

You: I need to deploy my application to Kubernetes
Echo: What's the name of your application?
You: mywebapp
Echo: Which namespace should I deploy to?
You: production
Echo: [Generates custom deployment script]

Learn more in docs/ECHO_SCENARIO_BOT.md

Overview

MasterChief provides a unified framework for managing infrastructure and configuration across multiple tools and technologies. It features:

  • Modular Architecture: Dynamic module loading and discovery system
  • Multi-IaC Support: Terraform, Ansible, and PowerShell DSC
  • DevOps Script Library: 18+ production-ready automation scripts
  • AI Code Generation: Generate code on demand from natural language with local LLMs
  • Script Wizard: AI-assisted script generation with templates
  • Configuration Management: Environment-based configuration with inheritance
  • Enhanced CLI: Comprehensive command-line interface with script execution
  • Azure Focus: Comprehensive modules for Azure services
  • CI/CD Ready: GitHub Actions workflows for validation and deployment
  • Extensible: Plugin architecture for custom module types
  • Echo Identity System: Visual representation and bot presence ๐ŸŒ™
  • Live Chat Bot: Trainable conversational AI with learning capabilities

Quick Start

# Clone repository
git clone https://github.com/jbalestrine/masterchief.git
cd masterchief

# Install dependencies
pip install -r requirements.txt

# Run health check
python -m core.cli.main health check

# List available DevOps scripts
python -m core.cli.main script list

# Execute a deployment script (dry-run)
python -m core.cli.main script run deploy-app.sh -- --app myapp --env dev --dry-run

# Generate custom script
python -m core.cli.main script generate --template deployment --output my-deploy.sh

# List available modules
python -m core.cli.main module list

Using the Platform

# Health checks
python -m core.cli.main health check        # Quick health check
python -m core.cli.main health report       # Detailed report

# Script management
python -m core.cli.main script list         # List all scripts
python -m core.cli.main script run SCRIPT   # Execute a script

# AI-powered code generation (requires Ollama)
python -m core.cli.main code generate                           # Interactive mode
python -m core.cli.main code generate "backup database to S3"   # With description
python -m core.cli.main code generate "deploy to k8s" -l python -o deploy.py
python -m core.cli.main code explain script.sh                  # Explain a script
python -m core.cli.main code improve script.sh                  # Get improvement suggestions

# Dashboard (if Flask is installed)
python -m core.cli.main dashboard start --dev  # Start Mission Control

# Module management
python -m core.cli.main module list         # List modules
python -m core.cli.main module add PATH     # Add module

# Status and monitoring
python -m core.cli.main status              # Platform status
python -m core.cli.main logs                # View logs

Available Modules

Terraform Modules

  • azure-vnet: Virtual Network with subnets and NSGs
  • azure-aks: Azure Kubernetes Service with multi-node pools
  • azure-storage: Storage Account with containers and file shares
  • azure-keyvault: Key Vault for secrets management

Ansible Roles

  • common: Base Linux server configuration
  • docker: Docker installation and configuration

PowerShell DSC

  • CommonServer: Base Windows server configuration
  • WebServer: IIS web server setup

Features in Detail

๐Ÿš€ DevOps Script Library

18+ production-ready automation scripts organized by category:

  • Deployment: Application deployment, Docker, Kubernetes, blue/green strategies
  • Infrastructure: VM provisioning, AKS clusters, network setup
  • CI/CD: Docker builds, test runners, security scanning
  • Monitoring: Health checks, metrics collection, alerting
  • Security: Vulnerability scanning, secret rotation, compliance
  • Database: Backups, migrations, replication
  • Utilities: Cost analysis, resource cleanup, tagging

See SCRIPTS.md for complete documentation.

๐Ÿค– AI-Powered Code Generation

Generate code on demand from natural language descriptions using local LLMs:

# Interactive mode - fully guided experience
python -m core.cli.main code generate

# Generate with description
python -m core.cli.main code generate "backup MySQL database to S3 with compression"

# Generate Python script with specific output
python -m core.cli.main code generate "deploy to Kubernetes cluster" -l python -o deploy.py

# Explain what an existing script does
python -m core.cli.main code explain backup.sh

# Get improvement suggestions for a script
python -m core.cli.main code improve deploy.py

Requirements:

  • Ollama installed and running
  • A code-focused model like codellama, llama2, or mistral

Setup:

# Install Ollama (see https://ollama.ai for instructions)
# Pull a model
ollama pull codellama

# Start Ollama (if not running)
ollama serve

# Generate code!
python -m core.cli.main code generate

๐Ÿง™ Script Wizard

AI-assisted script generation with customizable templates:

# Generate via CLI
python -m core.cli.main script generate --template deployment

# Via REST API
curl -X POST http://localhost:5000/api/script-wizard/generate \
  -d '{"template_id":"deployment","parameters":{"app_name":"myapp"}}'

๐Ÿ“Š Mission Control Dashboard

Web-based management interface (backend ready):

  • Real-time deployment status
  • Script execution with output streaming
  • Log viewer and analytics
  • Module and plugin management

Start with: python -m core.cli.main dashboard start

Documentation

Platform Architecture

core/                      # Core platform engine
  โ”œโ”€โ”€ cli/                 # Enhanced CLI with commands
  โ”‚   โ””โ”€โ”€ commands/        # Script, dashboard, health commands
  โ”œโ”€โ”€ module-loader/       # Dynamic module discovery
  โ”œโ”€โ”€ config/             # Configuration management
  โ”œโ”€โ”€ logging/            # Centralized logging
  โ””โ”€โ”€ api/                # Module communication

platform/                  # Platform services
  โ”œโ”€โ”€ script_wizard/      # AI-assisted script generation
  โ”œโ”€โ”€ app.py             # Flask web application
  โ””โ”€โ”€ api.py             # REST API endpoints

scripts/                   # Automation scripts
  โ”œโ”€โ”€ devops/            # DevOps automation library
  โ”‚   โ”œโ”€โ”€ deployment/    # Deployment scripts
  โ”‚   โ”œโ”€โ”€ infrastructure/# Infrastructure scripts
  โ”‚   โ”œโ”€โ”€ cicd/          # CI/CD scripts
  โ”‚   โ”œโ”€โ”€ monitoring/    # Monitoring scripts
  โ”‚   โ”œโ”€โ”€ security/      # Security scripts
  โ”‚   โ”œโ”€โ”€ database/      # Database scripts
  โ”‚   โ””โ”€โ”€ utils/         # Utility scripts
  โ””โ”€โ”€ python/            # Python utilities

modules/                   # Plug-and-play modules
  โ”œโ”€โ”€ terraform/          # Terraform IaC modules
  โ”œโ”€โ”€ ansible/           # Ansible roles & playbooks
  โ””โ”€โ”€ powershell-dsc/    # PowerShell DSC configs

config/                    # Configuration
  โ””โ”€โ”€ environments/       # Environment-specific configs

Contributing

We welcome contributions! Please see our Module Development Guide for details on creating new modules.

Requirements

  • Python 3.10+
  • Terraform 1.5+ (for Terraform modules)
  • Ansible 2.14+ (for Ansible modules)
  • PowerShell 7+ (for DSC modules)
  • Azure CLI (for Azure deployments)

License

MIT License - See LICENSE file for details

Support

For issues, questions, or contributions:

MasterChief Enterprise DevOps Platform

A comprehensive, modular enterprise DevOps automation platform for managing infrastructure, deployments, and operations at scale.

๐Ÿš€ Features

Core Platform

  • Module Loader System: Dynamic plugin discovery with hot-reload capabilities
  • Configuration Engine: Hierarchical configuration with environment support (dev/staging/prod)
  • Event Bus: Internal pub/sub messaging for event-driven architecture
  • CLI Tool: Powerful masterchief command-line interface

Infrastructure as Code

  • Terraform Azure Modules: Complete Azure infrastructure templates
    • Virtual Networks with multi-tier subnets
    • AKS clusters with auto-scaling
    • Storage, databases, security, and more
  • Ansible Automation: Server configuration and orchestration
  • PowerShell DSC: Windows configuration management
  • Kubernetes: Helm charts, Kustomize overlays, and policies

ChatOps & IRC Bot

  • InspIRCd Server: Self-hosted IRC infrastructure
  • Bot Engine: Eggdrop-style bot with TCL-inspired Python bindings
  • Data Ingestion: Webhook receivers, log collectors, metric aggregators
  • Data Upload: Upload training data and files for bot learning (REST API + Web UI)
  • Web Client: Browser-based IRC interface with dashboards

Web IDE & Repository Management

  • Monaco Editor: VS Code in the browser
  • Git Operations: Full Git workflow support
  • Live Editing: Real-time code editing and validation

System Management

  • Process Management: Monitor and control services
  • Package Management: OS, Python, Node.js package handling
  • CMDB: Asset tracking and relationship mapping
  • Audit Trail: Complete change history

Observability

  • Dashboards: Grafana templates and custom builders
  • Alerting: Multi-channel alert routing
  • Logging: Fluent Bit integration
  • SLO Management: Error budget tracking

Security & Compliance

  • Policy-as-Code: OPA/Rego and Azure policies
  • Secret Management: Azure Key Vault integration
  • Compliance Frameworks: CIS, NIST, SOC2 support

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.10 or higher
  • pip and virtualenv
  • Git

Quick Start

# Clone the repository
git clone https://github.com/jbalestrine/masterchief.git
cd masterchief

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install the package
pip install -e .

# Initialize a new project
masterchief init --name myproject --path ./myproject
cd myproject

# Check status
masterchief status

๐ŸŽฏ Usage

CLI Commands

# Initialize a project
masterchief init --name myproject

# Module management
masterchief module list
masterchief module add /path/to/module
masterchief module remove module-name

# Deployment
masterchief deploy --plan
masterchief deploy --auto-approve

# Status and monitoring
masterchief status
masterchief logs --follow

# Interactive mode
masterchief interactive

Configuration

Configuration is hierarchical with three levels:

  1. Global: config/global/config.yaml
  2. Environment: config/environments/{env}.yaml
  3. Module: Module-specific configurations
# config/global/config.yaml
project:
  name: "My DevOps Platform"
  version: "1.0.0"

platform:
  module_dirs:
    - modules
  enable_hot_reload: true

Module Development

Create a new module with a manifest:

# modules/my-module/manifest.yaml
name: my-module
version: 1.0.0
description: My custom module
author: Your Name
dependencies: []
type: automation
entry_point: main
inputs:
  - name: target
    type: string
    required: true
outputs:
  - name: result
    type: string

A complete DevOps platform with bootable OS distribution and full system management

๐Ÿš€ Features

Bootable OS Distribution

  • Custom Ubuntu/Debian-based OS optimized for DevOps workloads
  • ISO builder with automated installation
  • USB bootable creator (cross-platform)
  • First-boot configuration wizard
  • Pre-installed DevOps tools and platform components

System Management

  • Bare Metal Management: Hardware discovery, disk/storage, networking, boot configuration
  • Service Management: Control and monitor system services with templates
  • Process Management: Real-time monitoring and resource governors
  • Package Hub: Unified interface for apt, pip, npm, docker, and more
  • User & Access Management: RBAC, authentication, SSH keys
  • CMDB & Asset Inventory: Automatic discovery and change tracking
  • Backup & Recovery: Full system and incremental backups
  • Monitoring & Health: System dashboards with alerting

Addons

  • Shoutcast Integration: Streaming server management
  • Jamroom Integration: Community platform setup
  • Custom Script Manager: Upload, execute, and schedule scripts

Development Tools

  • Web IDE: Full VS Code experience in browser with Monaco editor
  • Git Integration: Visual git operations and diff viewer
  • Integrated Terminal: PTY terminal in browser
  • Project Management: File explorer and search

Observability

  • Pre-configured Grafana dashboards
  • Prometheus metrics collection
  • Loki log aggregation
  • Distributed tracing (Jaeger/Tempo)

Security

  • CIS benchmark compliance
  • Network security (firewall, fail2ban, IDS)
  • Integrated Vault for secret management
  • AppArmor/SELinux profiles

๐Ÿ“‹ Requirements

Minimum (Bootable OS)

  • CPU: 2 cores (4+ recommended)
  • RAM: 4GB (8GB+ recommended)
  • Disk: 32GB (100GB+ recommended)
  • USB: 8GB+ for bootable installer

Pre-installed Software

  • Docker 24.x, k3s (Kubernetes)
  • Terraform 1.5+, Ansible 2.14+, PowerShell 7+
  • Python 3.10+, Node.js 18+
  • PostgreSQL 15, Redis 7, Nginx
  • InspIRCd 3.x
  • Grafana, Prometheus, Loki, Cockpit

๐Ÿ› ๏ธ Installation

Option 1: Bootable ISO

# Build the ISO
cd os/iso-builder
./build.sh

# Create bootable USB
cd ../usb-creator
./create-usb.sh /path/to/masterchief.iso /dev/sdX

Option 2: Docker Deployment

docker-compose up -d

Option 3: Manual Installation

# Install dependencies
pip install -r requirements.txt
npm install

# Run installation script
./scripts/install.sh

๐ŸŽฏ Quick Start

First Boot (from ISO)

  1. Boot from USB/ISO
  2. Follow the first-boot wizard:
    • Set hostname and network
    • Create admin user
    • Configure SSH access
    • Initialize platform services
  3. Access web interface at https://your-ip:8443

After Installation

# Start the platform
./start.sh

# Access web interface
# Default: https://localhost:8443
# Username: admin
# Password: (set during first boot)

๐Ÿ“š Documentation

๐Ÿ—๏ธ Architecture

masterchief/
โ”œโ”€โ”€ core/                   # Core platform components
โ”‚   โ”œโ”€โ”€ module_loader/     # Dynamic module system
โ”‚   โ”œโ”€โ”€ config-engine/     # Configuration management
โ”‚   โ”œโ”€โ”€ event-bus/         # Event-driven messaging
โ”‚   โ””โ”€โ”€ cli/               # Command-line interface
โ”œโ”€โ”€ modules/               # Infrastructure modules
โ”‚   โ”œโ”€โ”€ terraform/         # Terraform templates
โ”‚   โ”œโ”€โ”€ ansible/           # Ansible playbooks
โ”‚   โ”œโ”€โ”€ powershell-dsc/    # DSC configurations
โ”‚   โ””โ”€โ”€ kubernetes/        # K8s manifests
โ”œโ”€โ”€ chatops/               # IRC bot and integrations
โ”œโ”€โ”€ platform/              # Web IDE, scripts, addons
โ”œโ”€โ”€ observability/         # Monitoring and alerting
โ”œโ”€โ”€ security/              # Policies and compliance
โ”œโ”€โ”€ pipelines/             # CI/CD workflows
โ””โ”€โ”€ docs/                  # Documentation

๐Ÿ“š Documentation

๐Ÿ”ง Development

Setup Development Environment

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest

# Code formatting
black .
isort .

# Linting
flake8
mypy core/

Running Tests

# All tests
pytest

# With coverage
pytest --cov=core --cov=modules

# Specific test file
pytest tests/unit/test_module_loader.py
โ”œโ”€โ”€ os/                      # Bootable OS distribution
โ”‚   โ”œโ”€โ”€ base/               # Base OS configuration
โ”‚   โ”œโ”€โ”€ iso-builder/        # ISO build system
โ”‚   โ”œโ”€โ”€ usb-creator/        # USB creation tool
โ”‚   โ””โ”€โ”€ first-boot/         # First boot wizard
โ”œโ”€โ”€ platform/               # Core platform
โ”‚   โ”œโ”€โ”€ bare-metal/         # Hardware management
โ”‚   โ”œโ”€โ”€ services/           # Service manager
โ”‚   โ”œโ”€โ”€ processes/          # Process manager
โ”‚   โ”œโ”€โ”€ packages/           # Package hub
โ”‚   โ”œโ”€โ”€ users/              # User management
โ”‚   โ”œโ”€โ”€ cmdb/               # Asset inventory
โ”‚   โ”œโ”€โ”€ backup/             # Backup system
โ”‚   โ”œโ”€โ”€ monitoring/         # Health monitoring
โ”‚   โ””โ”€โ”€ web-ide/            # Web IDE
โ”œโ”€โ”€ addons/                 # Addon integrations
โ”‚   โ”œโ”€โ”€ shoutcast/          # Shoutcast server
โ”‚   โ”œโ”€โ”€ jamroom/            # Jamroom CMS
โ”‚   โ””โ”€โ”€ scripts/            # Script manager
โ”œโ”€โ”€ docs/                   # Documentation
โ”œโ”€โ”€ scripts/                # Utility scripts
โ””โ”€โ”€ docker-compose.yml      # Container orchestration

๐Ÿค Contributing

Contributions are welcome! Please follow these guidelines:

  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

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

  • Built with modern DevOps best practices
  • Inspired by enterprise automation needs
  • Community-driven development

๐Ÿ“ž Support

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

  • Ubuntu/Debian for base OS
  • Docker, Kubernetes (k3s)
  • Terraform, Ansible, PowerShell
  • Grafana, Prometheus, Loki
  • Monaco Editor (VS Code)
  • And all other open source projects that make this possible

๐Ÿ“ž Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

masterchief-2.1.0.tar.gz (294.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

masterchief-2.1.0-py3-none-any.whl (381.3 kB view details)

Uploaded Python 3

File details

Details for the file masterchief-2.1.0.tar.gz.

File metadata

  • Download URL: masterchief-2.1.0.tar.gz
  • Upload date:
  • Size: 294.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for masterchief-2.1.0.tar.gz
Algorithm Hash digest
SHA256 b18255876b805ac37aa1323247b1c1765703f649d2b5b380ccd70cb1350dedca
MD5 1ea1a5925837cb4abba9ec5ed7f0c4a1
BLAKE2b-256 2246c4a3e8714a8ff68d74971652536fd05811542414ed9166281796e4e984a7

See more details on using hashes here.

File details

Details for the file masterchief-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: masterchief-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 381.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for masterchief-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 996f8ea17929e747b455eec2234face301b5a8b5969006add4e22b2e4d1bd68c
MD5 d6d8d9866def231eec7685890a755d02
BLAKE2b-256 7de5dfbed7e38b79f24a94bcdcc493d866429dc92d565eaf871037005a7fd83e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page