# dell/omnia architecture

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

- Interactive diagram: https://gitdiagram.com/dell/omnia
- Repository: https://github.com/dell/omnia

## Overview

1. **What this repository is**
   Omnia is a monorepo for deploying and operating HPC-style Linux clusters. The architecture is split between a Python control plane and a large Ansible automation layer that provisions hosts, builds images, configures services, and manages upgrades.

2. **Primary control-plane package: `build_stream/`**
   This is the main Python application. It contains the runtime entrypoint, HTTP API, domain logic, orchestration layer, and infrastructure adapters. The package is organized with a clean-architecture style: API routes call orchestrator use cases, which depend on core domain services and abstract repositories.

3. **HTTP/API boundary**
   The `build_stream/api/*` modules expose endpoints for auth, catalog parsing, input-file generation, build-image requests, jobs, local repo management, and validation. Each API area has its own `routes`, `schemas`, and `dependencies`, which indicates a strict boundary between transport concerns and business logic.

4. **Application/orchestration layer**
   `build_stream/orchestrator/*` contains command and use-case objects for the main workflows:
   - parse catalogs
   - generate input files
   - create jobs
   - create local repositories
   - build images
   - validate images
   These use cases coordinate domain services, repositories, and result polling, rather than implementing the business rules directly in the API layer.

5. **Domain model areas**
   The `build_stream/core/*` tree is divided by business capability:
   - `catalog`: parse/generate/adapter logic for software catalogs and schemas
   - `build_image`: entities, services, repositories, value objects for image creation
   - `jobs`: job, stage, audit, and idempotency modeling
   - `localrepo`: local package repository concepts and services
   - `validate`: image validation concepts
   - `artifacts`: shared artifact abstractions and value objects
   This is the center of the application’s business rules.

6. **Infrastructure and persistence**
   `build_stream/infra/*` provides the concrete adapters:
   - database persistence with Alembic migrations, models, session, mappers, and repositories
   - file-based and in-memory artifact stores
   - NFS-backed repositories for input directories and playbook queue/request/result data
   - ID generation and Vault client integration
   This is where the app touches durable state and external storage.

7. **Authentication and secrets**
   Auth is handled inside `build_stream/api/auth/` with JWT and password handlers. The presence of a Vault client suggests secrets are not stored only in config files; the system can retrieve or manage credentials externally when preparing deployment inputs.

8. **Ansible-based operational workflows**
   The repository’s runtime work is mostly executed through playbooks:
   - `prepare_oim/` boots the platform and deploys containers
   - `input_validation/` validates user-provided cluster input
   - `local_repo/` creates package mirrors and metadata
   - `build_image_x86_64/` and `build_image_aarch64/` build OS images per architecture
   - `discovery/` configures discovered nodes and cluster services
   - `telemetry/` deploys and manages telemetry infrastructure
   - `upgrade/` performs migration/rollback flows
   These playbooks are the execution plane behind the Python control plane.

9. **Deployment/container stack in `prepare_oim/`**
   This area assembles the initial OIM environment by deploying containers for:
   - authentication
   - build_stream
   - PostgreSQL
   - Pulp
   - OpenChami
   It also installs supporting services like a watcher service and performs prerequisite, firewall, and networking setup. This is the bootstrap layer that makes the Python API and the rest of the system available.

10. **Cluster configuration and discovery layer**
   `discovery/` is where the system turns validated inputs and generated artifacts into node and service configuration. It contains roles for Slurm, OpenLDAP, passwordless SSH, telemetry, NFS client setup, and Kubernetes configuration. The outputs here are mostly rendered YAML, config files, and service definitions consumed by the target cluster.

11. **Shared Ansible libraries and modules**
   The `common/` and `utils/` trees provide reusable Ansible module_utils, custom modules, templates, and helper playbooks. They cover input parsing, catalog generation, local repo operations, credential handling, functional group generation, cleanup, PXE boot setup, and Slurm backup/rollback utilities. This shared layer is the glue between higher-level playbooks.

12. **Input/data flow**
   The repository treats `input/` and `examples/` as the source-of-truth for deployment parameters. Typical flow is:
   user input files and catalog data → validation → generated input/config artifacts → orchestration/API requests → Ansible execution → cluster services, images, repos, and telemetry.  
   The `build_stream` app stores metadata and job state, while Ansible consumes rendered files to act on remote systems.

13. **External systems and services**
   The architecture integrates with several external components that materially shape the design:
   - PostgreSQL for job/artifact metadata
   - NFS for playbook and input file exchange
   - Pulp for package repository hosting
   - Vault for secrets
   - Slurm, Kubernetes/OpenChami, OpenLDAP, GitLab, and telemetry backends
   - telemetry stack components such as Kafka and VictoriaMetrics/LDMS in the telemetry roles
   These are not incidental dependencies; they are the environment the system configures and manages.

14. **Quality gates and delivery**
   The repo has extensive unit, integration, and end-to-end tests for both the Python package and Ansible flows, plus CI workflows for linting. That suggests the architecture is intentionally modular, with strong boundary testing between API, orchestration, core logic, and infrastructure adapters.

Main entry points: [`build_stream/orchestrator/catalog/use_cases`](https://github.com/dell/omnia/tree/main/build_stream/orchestrator/catalog/use_cases) (Catalog use cases), [`build_stream/core`](https://github.com/dell/omnia/tree/main/build_stream/core) (Domain core), [`build_stream/api`](https://github.com/dell/omnia/tree/main/build_stream/api) (API layer), [`build_stream/orchestrator/build_image/use_cases`](https://github.com/dell/omnia/tree/main/build_stream/orchestrator/build_image/use_cases) (Build use cases)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_control_plane["Python control plane"]
  node_node_main["Main entry<br/>python entrypoint<br/>[main.py]"]
  node_node_api["API layer<br/>http boundary"]
  node_node_orchestrator["Orchestrator<br/>use cases"]
  node_node_core["Domain core<br/>business model"]
  node_node_infra["Infrastructure<br/>adapters"]
  node_node_auth["Auth<br/>jwt/password"]
  node_node_catalog_api["Catalog API<br/>catalog endpoints"]
  node_node_jobs_api["Jobs API<br/>job endpoints"]
  node_node_build_api["Build-image API<br/>image endpoints"]
  node_node_catalog_uc["Catalog use cases<br/>catalog orchestration"]
  node_node_job_uc["Job use cases<br/>job orchestration"]
  node_node_build_uc["Build use cases<br/>image orchestration"]
  node_node_validate_uc["Validate use cases<br/>validation orchestration"]
  node_node_catalog_core["Catalog core<br/>parser/generator"]
  node_node_build_core["Build-image core<br/>image domain"]
  node_node_jobs_core["Jobs core<br/>job domain"]
  node_node_localrepo_core["Localrepo core<br/>repo domain"]
  node_node_validate_core["Validate core<br/>validation domain"]
end

subgraph group_grp_ansible_flows["Ansible workflows"]
  node_node_prepare["Prepare OIM<br/>bootstrap playbook<br/>[prepare_oim.yml]"]
  node_node_discovery["Discovery<br/>cluster config<br/>[discovery.yml]"]
  node_node_local_repo["Local repo<br/>repo workflow<br/>[local_repo.yml]"]
  node_node_input_validation["Input validation<br/>validation workflow"]
  node_node_build_x86["Build image x86<br/>image workflow"]
  node_node_build_arm["Build image arm<br/>image workflow"]
  node_node_telemetry["Telemetry<br/>observability workflow<br/>[telemetry.yml]"]
  node_node_upgrade["Upgrade<br/>migration workflow<br/>[upgrade_omnia.yml]"]
end

subgraph group_grp_shared_ansible["Shared Ansible layer"]
  node_node_common["Common libs<br/>shared ansible code"]
  node_node_utils["Utils<br/>ops helpers"]
  node_node_examples["Examples<br/>input templates"]
end

subgraph group_grp_external["External systems"]
  node_node_postgres[("PostgreSQL<br/>metadata store")]
  node_node_nfs[("NFS<br/>shared filesystem")]
  node_node_pulp[("Pulp<br/>package repo")]
  node_node_vault[("Vault<br/>secrets manager")]
  node_node_slurm["Slurm<br/>scheduler"]
end

node_node_main -->|"serves"| node_node_api
node_node_api -->|"auth"| node_node_auth
node_node_api -->|"catalog"| node_node_catalog_uc
node_node_api -->|"jobs"| node_node_jobs_api
node_node_api -->|"build"| node_node_build_api
node_node_orchestrator -->|"contains"| node_node_catalog_uc
node_node_orchestrator -->|"contains"| node_node_job_uc
node_node_orchestrator -->|"contains"| node_node_build_uc
node_node_orchestrator -->|"contains"| node_node_validate_uc
node_node_catalog_uc -->|"uses"| node_node_catalog_core
node_node_catalog_uc -->|"stores"| node_node_infra
node_node_job_uc -->|"uses"| node_node_jobs_core
node_node_job_uc -->|"persists"| node_node_postgres
node_node_build_uc -->|"uses"| node_node_build_core
node_node_build_uc -->|"publishes"| node_node_pulp
node_node_validate_uc -->|"uses"| node_node_validate_core
node_node_infra -->|"db"| node_node_postgres
node_node_infra -->|"nfs"| node_node_nfs
node_node_infra -->|"secrets"| node_node_vault
node_node_core -->|"includes"| node_node_catalog_core
node_node_core -->|"includes"| node_node_build_core
node_node_core -->|"includes"| node_node_jobs_core
node_node_core -->|"includes"| node_node_localrepo_core
node_node_core -->|"includes"| node_node_validate_core
node_node_prepare -->|"deploys"| node_node_postgres
node_node_prepare -->|"deploys"| node_node_pulp
node_node_prepare -->|"integrates"| node_node_vault
node_node_prepare -->|"bootstraps"| node_node_main
node_node_input_validation -->|"uses"| node_node_common
node_node_local_repo -->|"uses"| node_node_common
node_node_discovery -->|"uses"| node_node_common
node_node_discovery -->|"configures"| node_node_slurm
node_node_discovery -->|"configures"| node_node_telemetry
node_node_telemetry -->|"uses"| node_node_common
node_node_upgrade -->|"uses"| node_node_utils
node_node_examples -.->|"feeds"| node_node_input_validation
node_node_examples -.->|"feeds"| node_node_catalog_uc
node_node_input_validation -->|"enables"| node_node_catalog_uc
node_node_catalog_uc -->|"orchestrates"| node_node_prepare
node_node_build_uc -->|"dispatches"| node_node_build_x86
node_node_build_uc -->|"dispatches"| node_node_build_arm
node_node_localrepo_core -->|"drives"| node_node_local_repo
node_node_validate_core -->|"supports"| node_node_input_validation

click node_node_main "https://github.com/dell/omnia/blob/main/build_stream/main.py"
click node_node_api "https://github.com/dell/omnia/tree/main/build_stream/api"
click node_node_orchestrator "https://github.com/dell/omnia/tree/main/build_stream/orchestrator"
click node_node_core "https://github.com/dell/omnia/tree/main/build_stream/core"
click node_node_infra "https://github.com/dell/omnia/tree/main/build_stream/infra"
click node_node_auth "https://github.com/dell/omnia/tree/main/build_stream/api/auth"
click node_node_catalog_api "https://github.com/dell/omnia/tree/main/build_stream/api/parse_catalog"
click node_node_jobs_api "https://github.com/dell/omnia/tree/main/build_stream/api/jobs"
click node_node_build_api "https://github.com/dell/omnia/tree/main/build_stream/api/build_image"
click node_node_catalog_uc "https://github.com/dell/omnia/tree/main/build_stream/orchestrator/catalog/use_cases"
click node_node_job_uc "https://github.com/dell/omnia/tree/main/build_stream/orchestrator/jobs/use_cases"
click node_node_build_uc "https://github.com/dell/omnia/tree/main/build_stream/orchestrator/build_image/use_cases"
click node_node_validate_uc "https://github.com/dell/omnia/tree/main/build_stream/orchestrator/validate/use_cases"
click node_node_catalog_core "https://github.com/dell/omnia/tree/main/build_stream/core/catalog"
click node_node_build_core "https://github.com/dell/omnia/tree/main/build_stream/core/build_image"
click node_node_jobs_core "https://github.com/dell/omnia/tree/main/build_stream/core/jobs"
click node_node_localrepo_core "https://github.com/dell/omnia/tree/main/build_stream/core/localrepo"
click node_node_validate_core "https://github.com/dell/omnia/tree/main/build_stream/core/validate"
click node_node_prepare "https://github.com/dell/omnia/blob/main/prepare_oim/prepare_oim.yml"
click node_node_discovery "https://github.com/dell/omnia/blob/main/discovery/discovery.yml"
click node_node_local_repo "https://github.com/dell/omnia/blob/main/local_repo/local_repo.yml"
click node_node_input_validation "https://github.com/dell/omnia/blob/main/input_validation/validate_config.yml"
click node_node_build_x86 "https://github.com/dell/omnia/blob/main/build_image_x86_64/build_image_x86_64.yml"
click node_node_build_arm "https://github.com/dell/omnia/blob/main/build_image_aarch64/build_image_aarch64.yml"
click node_node_telemetry "https://github.com/dell/omnia/blob/main/telemetry/telemetry.yml"
click node_node_upgrade "https://github.com/dell/omnia/blob/main/upgrade/upgrade_omnia.yml"
click node_node_common "https://github.com/dell/omnia/tree/main/common"
click node_node_utils "https://github.com/dell/omnia/tree/main/utils"
click node_node_examples "https://github.com/dell/omnia/tree/main/examples"

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_node_main,node_node_api,node_node_orchestrator,node_node_core,node_node_infra,node_node_auth,node_node_catalog_api,node_node_jobs_api,node_node_build_api,node_node_catalog_uc,node_node_job_uc,node_node_build_uc,node_node_validate_uc,node_node_catalog_core,node_node_build_core,node_node_jobs_core,node_node_localrepo_core,node_node_validate_core toneBlue
class node_node_prepare,node_node_discovery,node_node_local_repo,node_node_input_validation,node_node_build_x86,node_node_build_arm,node_node_telemetry,node_node_upgrade toneAmber
class node_node_common,node_node_utils,node_node_examples toneMint
class node_node_postgres,node_node_nfs,node_node_pulp,node_node_vault,node_node_slurm toneRose
```

## Components

### Python control plane

build_stream API, orchestration, domain, and infrastructure adapters

- [Main entry](https://github.com/dell/omnia/blob/main/build_stream/main.py): python entrypoint · Starts the build_stream application · `build_stream/main.py`
- [API layer](https://github.com/dell/omnia/tree/main/build_stream/api): http boundary · Route and schema layer for auth, catalog, jobs, image build, repo, and validation · `build_stream/api`
- [Orchestrator](https://github.com/dell/omnia/tree/main/build_stream/orchestrator): use cases · Coordinates catalog, job, repo, build-image, and validation workflows · `build_stream/orchestrator`
- [Domain core](https://github.com/dell/omnia/tree/main/build_stream/core): business model · Catalog, build-image, jobs, localrepo, validate, and shared artifact rules · `build_stream/core`
- [Infrastructure](https://github.com/dell/omnia/tree/main/build_stream/infra): adapters · Database, NFS repositories, artifact stores, ID generation, and Vault integration · `build_stream/infra`
- [Auth](https://github.com/dell/omnia/tree/main/build_stream/api/auth): jwt/password · Authentication handlers and service boundary · `build_stream/api/auth`
- [Catalog API](https://github.com/dell/omnia/tree/main/build_stream/api/parse_catalog): catalog endpoints · Parse-catalog and catalog-role transport layer · `build_stream/api/parse_catalog`
- [Jobs API](https://github.com/dell/omnia/tree/main/build_stream/api/jobs): job endpoints · Job transport layer and schemas · `build_stream/api/jobs`
- [Build-image API](https://github.com/dell/omnia/tree/main/build_stream/api/build_image): image endpoints · Build-image request transport layer · `build_stream/api/build_image`
- [Catalog use cases](https://github.com/dell/omnia/tree/main/build_stream/orchestrator/catalog/use_cases): catalog orchestration · Parse catalog and generate input files workflows · `build_stream/orchestrator/catalog/use_cases`
- [Job use cases](https://github.com/dell/omnia/tree/main/build_stream/orchestrator/jobs/use_cases): job orchestration · Creates and coordinates jobs · `build_stream/orchestrator/jobs/use_cases`
- [Build use cases](https://github.com/dell/omnia/tree/main/build_stream/orchestrator/build_image/use_cases): image orchestration · Creates build-image workflows · `build_stream/orchestrator/build_image/use_cases`
- [Validate use cases](https://github.com/dell/omnia/tree/main/build_stream/orchestrator/validate/use_cases): validation orchestration · Runs image validation workflows · `build_stream/orchestrator/validate/use_cases`
- [Catalog core](https://github.com/dell/omnia/tree/main/build_stream/core/catalog): parser/generator · Catalog parsing, adapter policy, and software config generation · `build_stream/core/catalog`
- [Build-image core](https://github.com/dell/omnia/tree/main/build_stream/core/build_image): image domain · Image entities, services, repositories, and value objects · `build_stream/core/build_image`
- [Jobs core](https://github.com/dell/omnia/tree/main/build_stream/core/jobs): job domain · Job, stage, audit, and idempotency model · `build_stream/core/jobs`
- [Localrepo core](https://github.com/dell/omnia/tree/main/build_stream/core/localrepo): repo domain · Local package repository concepts and services · `build_stream/core/localrepo`
- [Validate core](https://github.com/dell/omnia/tree/main/build_stream/core/validate): validation domain · Image validation concepts and services · `build_stream/core/validate`

### Ansible workflows

Primary operational playbooks that bootstrap and manage the cluster

- [Prepare OIM](https://github.com/dell/omnia/blob/main/prepare_oim/prepare_oim.yml): bootstrap playbook · Bootstraps containers and supporting services for the platform · `prepare_oim/prepare_oim.yml`
- [Discovery](https://github.com/dell/omnia/blob/main/discovery/discovery.yml): cluster config · Applies node, service, Slurm, LDAP, Kubernetes, and telemetry configuration · `discovery/discovery.yml`
- [Local repo](https://github.com/dell/omnia/blob/main/local_repo/local_repo.yml): repo workflow · Builds package mirrors and metadata · `local_repo/local_repo.yml`
- [Input validation](https://github.com/dell/omnia/blob/main/input_validation/validate_config.yml): validation workflow · Validates deployment inputs before orchestration · `input_validation/validate_config.yml`
- [Build image x86](https://github.com/dell/omnia/blob/main/build_image_x86_64/build_image_x86_64.yml): image workflow · Builds x86_64 operating system images · `build_image_x86_64/build_image_x86_64.yml`
- [Build image arm](https://github.com/dell/omnia/blob/main/build_image_aarch64/build_image_aarch64.yml): image workflow · Builds aarch64 operating system images · `build_image_aarch64/build_image_aarch64.yml`
- [Telemetry](https://github.com/dell/omnia/blob/main/telemetry/telemetry.yml): observability workflow · Deploys and manages telemetry stack and collection · `telemetry/telemetry.yml`
- [Upgrade](https://github.com/dell/omnia/blob/main/upgrade/upgrade_omnia.yml): migration workflow · Performs OIM and cluster upgrade or rollback flows · `upgrade/upgrade_omnia.yml`

### Shared Ansible layer

Reusable modules, tasks, and variables shared across playbooks

- [Common libs](https://github.com/dell/omnia/tree/main/common): shared ansible code · Reusable module_utils, modules, tasks, and variables shared by playbooks · `common`
- [Utils](https://github.com/dell/omnia/tree/main/utils): ops helpers · Operational helper playbooks and roles for credentials, cleanup, PXE, and upgrades · `utils`
- [Examples](https://github.com/dell/omnia/tree/main/examples): input templates · Canonical input, catalog, and config examples used as deployment starting points · `examples`

### External systems

Stateful services and platforms integrated by the repository

- **PostgreSQL**: metadata store · Stores build_stream job and artifact metadata
- **NFS**: shared filesystem · Exchange point for inputs, playbooks, and results
- **Pulp**: package repo · Hosts local package repositories
- **Vault**: secrets manager · Supplies credentials and secrets during deployment
- **Slurm**: scheduler · Cluster workload scheduler configured by the playbooks

## Connections

- Main entry → API layer: serves · Application entry exposes the HTTP boundary
- API layer → Auth: auth · Authentication routes use JWT and password services
- API layer → Catalog use cases: catalog · Catalog-related endpoints call orchestration use cases
- API layer → Jobs API: jobs · Job endpoints expose job lifecycle operations
- API layer → Build-image API: build · Build-image requests enter here
- Orchestrator → Catalog use cases: contains · Catalog workflows are implemented as use cases
- Orchestrator → Job use cases: contains · Job workflows are implemented as use cases
- Orchestrator → Build use cases: contains · Build-image workflows are implemented as use cases
- Orchestrator → Validate use cases: contains · Validation workflows are implemented as use cases
- Catalog use cases → Catalog core: uses · Use cases depend on catalog parser/generator logic
- Catalog use cases → Infrastructure: stores · Generated artifacts and metadata are persisted through adapters
- Job use cases → Jobs core: uses · Use cases depend on job domain model and services
- Job use cases → PostgreSQL: persists · Job state is backed by database repositories
- Build use cases → Build-image core: uses · Build-image workflows depend on domain entities and services
- Build use cases → Pulp: publishes · Image workflows interact with package repository hosting
- Validate use cases → Validate core: uses · Validation use cases depend on validation domain rules
- Infrastructure → PostgreSQL: db · SQL persistence layer for metadata and jobs
- Infrastructure → NFS: nfs · NFS-backed repositories move inputs and playbook outputs
- Infrastructure → Vault: secrets · Vault client integration provides external secrets
- Domain core → Catalog core: includes · Catalog is a major domain area
- Domain core → Build-image core: includes · Build-image is a major domain area
- Domain core → Jobs core: includes · Jobs is a major domain area
- Domain core → Localrepo core: includes · Local repository is a major domain area
- Domain core → Validate core: includes · Validation is a major domain area
- Prepare OIM → PostgreSQL: deploys · Bootstrap creates the database service
- Prepare OIM → Pulp: deploys · Bootstrap creates the package repository service
- Prepare OIM → Vault: integrates · Bootstrap wiring expects external secret handling
- Prepare OIM → Main entry: bootstraps · Deploys the build_stream container and watcher
- Input validation → Common libs: uses · Validation playbooks reuse shared Ansible helpers
- Local repo → Common libs: uses · Local repo workflows reuse shared Ansible helpers
- Discovery → Common libs: uses · Cluster configuration reuses common tasks and modules
- Discovery → Slurm: configures · Discovery produces Slurm configuration and node setup
- Discovery → Telemetry: configures · Discovery also renders telemetry deployment artifacts
- Telemetry → Common libs: uses · Telemetry workflow reuses shared modules and tasks
- Upgrade → Utils: uses · Upgrade flows depend on operational utility playbooks
- Examples → Input validation: feeds · Example inputs are the starting point for validation
- Examples → Catalog use cases: feeds · Example catalogs are parsed into generated artifacts
- Input validation → Catalog use cases: enables · Validated inputs flow into catalog parsing and generation
- Catalog use cases → Prepare OIM: orchestrates · Generated artifacts and requests drive bootstrap execution
- Build use cases → Build image x86: dispatches · x86 build-image workflows are executed via Ansible
- Build use cases → Build image arm: dispatches · aarch64 build-image workflows are executed via Ansible
- Localrepo core → Local repo: drives · Localrepo domain concepts drive the repository workflow
- Validate core → Input validation: supports · Validation rules complement the Ansible validation flow
