%% Argo Workflows - Component Structure Diagram
%% Generated by: Claude Opus 4.6

graph TB
    subgraph "Argo Workflows Component"
        Controller["workflow-controller<br/>(Go Binary - Deployment)<br/>Port: 9090 metrics, 6060 healthz"]
        ArgoExec["argoexec<br/>(Go Binary - Sidecar/Init)<br/>Artifact collection & log capture"]
        ArgoServer["argo-server<br/>(Go Binary - Deployment)<br/>Port: 2746 gRPC/REST"]
        UI["Web UI<br/>(TypeScript/React SPA)<br/>Served by argo-server"]
        ArgoServer --> UI
    end

    subgraph "CRDs (argoproj.io/v1alpha1)"
        WorkflowCR["Workflow CR"]
        WorkflowTemplate["WorkflowTemplate CR"]
        ClusterWorkflowTemplate["ClusterWorkflowTemplate CR"]
        CronWorkflow["CronWorkflow CR"]
        WorkflowEventBinding["WorkflowEventBinding CR"]
        WorkflowTaskSet["WorkflowTaskSet CR"]
        WorkflowTaskResult["WorkflowTaskResult CR"]
        ArtifactGCTask["WorkflowArtifactGCTask CR"]
    end

    DSPAPIServer["DSP API Server"] -->|creates| WorkflowCR
    WorkflowCR -->|watched by| Controller
    CronWorkflow -->|scheduled by| Controller
    WorkflowTemplate -->|referenced by| Controller
    ClusterWorkflowTemplate -->|referenced by| Controller

    Controller -->|creates pods with| ArgoExec
    Controller -->|manages| WorkflowTaskSet
    ArgoExec -->|reports| WorkflowTaskResult
    Controller -->|creates| ArtifactGCTask

    ArgoServer -->|reads/writes| WorkflowCR
    ArgoServer -->|reads/writes| WorkflowTemplate
    ArgoServer -->|reads/writes| CronWorkflow

    %% External Dependencies
    Controller -->|pod CRUD| K8sAPI["Kubernetes API<br/>443/TCP HTTPS"]
    ArgoExec -->|artifact upload| S3["S3/MinIO Storage<br/>443/TCP HTTPS"]
    ArgoServer -->|optional archival| DB["PostgreSQL/MySQL<br/>5432/3306 TCP"]

    %% Internal ODH Dependencies
    DSPOperator["DSP Operator"] -->|deploys & configures| Controller
    DSPOperator -->|deploys & configures| ArgoExec
    MLMD["ML Metadata (MLMD)"] -.->|sidecar in workflow pods| ArgoExec

    %% Monitoring
    Prometheus["Prometheus"] -->|scrapes :9090| Controller

    style Controller fill:#4a90e2,color:#fff
    style ArgoExec fill:#4a90e2,color:#fff
    style ArgoServer fill:#4a90e2,color:#fff
    style UI fill:#4a90e2,color:#fff
    style WorkflowCR fill:#f5a623,color:#fff
    style WorkflowTemplate fill:#f5a623,color:#fff
    style ClusterWorkflowTemplate fill:#f5a623,color:#fff
    style CronWorkflow fill:#f5a623,color:#fff
    style WorkflowEventBinding fill:#f5a623,color:#fff
    style WorkflowTaskSet fill:#f5a623,color:#fff
    style WorkflowTaskResult fill:#f5a623,color:#fff
    style ArtifactGCTask fill:#f5a623,color:#fff
    style K8sAPI fill:#e8e8e8
    style S3 fill:#e8e8e8
    style DB fill:#e8e8e8
    style DSPOperator fill:#7ed321,color:#fff
    style DSPAPIServer fill:#7ed321,color:#fff
    style MLMD fill:#7ed321,color:#fff
    style Prometheus fill:#e8e8e8
