Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/augur-ai/mantis
Mantis is a unified infrastructure as code framework that replaces Terraform and Helm
https://github.com/augur-ai/mantis
helm-charts infrastructure-as-code kubernetes kubernetes-deployment opentofu policy-as-code terraform
Last synced: about 1 month ago
JSON representation
Mantis is a unified infrastructure as code framework that replaces Terraform and Helm
- Host: GitHub
- URL: https://github.com/augur-ai/mantis
- Owner: augur-ai
- License: other
- Created: 2024-10-04T13:56:51.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-31T06:29:20.000Z (about 1 month ago)
- Last Synced: 2024-10-31T07:22:55.463Z (about 1 month ago)
- Topics: helm-charts, infrastructure-as-code, kubernetes, kubernetes-deployment, opentofu, policy-as-code, terraform
- Language: Go
- Homepage: https://getmantis.ai
- Size: 286 MB
- Stars: 54
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- my-awesome-github-stars - augur-ai/mantis - Mantis is a unified infrastructure as code framework that replaces Terraform and Helm (Go)
README
[![Language](https://img.shields.io/badge/Language-go-blue.svg)](https://go.dev/)
[![Discord](https://img.shields.io/discord/1098133460310294528?logo=Discord)](https://discord.gg/BJ8nKSmH)
# **Mantis**π AI-first queryable Infrastructure as Code tool that is an alternative to Terraform and Helm
**Introduction**
Mantis is a next-generation Infrastructure as Code (IaC) tool that reimagines how we manage cloud and Kubernetes resources. Built as a fork of OpenTofu and powered by CUE, Mantis combines the best of Terraform and Helm while solving their limitations.
### **Key Features**
* **Unified Configuration**: Single tool to replace both Terraform and Helm workflows
* **Task-Centric State Management**: Unlike Terraform's global state, Mantis manages state at the task level, eliminating lock contentions and speeding up deployments
* **AI-first:** Mantis treats configuration as code and applies Gen-AI to generate, validate, query and visualize configuration and config changes
* **Built-in Policy Engine**: Define and enforce security, compliance, and operational policiesβ οΈ **Note**: Mantis is under active development. APIs and CLI interfaces may change.
## **Installation**
### **Prerequisites**
* Basic understanding of IaC concepts
* Familiarity with Terraform or Helm (helpful but not required)### **Quick Install**
**MacOS/Linux**
```bash
brew install pranil-augur/homebrew-mantis/mantis
```## **Usage**
### **Basic Example \- Install a K8s based Flask app**
Deploy a cloud-native Flask application integrated with AWS RDS and managed through Kubernetes. We'll walk through the structure of the example code, how the tasks are broken down, and how the CUE-based modules simplify reusable infrastructure components.
Letβs dive into the file structure and flow that powers this deployment.
Project File Structure Below is the structure of the example deployment:
```bash
tree -L 2
.
βββ cue.mod
β βββ module.cue # Defines the module name and CUE version
βββ defs
β βββ deployment.cue # Deployment configurations for the Flask app
β βββ rds.cue # RDS database configurations
β βββ variables.cue # Variable definitions and inputs
β βββ providers.cue # Providers configuration
βββ install_flask_app.tf.cue # Main Mantis flow for deploying the app
```This file structure reflects how Mantis organizes infrastructure code using modular and reusable CUE configurations. Let's look at what each file and directory does.
#### **1\. Main Flow (install\_flask\_app.tf.cue)[β](https://getmantis.ai/blog/mantis_application_install#1-main-flow-install_flask_apptfcue)**
Main Flow Code
The main flow file orchestrates the entire deployment process by:
* Importing and using the definitions from defs/
* Defining task dependencies and execution order
* Managing state and variable passing between tasks
* Coordinating both AWS and Kubernetes resourcesThe core syntax of the main flow is:
```cue
deploy_flask_rds: {
@flow(deploy_flask_rds)
# Define the tasks that make up the flow
task_1: {
@task(mantis.core.TF) // Terraform task
...
}
task_2: {
@task(mantis.core.TF)
dep: [task_1] // Define task dependencies
...
}
task_3: {
@task(mantis.core.K8s) // Kubernetes task
dep: [task_1, task_2] // Define task dependencies
...
}
}
```#### **2\. cue.mod/module.cue[β](https://getmantis.ai/blog/mantis_application_install#2-cuemodmodulecue)**
This file defines the module name and CUE language version being used for the project. It also allows dependencies to be managed across the project.
```cue
module: "augur.ai/rds-flask-app"
language: {
version: "v0.10.0"
}// Define the dependencies for the project
dependencies: [
"abc.xyz.com/module1",
"abc.xyz.com/module2",
]
```Purpose: This ensures the project remains compatible across various CUE versions and clearly identifies the module for import across multiple flows.
#### **3\. defs Directory[β](https://getmantis.ai/blog/mantis_application_install#3-defs-directory)**
* defs/deployment.cue
* defs/variables.cue
* defs/providers.cue
* defs/rds.cue```cue
package defsflaskRdsDeployment: {
apiVersion: "apps/v1"
kind: "Deployment"
metadata: {
name: "flask-rds-deployment"
labels: {
app: "flask-rds"
}
}
spec: {
replicas: 2
selector: {
matchLabels: {
app: "flask-rds"
}
}
template: {
metadata: {
labels: {
app: "flask-rds"
}
}
spec: {
containers: [{
name: "flask-rds"
image: "\(common.container_repo)"
ports: [{
containerPort: 80
}]
env: [
{
name: "DB_HOST"
value: "@var(rds_endpoint)"
},
{
name: "DB_NAME"
value: "\(common.db_name)"
},
{
name: "DB_USER"
value: "\(common.db_username)"
},
{
name: "DB_PASSWORD"
value: "\(common.db_password)"
}
]
resources: {
limits: {
memory: "256Mi"
cpu: "250m"
}
requests: {
memory: "128Mi"
cpu: "80m"
}
}
}]
}
}
}
```
## **Demo video**
[Introduction to Mantis](https://www.loom.com/share/b8c48935df8f4752b305e64fc3bb3845)## **Documentation**
### **Core Concepts**
* [Tasks](https://getmantis.ai/docs/key_concepts/flows/tasks) & [flows](https://getmantis.ai/docs/key_concepts/flows/flow_overview)
### **Guides**
* [Getting Started](https://getmantis.ai/docs/getting_started/installation)
* [Migrating from Terraform](Coming soon)
* [Migrating from Helm](Coming soon)
* [Codifying Cloud Infrastructure](Coming soon)## **Contributing**
* The easiest way to contribute is to pick an issue with the `good first issue` tag πͺ. Read the contribution guidelines here.
* Submit your bug reports and feature requests [here](https://github.com/pranil-augur/mantis/issues)---
## **Community**
* Join our growing community around the world, for help, ideas, and discussions
* Discord [https://discord.gg/BJ8nKSmH](https://discord.gg/BJ8nKSmH)
* Linkedin [https://www.linkedin.com/company/augur-ai-inc/](https://www.linkedin.com/company/augur-ai-inc/)