A smart Tekton PipelineRun generator and validator powered by LlamaStack and RAG (Retrieval-Augmented Generation).
Tekton Genie is an AI-powered tool that helps you generate, validate, and manage Tekton PipelineRuns. It uses a combination of vector database storage and large language models to understand Tekton documentation and generate valid PipelineRun configurations and leverages AI agent to validate the generated PipelineRun YAML.
- 📚 Document Ingestion: Automatically processes and indexes Tekton documentation for contextual understanding
- 🔧 PipelineRun Generation: Creates Tekton PipelineRuns based on natural language requirements
- ✅ Validation: Built-in YAML validation and external validator support
- 🛠️ Auto-fixing: Automatically analyzes and fixes common validation errors
- 📝 RAG Integration: Uses Retrieval-Augmented Generation for context-aware PipelineRun creation
This component handles the ingestion of Tekton documentation into a vector database:
- Supports multiple document formats (.md, .txt, .pdf, .html, .docx, .pptx, .csv, .json, .yaml, .yml)
- Processes documents into chunks for efficient retrieval
- Stores documents with metadata in a vector database (FAISS by default)
The main PipelineRun generation tool that:
- Accepts natural language requirements for PipelineRun creation
- Searches the knowledge base for relevant examples and context
- Generates valid Tekton PipelineRun configurations
- Validates and fixes common errors
- Initial Generation: Creates a PipelineRun based on user requirements
- YAML Validation:
- Performs basic YAML syntax validation
- Checks for required Tekton fields and structure
- Optionally uses external Tekton validator for deep validation
- Auto-fixing Process:
- If validation fails, analyzes the error messages
- Automatically generates fixes using context from the knowledge base
- Re-validates the fixed PipelineRun (predefined number of iterations)
- Presents the fixed version for user approval
- Save and Export:
- Saves the validated PipelineRun to a YAML file
- Optionally ingests successful generations into the knowledge base
-
Python Environment:
- Python 3.8+
- UV package installer:
curl -LsSf https://astral.sh/uv/install.sh | sh
-
LlamaStack Server:
- Runs on http://localhost:8321 by default
- Start the server using Docker:
export GEMINI_API_KEY=<your-api-key> docker run -it --rm \ -v ./gemini.yaml:/app/gemini.yaml:z \ -v ${SQLITE_STORE_DIR:-~/.llama/distributions/gemini}:/data \ -e GEMINI_API_KEY=$GEMINI_API_KEY \ -e SQLITE_STORE_DIR=/data \ -p 8321:8321 \ docker.io/llamastack/distribution-starter \ --config gemini.yaml
-
Go Environment (for validator):
- Required for building the Tekton validator binary
- Go 1.x or later
-
Clone the Repository:
git clone https://github.com/redhat-ai-tools/tekton-genie cd tekton-genie -
Build the Validator:
cd validator go build -o validator_bin mv validator_bin ../ cd ..
Ensure the LlamaStack server is running using the Docker command from the Prerequisites section before proceeding with the following steps.
This step processes the Tekton documentation and stores it in the vector database:
uv run --with llama-stack-client ingest_tekton_data.pyuv run --with llama-stack-client generate_tekton_pipeline.py [--validator PATH] [--no-ingest]ex:
uv run --with llama-stack-client generate_tekton_pipeline.py --validator ./validator_bin--validator PATH: Specify path to the Tekton validator binary--no-ingest: Skip ingesting successful PipelineRuns back to RAG system
- The tool will prompt you for your PipelineRun requirements in natural language
- It will generate a PipelineRun based on your requirements
- If validation is enabled, it will validate and potentially fix any issues
- You can review, approve, and save the generated PipelineRun
graph TD
subgraph Ingestion Flow
A[Load Tekton Documents] --> B[Process Documents]
B --> C[Insert into Vector DB]
C --> D[FAISS/Vector Store]
end
subgraph Generation Flow
E[User Requirements] --> F[Search Knowledge Base]
F --> G[Generate PipelineRun]
G --> H[Validate YAML]
H -->|Valid| I[Save PipelineRun]
H -->|Invalid| J[Fix Validation Errors]
J --> H
I -->|Optional| K[Ingest to RAG]
K --> D
end
D --> F
VECTOR_STORE: Vector store provider (default: 'faiss')