Skip to main content

AI-powered infrastructure management

Project description

Opsbox

AI-Powered Infrastructure Management

Welcome to Opsbox, the open-source platform that adds a dash of AI magic to your infrastructure management. With our flexible plugin system and policy-as-code approach using Rego, managing your infrastructure has never been this enjoyable!

Features

  • 🎛️ Plugin System: Customize and extend functionality with ease.
  • 📝 Policy-as-Code with Rego: Define compliance checks and policies efficiently.
  • 🤖 AI Assistance: Leverage AI models to analyze and process your infrastructure data.
  • 💻 Command-Line Interface: An interactive CLI.
  • 📚 Documentation Support: Generate and view documentation effortlessly using mkdocs.

Installation

Ready to dive in? Let's get you set up!

Prerequisites

  • Python 3.11
  • uv

Through PyPI

Simply run pip install opsbox to install the minimal set of opsbox tools.

If using UV, run uv add opsbox

Note: If you want to install AWS plugins, use the aws extras group, opsbox[aws]

Through Github

  1. Clone the Repository

    git clone https://github.com/sudoersllc/Opsbox.git
    cd Opsbox
    
  2. Install with uv

    We use [uv] for managing dependencies. If you don't have it installed, you can get it via pip:

    pip install uv
    

    Now, let's install Opsbox:

    uv sync
    

    This command will install all required dependencies specified in pyproject.toml.

Using Rego Plugins

Open Policy Agent (OPA) is an open-source policy engine that enables organizations to implement policy as code across diverse environments. Its policy language, Rego, allows users to define rules that dictate system and application behavior.

We use rego code to gather details about connected systems, alongside an Open Policy Agent (OPA) server, then format it for consumption by a language model.

Create a OPA Policy docker image

To run OpsBox with rego plugins, you'll need an OPA server. This is because OpsBox uses OPA to enforce policies on all resources that are being managed.

if you don't have OPA installed on your machine, or you dont have a running OPA instance, you can create a docker image for OPA.

Start by installing docker.

Create a dockerfile and add the following code:

    # Use the official OPA image
    FROM openpolicyagent/opa:latest

    # Expose OPA's default port
    EXPOSE 8181

    # Run OPA with the specified policy file
    CMD ["run", "--server", "--addr", "0.0.0.0:8181"]

Navigate to the directory and Build the Docker image:

    docker build -t name_of_file .

or you can also follow the offical OPA documentation to create the engine: OPA Documentation

Running Opsbox

Time to see the magic in action!

Simply run:

uv run opsbox ...

or, if not using UV:

python -m opsbox ...

This will launch Opsbox and display the CLI help along with available commands.

Example Usage

Want to run a specific pipeline? Here's how:

uv run opsbox --modules your_input-your_optional_assistant-your_output --opa_upload_url http://your-opa-upload-url --opa_apply_url http://your-opa-apply-url

or, if not using UV:

python -m opsbox --modules your_input-your_optional_assistant-your_output --opa_upload_url http://your-opa-upload-url --opa_apply_url http://your-opa-apply-url

Configuration

Opsbox is flexible when it comes to configuration. You can provide options via:

  • Command-Line Arguments
  • Configuration Files
  • Environment Variables

Using a Configuration File

Create a file named .opsbox_conf.json in your home directory:

{
  "aws_access_key_id": "YOUR_ACCESS_KEY_ID",
  "aws_secret_access_key": "YOUR_SECRET_ACCESS_KEY",
  "aws_region": "YOUR_AWS_REGION",
  "opa_upload_url": "http://your-opa-upload-url",
  "opa_apply_url": "http://your-opa-apply-url"
}

Command-Line Arguments

You can also provide configuration options directly through the command line:

python -m opsbox --modules example_module --aws_access_key_id YOUR_ACCESS_KEY_ID --aws_secret_access_key YOUR_SECRET_ACCESS_KEY --aws_region YOUR_AWS_REGION --opa_upload_url http://your-opa-upload-url --opa_apply_url http://your-opa-apply-url

Plugins

You'll probably want some plugins to get started!

Opsbox plugins published by gsudoers normally take the format of opsbox-<name>-<plugin_type>, and are accessible and searchable through PyPI.

There's also a collection of plugins available for AWS systems, installable by using the pip extras group aws:

pip install 'opsbox[aws]'

Let's Get Started!

Now that you're all set, it's time to unleash the power of AI on your infrastructure. Happy automating!

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

opsbox-0.1.3.tar.gz (27.8 kB view details)

Uploaded Source

Built Distributions

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

opsbox-0.1.3-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

opsbox-0.1.3-1-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file opsbox-0.1.3.tar.gz.

File metadata

  • Download URL: opsbox-0.1.3.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.25

File hashes

Hashes for opsbox-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a8546b099f9d4b75f7b1f7b83f63cb69e42c0d847d11976f74564dcba09bc114
MD5 de6303e795cae13c84dbec58e2a126ef
BLAKE2b-256 2c42f0f9b653e7a150d6b655fcdab8ebe2016b5df3238180483f91aba9477f5a

See more details on using hashes here.

File details

Details for the file opsbox-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: opsbox-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.25

File hashes

Hashes for opsbox-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d365ccceb18273070b9656571d7acdf0a9fdaa8d1c8d3bed258a0d5450138e98
MD5 ebfd9b4036bdcdd874849a90703f8172
BLAKE2b-256 a24aa5fd4c3eba93db0048338643b00e4902110b3308235752ddaf1a1c685af5

See more details on using hashes here.

File details

Details for the file opsbox-0.1.3-1-py3-none-any.whl.

File metadata

  • Download URL: opsbox-0.1.3-1-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.25

File hashes

Hashes for opsbox-0.1.3-1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6e16708af162cd15cba8234b4fa4a1b539335cdc7a369dd5031cf8625af7c1f
MD5 bb4255be3130d661d00c7a689f13d012
BLAKE2b-256 627d8d07a219a22b0879582e69ac41e96e5ec6344abf988f926433716d5c694f

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