Agentic DevOps

repository·main·Indexed 42 days ago

https://github.com/agenticsorg/devops

An autonomous, AI-powered platform for managing cloud infrastructure using OpenAI's Agents SDK. It provides a Python API and CLI for intelligent, self-healing, and predictive DevOps operations across AWS and GitHub, featuring specialized agents for EC2, S3, and repository management coordinated by an Orchestrator Agent.

Tokens
87.6K
Snippets
226
Records
319
Agent score
54%

What's inside Agentic DevOps

  1. Overview of Agentic DevOps Documentation

    main
    The Agentic DevOps technical documentation provides a comprehensive guide to the framework's architecture, implementation, APIs, and deployment strategies. Developers can use this documentation to understand how the system integrates with AWS, GitHub, and OpenAI Agents, as well as how to deploy the framework via AWS Lambda, Docker, or Llama.
  2. Overview of the rUvix technology stack

    main

    The rUvix terminal interface is built using the following modern web technologies:

    • Vite: Build tool
    • TypeScript: Type-safe programming
    • React: UI library
    • shadcn-ui: Component library
    • Tailwind CSS: Utility-first CSS framework
  3. What is Agentic DevOps?

    main
    Agentic DevOps is an autonomous, AI-powered platform designed for managing cloud infrastructure across multiple providers. Unlike traditional automation, it uses AI-driven decision-making to independently plan, execute, and optimize the entire infrastructure lifecycle. It is powered by OpenAI's Agents SDK and currently features primary support for AWS and GitHub integration.
  4. Project Structure and Dependencies

    main

    The DevOps agent is organized into service-specific implementations (AWS, GitHub) and core agent logic.

    Core Directory Structure

    • src/aws/: AWS service implementations (EC2, IAM, S3, VPC).
    • src/github/: GitHub service implementations.
    • src/core/: Core agent logic including agent.py, config.py, context.py, guardrails.py, and tracing.py.
    • examples/: Implementation examples for EC2, GitHub, and deployment workflows.
    • tests/: Test suites for AWS, GitHub, and core functionality.

    Key Dependencies

    • boto3: AWS SDK for Python
    • PyGithub: GitHub API client
    • pydantic: Data validation and settings management
    • openai-agents: OpenAI Agents SDK
    • moto: AWS mocking library
    • pytest: Testing framework
  5. Understand the Agentic DevOps project structure

    main

    The project is organized into several functional domains that allow for both manual DevOps operations and autonomous agentic workflows:

    • src/aws/: Modules for managing AWS services like EC2, S3, VPC, IAM, CloudFormation, Lambda, ECS, and RDS.
    • src/github/: Integration for GitHub issues, repositories, and Actions.
    • src/autonomous/: Core autonomous logic including deployment, resource optimization, monitoring, and learning systems.
    • src/agents/: Integration with OpenAI Agents, including specific tools for EC2, S3, and GitHub.
    • src/core/: Foundational logic for configuration, credentials, context, logging, and security guardrails.
    • cli/: Command-line interface entry points for AWS, GitHub, and deployment commands.
    • examples/: Reference scripts for using AWS services and OpenAI Agents.
  6. Manage EC2 instances with the AWS module

    main
    The aws module provides tools for interacting with Amazon Web Services, specifically focusing on the ec2 submodule. You can use this submodule to list, start, stop, create, and terminate EC2 instances, as well as deploy applications from GitHub to EC2 instances.
  7. Core capabilities of Agentic DevOps

    main

    Agentic DevOps provides several categories of autonomous and intelligent services:

    • Autonomous Infrastructure Management: Self-provisioning, automatic scaling, resource optimization, and anomaly remediation.
    • Intelligent Agents: Specialized agents that collaborate, maintain contextual awareness of infrastructure state, and use reasoning for complex problem-solving.
    • Natural Language Interaction: Managing infrastructure via conversational commands and plain English instructions.
    • Multi-Cloud Support: Unified interface for AWS (primary), with planned support for Azure, Google Cloud, and DigitalOcean.
    • Security and Compliance: Secure credential management (via keyring integration), least privilege enforcement, and automated vulnerability scanning.
    • Observability and Monitoring: Resource health, performance metrics, cost tracking, and root cause determination.
    • Deployment Automation: CI/CD integration, blue/green and canary deployment strategies, and automated rollbacks.
    • Disaster Recovery: Automated backups, cross-region replication, and failover automation.
    • Workflow Orchestration: Multi-step automation with conditional paths and human-in-the-loop approvals.
    • Knowledge Management: Automated runbook generation and self-documenting operations.
  8. Understand the Agentic DevOps High-Level Architecture

    main

    The Agentic DevOps framework is a modular system designed to automate DevOps workflows using AI agents. It is composed of five primary layers that interact to manage infrastructure, code, and intelligent task execution:

    1. Core Module: Manages configuration, credentials, context, and safety guardrails.
    2. AWS Integration: Provides connectivity to AWS services such as EC2, S3, and IAM.
    3. GitHub Integration: Manages code-related operations including Repositories, Pull Requests (PRs), and Issues.
    4. OpenAI Agents Integration: Uses the OpenAI Agents SDK to deploy intelligent agents equipped with tools and guardrails.
    5. CLI Layer: The entry point for users to interact with the system via command handlers.
  9. GitHub Module components and responsibilities

    main

    The github/ module provides tools for interacting with GitHub:

    • GitHub Service (github.py): Manages repositories, issues, and pull requests via the GitHubService class.
    • GitHub Tools (github_tools.py): Contains helper functions and tools for GitHub operations.
    • GitHub Models (github_models.py): Defines data structures for GitHub resources, including GitHubRepository, GitHubIssue, GitHubPullRequest, GitHubRepoRequest, GitHubIssueRequest, and GitHubPRRequest.
  10. Implement Multi-Agent Workflows

    main

    The framework supports three types of multi-agent coordination:

    1. Handoffs: Agents can delegate tasks to other specialized agents using the handoffs parameter in the Agent constructor.
    2. Sequential Execution: Running multiple agents in a chain where the output of one is passed to the next.
    3. Parallel Execution: Running multiple agents simultaneously using asyncio.gather.
    # 1. Handoffs
    orchestrator_agent = Agent(
        name="Orchestrator",
        instructions="...",
        handoffs=[
            {"agent": infrastructure_agent, "description": "Handles infrastructure tasks"},
            {"agent": deployment_agent, "description": "Handles deployment tasks"}
        ]
    )
    
    # 2. Sequential Execution
    infra_result = await Runner.run(infrastructure_agent, "Prepare the infrastructure")
    deploy_result = await Runner.run(deployment_agent, f"Deploy using {infra_result.final_output}")
    
    # 3. Parallel Execution
    infra_task = asyncio.create_task(Runner.run(infrastructure_agent, "Prepare the infrastructure"))
    code_task = asyncio.create_task(Runner.run(code_agent, "Prepare the code"))
    infra_result, code_result = await asyncio.gather(infra_task, code_task)
  11. How the OpenAI Agents integration works

    main

    The Agentic DevOps framework integrates with the OpenAI Agents SDK to automate complex DevOps workflows through specialized agents. The architecture is composed of five key pillars:

    1. Agent Factory: Creates and configures specialized agents (infrastructure, code, deployment, security) using templates and handoff mechanisms.
    2. Tool Registry: Manages tools for interacting with external systems like AWS and GitHub. Tools must be async functions with type annotations.
    3. Guardrail System: Ensures safety via input validation, output filtering, and operation restrictions.
    4. Context Management: Provides environmental data (user, AWS region, GitHub repo) to agents.
    5. Runner: The execution engine that handles agent initialization, tool execution, handoffs, and result formatting.
    ┌─────────────────────────────────────────────────────────────────┐
    │                     Agentic DevOps Framework                     
    └───────────────────────────────┬─────────────────────────────────┘
                                    │
                                    ▼
    ┌─────────────────────────────────────────────────────────────────┐
    │                     OpenAI Agents Integration                  
    ├─────────────┬─────────────┬─────────────┬─────────────┬─────────┤
    │             │             │             │             │         │
    │  Agent      │  Tool       │  Guardrail  │  Context    │  Runner │
    │  Factory    │  Registry   │  System     │  Management │         │
    │             │             │             │             │         │
    └─────────────┴─────────────┴─────────────┴─────────────┴─────────┘