# hitachienergy/epiphany architecture

> Architecture diagram of the GitHub repository hitachienergy/epiphany, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hitachienergy/epiphany
- Repository: https://github.com/hitachienergy/epiphany

## Overview

Epiphany is a manifest-driven platform automation CLI for provisioning and operating Kubernetes clusters and supporting services on AWS, Azure, or on-premises. The principal workflow is to initialize a cluster manifest, apply it to generate infrastructure and configuration, and then optionally back up, recover, upgrade, or delete the deployment. The graph includes manifest validation and provider infrastructure generation as internal layers, plus the separately implemented requirements downloader. Source excerpts and the README support the shown links; unsampled implementations are represented only at paths present in the tree.

Main entry points: [`cli/src/commands/Apply.py`](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/commands/Apply.py) (Apply cluster), [`cli/epicli.py`](https://github.com/hitachienergy/epiphany/blob/develop/cli/epicli.py) (Epicli entry), [`cli/src/providers/provider_class_loader.py`](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/provider_class_loader.py) (Provider loader), [`ansible/playbooks/roles/repository/files/download-requirements/src/run.py`](https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/run.py) (Requirements runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_epicli["Epicli entry<br/>[epicli.py]"]
  node_init["Initialize<br/>[Init.py]"]
  node_apply["Apply cluster<br/>[Apply.py]"]
  node_lifecycle["Other lifecycle commands"]
end

subgraph group_config["Manifest and configuration"]
  node_manifest["Manifest handler<br/>[ManifestHandler.py]"]
  node_schema["Schema validation<br/>[SchemaValidator.py]"]
  node_defaults["Default merging<br/>[DefaultMerger.py]"]
  node_data["Data and templates<br/>[data_loader.py]"]
end

subgraph group_infra["Infrastructure providers"]
  node_provider_loader["Provider loader"]
  node_aws["AWS builder"]
  node_azure["Azure builder"]
  node_any["Generic builder"]
  node_terraform["Terraform execution<br/>[TerraformRunner.py]"]
end

subgraph group_automation["Configuration automation"]
  node_ansible_vars["Ansible variables"]
  node_ansible_runner["Ansible execution<br/>[AnsibleRunner.py]"]
  node_build_io["Build artifacts<br/>[build_io.py]"]
end

subgraph group_requirements["Requirements downloader"]
  node_requirements_cli["Requirements entry"]
  node_requirements_run["Requirements runner<br/>[run.py]"]
  node_manifest_reader["Requirements manifest<br/>[manifest_reader.py]"]
  node_toolchain["OS toolchain<br/>[toolchain.py]"]
  node_downloader["Package downloader<br/>[downloader.py]"]
end

node_user(("Operator"))

node_user -->|"runs commands"| node_epicli
node_epicli -->|"dispatches"| node_init
node_epicli -->|"dispatches"| node_apply
node_epicli -->|"dispatches"| node_lifecycle
node_init -->|"creates manifest"| node_user
node_apply -->|"loads and updates"| node_manifest
node_apply -->|"merges defaults"| node_defaults
node_apply -->|"validates"| node_schema
node_apply -->|"loads provider"| node_provider_loader
node_apply -->|"runs Terraform"| node_terraform
node_apply -->|"runs Ansible"| node_ansible_runner
node_provider_loader -->|"loads implementation"| node_aws
node_provider_loader -->|"loads implementation"| node_azure
node_provider_loader -->|"loads implementation"| node_any
node_aws -->|"loads configuration"| node_data
node_azure -->|"loads configuration"| node_data
node_manifest -->|"reads and writes YAML"| node_data
node_ansible_vars -->|"loads defaults"| node_data
node_ansible_vars -->|"writes build files"| node_build_io
node_apply -->|"loads inventory"| node_build_io
node_requirements_cli -->|"starts run"| node_requirements_run
node_requirements_run -.->|"reads requirements"| node_manifest_reader
node_requirements_run -.->|"uses commands"| node_toolchain
node_requirements_run -.->|"downloads artifacts"| node_downloader

click node_epicli "https://github.com/hitachienergy/epiphany/blob/develop/cli/epicli.py"
click node_init "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/commands/Init.py"
click node_apply "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/commands/Apply.py"
click node_lifecycle "https://github.com/hitachienergy/epiphany/tree/develop/cli/src/commands"
click node_manifest "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/schema/ManifestHandler.py"
click node_schema "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/schema/SchemaValidator.py"
click node_defaults "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/schema/DefaultMerger.py"
click node_data "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/helpers/data_loader.py"
click node_provider_loader "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/provider_class_loader.py"
click node_aws "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/aws/InfrastructureBuilder.py"
click node_azure "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/azure/InfrastructureBuilder.py"
click node_any "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/any/InfrastructureBuilder.py"
click node_terraform "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/terraform/TerraformRunner.py"
click node_ansible_vars "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/ansible/AnsibleVarsGenerator.py"
click node_ansible_runner "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/ansible/AnsibleRunner.py"
click node_build_io "https://github.com/hitachienergy/epiphany/blob/develop/cli/src/helpers/build_io.py"
click node_requirements_cli "https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/download-requirements.py"
click node_requirements_run "https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/run.py"
click node_manifest_reader "https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/config/manifest_reader.py"
click node_toolchain "https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/command/toolchain.py"
click node_downloader "https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/downloader/downloader.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_epicli,node_init,node_apply,node_lifecycle toneBlue
class node_manifest,node_schema,node_defaults,node_data toneAmber
class node_provider_loader,node_aws,node_azure,node_any,node_terraform toneMint
class node_ansible_vars,node_ansible_runner,node_build_io toneRose
class node_requirements_cli,node_requirements_run,node_manifest_reader,node_toolchain,node_downloader,node_user toneIndigo
```

## Components

### CLI workflows

- [Epicli entry](https://github.com/hitachienergy/epiphany/blob/develop/cli/epicli.py): `cli/epicli.py`
- [Initialize](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/commands/Init.py): `cli/src/commands/Init.py`
- [Apply cluster](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/commands/Apply.py): `cli/src/commands/Apply.py`
- [Other lifecycle commands](https://github.com/hitachienergy/epiphany/tree/develop/cli/src/commands): `cli/src/commands`

### Manifest and configuration

- [Manifest handler](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/schema/ManifestHandler.py): `cli/src/schema/ManifestHandler.py`
- [Schema validation](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/schema/SchemaValidator.py): `cli/src/schema/SchemaValidator.py`
- [Default merging](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/schema/DefaultMerger.py): `cli/src/schema/DefaultMerger.py`
- [Data and templates](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/helpers/data_loader.py): `cli/src/helpers/data_loader.py`

### Infrastructure providers

- [Provider loader](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/provider_class_loader.py): `cli/src/providers/provider_class_loader.py`
- [AWS builder](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/aws/InfrastructureBuilder.py): `cli/src/providers/aws/InfrastructureBuilder.py`
- [Azure builder](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/azure/InfrastructureBuilder.py): `cli/src/providers/azure/InfrastructureBuilder.py`
- [Generic builder](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/providers/any/InfrastructureBuilder.py): `cli/src/providers/any/InfrastructureBuilder.py`
- [Terraform execution](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/terraform/TerraformRunner.py): `cli/src/terraform/TerraformRunner.py`

### Configuration automation

- [Ansible variables](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/ansible/AnsibleVarsGenerator.py): `cli/src/ansible/AnsibleVarsGenerator.py`
- [Ansible execution](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/ansible/AnsibleRunner.py): `cli/src/ansible/AnsibleRunner.py`
- [Build artifacts](https://github.com/hitachienergy/epiphany/blob/develop/cli/src/helpers/build_io.py): `cli/src/helpers/build_io.py`

### Requirements downloader

- [Requirements entry](https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/download-requirements.py): `ansible/playbooks/roles/repository/files/download-requirements/download-requirements.py`
- [Requirements runner](https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/run.py): `ansible/playbooks/roles/repository/files/download-requirements/src/run.py`
- [Requirements manifest](https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/config/manifest_reader.py): `ansible/playbooks/roles/repository/files/download-requirements/src/config/manifest_reader.py`
- [OS toolchain](https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/command/toolchain.py): `ansible/playbooks/roles/repository/files/download-requirements/src/command/toolchain.py`
- [Package downloader](https://github.com/hitachienergy/epiphany/blob/develop/ansible/playbooks/roles/repository/files/download-requirements/src/downloader/downloader.py): `ansible/playbooks/roles/repository/files/download-requirements/src/downloader/downloader.py`

### Other components

- **Operator**

## Connections

- Operator → Epicli entry: runs commands
- Epicli entry → Initialize: dispatches (evidence: `cli/epicli.py`)
- Epicli entry → Apply cluster: dispatches (evidence: `cli/epicli.py`)
- Epicli entry → Other lifecycle commands: dispatches (evidence: `cli/epicli.py`)
- Initialize → Operator: creates manifest
- Apply cluster → Manifest handler: loads and updates (evidence: `cli/src/commands/Apply.py`)
- Apply cluster → Default merging: merges defaults (evidence: `cli/src/commands/Apply.py`)
- Apply cluster → Schema validation: validates (evidence: `cli/src/commands/Apply.py`)
- Apply cluster → Provider loader: loads provider (evidence: `cli/src/commands/Apply.py`)
- Apply cluster → Terraform execution: runs Terraform (evidence: `cli/src/commands/Apply.py`)
- Apply cluster → Ansible execution: runs Ansible (evidence: `cli/src/commands/Apply.py`)
- Provider loader → AWS builder: loads implementation
- Provider loader → Azure builder: loads implementation
- Provider loader → Generic builder: loads implementation
- AWS builder → Data and templates: loads configuration (evidence: `cli/src/providers/aws/InfrastructureBuilder.py`)
- Azure builder → Data and templates: loads configuration (evidence: `cli/src/providers/azure/InfrastructureBuilder.py`)
- Manifest handler → Data and templates: reads and writes YAML (evidence: `cli/src/schema/ManifestHandler.py`)
- Ansible variables → Data and templates: loads defaults (evidence: `cli/src/ansible/AnsibleVarsGenerator.py`)
- Ansible variables → Build artifacts: writes build files (evidence: `cli/src/ansible/AnsibleVarsGenerator.py`)
- Apply cluster → Build artifacts: loads inventory (evidence: `cli/src/commands/Apply.py`)
- Requirements entry → Requirements runner: starts run (evidence: `ansible/playbooks/roles/repository/files/download-requirements/download-requirements.py`)
- Requirements runner → Requirements manifest: reads requirements
- Requirements runner → OS toolchain: uses commands
- Requirements runner → Package downloader: downloads artifacts
