# ai-solution-eng/frameworks architecture

> Architecture diagram of the GitHub repository ai-solution-eng/frameworks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ai-solution-eng/frameworks
- Repository: https://github.com/ai-solution-eng/frameworks

## Overview

##### Project type and purpose
- This is not a full-stack application but an open-source “packaging and deployment” tool: a repository of Helm charts for multiple frameworks, each adapted (“ported”) to deploy on HPE Ezmeral Container Platform (PCAI).
- Its goal is to provide versioned charts, porting documentation, and packaged artifacts (tar.gz) so that end users or CI pipelines can import these frameworks into PCAI.

##### File structure
- Top-level entries are framework folders (argo-cd, grafana, langflow, minio, open-webui, postgresql, triton-inference-server, weaviate).
- Inside each framework folder:
- A logo file (used by PCAI import UI)
- A porting.md document (describing how customizations were made)
- A versioned subfolder (x.y.z) containing a Helm chart directory structure (Chart.yaml, values.yaml, templates/, ci/)
- A packaged tar.gz of the chart (FRAMEWORK-x.y.z.tar.gz)
- The uniform pattern implies a templated pipeline that: checks out source → builds Helm charts → packages artifacts → publishes to PCAI.

##### README for additional insights
- Confirms that each framework is ported to PCAI, with pointers to HPE docs and tutorial references.
- No runtime code here: it’s all chart definitions and porting guides.

##### Components
a. Source repository (Git)
b. Continuous Integration/Delivery pipeline
– Chart linting & validation (helm lint, tests/*)
– Packaging (helm package)
– Artifact storage (Helm chart repository or OCI registry)
c. PCAI Import Service
– UI or API that ingests tar.gz + logo + porting.md
– Persists chart into the PCAI catalog
d. Target PCAI Kubernetes Cluster(s)
– When a user selects a framework, the chart is deployed via Helm, creating Deployments, StatefulSets, Services, CRDs, etc.
e. Framework components (inside each chart)
– Kubernetes resources in templates/ (Deployments, Services, Ingress, ConfigMaps, RBAC, PodMonitors, etc.)
– CI overrides for different scenarios (ci/*.yaml)

##### Relationships and interactions
- Developers push chart source → CI pipeline runs → produces FRAMEWORK-x.y.z.tar.gz + index update → publishes to chart repo.
- PCAI Import Service polls or receives webhook from chart repo → imports chart metadata + logo + porting.md.
- End users deploy charts from PCAI catalog → Helm client in PCAI invokes Kubernetes API to create resources on target cluster.
- Dependencies between components: CI depends on repo, PCAI depends on chart repo, Helm depends on Kubernetes.

##### Architectural patterns and design principles
- Template-driven configuration (Helm’s values + templates)
- Versioned artifacts (x.y.z folder + tar.gz)
- Separation of concerns: chart authorship vs. chart packaging vs. chart import vs. chart deployment
- Extensibility: adding a new framework simply means adding a new top-level folder with the same structure.

##### Technologies, frameworks, or libraries
- Helm v3
- Kubernetes API objects (Deployments, StatefulSets, Services, Ingresses, RBAC, NetworkPolicies, etc.)
- PCAI Import API/UI (HPE Ezmeral)
- CI tools (e.g., GitHub Actions, Jenkins)—referenced by the presence of ci/*.yaml

##### Detail without over-segmentation
- **logical layer** (Source → Build → Store → Import → Deploy)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source & Chart Authoring Layer
    subgraph "Source & Chart Authoring" 
        style SourceLayer fill:#DCEEFB,stroke:#90CAF9
        GitRepo["Git Repository"]:::blue
        README["README.md"]:::rect
        GitRepo --> README

        subgraph "Argo CD Chart Source"
            AChart["Chart.yaml"]:::rect
            AValues["values.yaml"]:::rect
            ATemplates["templates/"]:::rect
            APort["porting.md"]:::rect
            ALogo["logo.*"]:::rect
        end

        subgraph "Grafana Chart Source"
            GChart["Chart.yaml"]:::rect
            GValues["values.yaml"]:::rect
            GTemplates["templates/"]:::rect
            GPort["porting.md"]:::rect
            GLogo["logo.*"]:::rect
        end

        GitRepo --> AChart
        GitRepo --> GChart
        GitRepo --> APort
        GitRepo --> GPort
    end

    %% CI/CD Pipeline Layer
    subgraph "CI/CD Pipeline" 
        style CiLayer fill:#E3FCEF,stroke:#66BB6A
        Lint["Lint & Validate\n(helm lint, tests/)"]:::blue
        Package["Package Charts\n(helm package)"]:::blue
        Lint --> Package

        AChart --> Lint
        GChart --> Lint
        AValues --> Lint
        GValues --> Lint

        subgraph "CI Config"
            ACI["argo-cd/7.8.28/ci/"]:::rect
            GCI["grafana/8.15.0/ci/"]:::rect
        end
        Lint --> ACI
        Lint --> GCI
        Package --> Atgz["argo-cd-7.8.28.tgz"]:::orange
        Package --> Gtargz["grafana-8.15.0.tar.gz"]:::orange
    end

    %% Artifact Storage Layer
    subgraph "Artifact Storage (Helm Repo/OCI)" 
        style StoreLayer fill:#FFF3E0,stroke:#FFA726
        ChartRepo["Chart Repository\n/ OCI Registry"]:::cylinder
        Atgz --> ChartRepo
        Gtargz --> ChartRepo
    end

    %% PCAI Import Layer
    subgraph "PCAI Import Service" 
        style ImportLayer fill:#E8EAF6,stroke:#5C6BC0
        ImportAPI["Import API/UI"]:::green
        ChartRepo -->|pull tar.gz + porting.md + logo| ImportAPI
        ImportAPI --> Catalog["PCAI Catalog"]:::cylinder
    end

    %% Deployment Layer
    subgraph "PCAI Kubernetes Cluster" 
        style RuntimeLayer fill:#E0F7FA,stroke:#26C6DA
        Catalog -->|helm install| HelmClient["Helm Client"]:::green
        HelmClient --> K8sAPI["Kubernetes API"]:::green
        subgraph "K8s Resources"
            Deploy["Deployment"]:::rect
            Service["Service"]:::rect
            Ingress["Ingress"]:::rect
            RBAC["RBAC"]:::rect
            CRD["CRD/Custom Resources"]:::rect
        end
        K8sAPI --> Deploy
        K8sAPI --> Service
        K8sAPI --> Ingress
        K8sAPI --> RBAC
        K8sAPI --> CRD
    end

    %% Connections across layers
    GitRepo -->|push| Lint
    Package --> ChartRepo
    ImportAPI --> Catalog
    Catalog --> HelmClient

    %% Click Events
    click README "https://github.com/ai-solution-eng/frameworks/blob/main/README.md"
    click AChart "https://github.com/ai-solution-eng/frameworks/blob/main/argo-cd/7.8.28/Chart.yaml"
    click AValues "https://github.com/ai-solution-eng/frameworks/blob/main/argo-cd/7.8.28/values.yaml"
    click ATemplates "https://github.com/ai-solution-eng/frameworks/tree/main/argo-cd/7.8.28/templates/"
    click APort "https://github.com/ai-solution-eng/frameworks/blob/main/argo-cd/porting.md"
    click ACI "https://github.com/ai-solution-eng/frameworks/tree/main/argo-cd/7.8.28/ci/"
    click Atgz "https://github.com/ai-solution-eng/frameworks/blob/main/argo-cd/argo-cd-7.8.28.tgz"

    click GChart "https://github.com/ai-solution-eng/frameworks/blob/main/grafana/8.15.0/Chart.yaml"
    click GValues "https://github.com/ai-solution-eng/frameworks/blob/main/grafana/8.15.0/values.yaml"
    click GTemplates "https://github.com/ai-solution-eng/frameworks/tree/main/grafana/8.15.0/templates/"
    click GPort "https://github.com/ai-solution-eng/frameworks/blob/main/grafana/porting.md"
    click GCI "https://github.com/ai-solution-eng/frameworks/tree/main/grafana/8.15.0/ci/"
    click Gtargz "https://github.com/ai-solution-eng/frameworks/blob/main/grafana/grafana-8.15.0.tar.gz"

    %% Styles
    classDef blue fill:#BBDEFB,stroke:#1976D2,color:#000
    classDef green fill:#C8E6C9,stroke:#2E7D32,color:#000
    classDef orange fill:#FFE0B2,stroke:#EF6C00,color:#000
    classDef cylinder shape:cylinder,fill:#FFF3E0,stroke:#FFA726
    classDef rect shape:rect
    classDef CiLayer fill:#E3FCEF,stroke:#66BB6A
    classDef SourceLayer fill:#DCEEFB,stroke:#90CAF9
    classDef StoreLayer fill:#FFF3E0,stroke:#FFA726
    classDef ImportLayer fill:#E8EAF6,stroke:#5C6BC0
    classDef RuntimeLayer fill:#E0F7FA,stroke:#26C6DA
```
