GroundX On-Prem Documentation

repository·main·Indexed 21 days ago

https://github.com/eyelevelai/groundx-on-prem

A Kubernetes-based infrastructure-as-code solution for deploying AI-driven RAG document ingestion and search services. It includes tools for managing AWS VPCs and EKS clusters via bin/environment, service deployment via bin/operator, and Helm charts for GroundX Ingest, Store, and Search. The documentation covers installation, configuration for various deployment scenarios (AWS, OpenAI, Hybrid), and the setup of Prometheus and Grafana for metrics monitoring.

Tokens
29.3K
Snippets
62
Records
144
Agent score
74%

What's inside GroundX On-Prem

  1. Overview of GroundX Terraform Directory

    main
    The terraform/groundx-operator/operator/app/groundx/ directory contains the Terraform configuration required to deploy and manage the GroundX service on Kubernetes. The configuration is designed to be flexible, supporting both standard Kubernetes and OpenShift environments. It uses Helm for component deployment and allows users to choose between deploying internal services (like Redis, databases, or search engines) or connecting to existing external services.
  2. Overview of the Layout Service components

    main

    The Layout service is responsible for processing and analyzing document layouts, including OCR (Optical Character Recognition) capabilities. It is deployed via Terraform to Kubernetes or OpenShift environments and consists of four primary services:

    • Layout API Service: Manages the API interface and cache dependencies.
    • Layout Inference Service: Handles machine learning inference tasks and requires GPU resources.
    • Layout OCR Service: Performs text recognition (note: this is not deployed if Google OCR is used).
    • Layout Process Service: Manages document processing tasks and dynamic queue configuration.
  3. What is GroundX On-Prem?

    main

    GroundX On-Prem is a Kubernetes-based deployment for RAG (Retrieval-Augmented Generation) document ingestion and search capabilities. It is designed to run in isolated or air-gapped environments without external dependencies.

    The system consists of three core components:

    1. GroundX Ingest: A vision model optimized for document understanding that converts complex documents into queryable representations for LLMs.
    2. GroundX Store: Secure, encrypted storage for source files, semantic objects, and vectors.
    3. GroundX Search: A search service built on OpenSearch that combines text and vector search with a fine-tuned re-ranker model.

    Deployment typically involves two steps:

    1. (Optional) Infrastructure creation on AWS via Terraform.
    2. Deployment of GroundX onto Kubernetes via Helm.
  4. Understand the GroundX Services directory structure

    main

    The services/ directory contains the Infrastructure-as-Code (IaC) configurations for deploying and managing the EyeLevel application ecosystem. Each subdirectory is managed via Terraform and Helm charts and represents a specific component.

    Common files found in each service subdirectory include:

    • variables.tf: Input variables for the service.
    • main.tf (or service-specific files like redis.tf): Main Terraform resource definitions.
    • outputs.tf: Terraform module outputs.
    services/
    ├── cache/
    ├── db/
    ├── file/
    ├── search/
    └── stream/
  5. How the Operator Init workflow works

    main

    The initialization process follows a specific dependency chain:

    1. Module Path Definition: The root locals.tf establishes the base module path.
    2. Foundational Setup (add subdirectory): Sets up core Kubernetes resources such as the namespace, SSL certificates (Self-signed CA and Service certificates), and local storage classes.
    3. Configuration Generation (config subdirectory): Generates service-specific configuration files (e.g., config.yaml, Layout, Ranker, and Summary service configs) and stores them in Kubernetes ConfigMaps.
    4. Database Initialization: Creates a database initialization script (init-db.sql) and stores it in a Kubernetes ConfigMap for first-time database setup.
  6. Summary Client service security and environment compatibility

    main

    The Summary Client service is designed for cross-platform compatibility between standard Kubernetes and OpenShift.

    Environment Handling

    • OpenShift: Security contexts are automatically adjusted if an OpenShift environment is detected.
    • User/Group IDs: The service runs with specific user and group IDs that are automatically set based on the cluster type.

    Security Requirements

    • Ensure appropriate RBAC (Role-Based Access Control) permissions are configured to allow the service to interact with other cluster components.
  7. Security and RBAC for the Process service

    main

    The Process service includes automated security handling:

    • Security Contexts: The configuration automatically detects if it is running in an OpenShift or standard Kubernetes environment and adjusts security contexts accordingly.
    • User/Group IDs: The service runs with specific user and group IDs determined by the cluster type.
    • RBAC: You must ensure that the necessary Role-Based Access Control (RBAC) permissions are configured to allow the service to interact with other components in your cluster.
  8. How the Stream directory manages Kafka deployment

    main

    The Stream directory manages Apache Kafka configuration for the EyeLevel application using the Strimzi operator. The deployment workflow follows these steps:

    1. Determine Kafka Deployment: The system checks if stream_existing is provided. If not, it prepares to create a new Kafka deployment.
    2. Configure Kafka Settings: It combines settings from an existing Kafka instance (if provided) with internal defaults.
    3. Deploy Strimzi Operator: If a new deployment is required, the Strimzi Operator is deployed via Helm.
    4. Deploy Kafka Cluster: If a new deployment is required, the Kafka Cluster is deployed via Helm using the specified configurations.
  9. Understand the GroundX Ingestion and Search Data Flow

    main

    GroundX operates via two primary data paths:

    Ingestion Pipeline

    Documents flow through a multi-stage pipeline that scales based on throughput:

    1. Upload: API receives file $\rightarrow$ stored in MinIO/S3 $\rightarrow$ queued in Kafka/SQS.
    2. Processing: Celery workers handle pre-processing and layout extraction (using Tesseract and GPU vision models).
    3. Summarization: A summary client triggers the summary-api, which uses either an on-prem vLLM (GPU) or external providers like OpenAI/Azure.
    4. Persistence: Final data is stored in OpenSearch (vectors/text), MySQL (metadata), and MinIO/S3 (objects).

    Search Path

    1. API/Load Balancer receives the query.
    2. OpenSearch performs a hybrid query.
    3. Ranker-api performs re-ranking using a GPU re-ranker model.
    4. Results are returned to the user.
  10. Configure Node Groups with eyelevel_node labels

    main

    GroundX pods use node selector labels and tolerations to deploy to specific nodes. You must apply labels to your nodes using the key eyelevel_node with one of the following enumerated string values:

    • eyelevel-cpu-only
    • eyelevel-cpu-memory
    • eyelevel-gpu-layout
    • eyelevel-gpu-ranker
    • eyelevel-gpu-summary

    Note: All required node labels must exist on at least one node group within your cluster. If you use custom labels instead of the defaults, you must update all corresponding service node keys in values.yaml (e.g., layout.inference.node, ranker.inference.node, etc.).

    nodeSelector:
      eyelevel_node: "eyelevel-cpu-only"
    tolerations:
      - key: "eyelevel_node"
        value: "eyelevel-cpu-only"
        effect: "NoSchedule"
  11. How the Operator Init directory handles conditional resource creation

    main

    The init directory in the GroundX operator uses Terraform conditional logic to decide whether to provision new infrastructure services or connect to existing ones.

    Integration vs. Provisioning Logic

    For most core services (Cache, Database, File Storage, Search, Streaming, and Summary), the operator follows a pattern: if you provide a complete set of connection details for an existing service via the *_existing variables, the operator will skip provisioning a new instance and instead use your provided values. If any required parameter is missing (null), the operator sets a create_* flag to true and provisions the service internally.

    Key Decision Variables

    • Storage Class: Created only if var.app_internal.pv_class is not set to "empty".
    • OCR Credentials: A kubernetes_config_map for layout_ocr_credentials is only created if var.layout.ocr.type is "google" and the credentials path is not empty.
    • Cluster Type: The is_openshift local variable is derived from var.cluster.type == "openshift", allowing for platform-specific configurations.