# ublue-os/main architecture

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

- Interactive diagram: https://gitdiagram.com/ublue-os/main
- Repository: https://github.com/ublue-os/main

## Overview

This repository is the “main” image factory for Universal Blue. It does not contain an application runtime; it builds Fedora-based OCI/bootable OS images that serve as the common base for downstream uBlue images. The README makes the current scope explicit: only the base, Kinoite, and Silverblue image families are built now.

The architecture is centered on a top-level `Containerfile` plus a `build_files/` pipeline. The `Containerfile` is the build entrypoint, while the shell scripts in `build_files/` break the image assembly into stages such as package selection, initramfs setup, NVIDIA-specific setup, post-install tweaks, and release/install handling. This is the main transformation flow: Fedora base inputs in, customized OS image out.

System-level customization lives under `sys_files/`. These files are injected into the image filesystem and define runtime behavior after boot. The tracked customizations include dracut compression settings, a systemd unit for enabling Flathub repositories, tmpfiles rules for coredumps, and a DNF plugin config for COPR behavior. This directory is the boundary between image construction and the final OS configuration.

Package and version control are separated into a few metadata files. `packages.json` appears to define the package set or package groups used by the build, and `image-versions.yaml` likely pins or coordinates image versioning across releases. Together they form the declarative inputs that the build scripts consume when assembling the image.

The repo has explicit support for hardware and platform-specific layering. The presence of `nvidia-install.sh` indicates that GPU driver integration is treated as a build-time concern rather than a post-install user action. Likewise, `initramfs.sh` and the dracut config suggest the image is tuned for boot-time behavior and image compression, which matters for an immutable/bootable OS.

Release and publishing are handled through GitHub Actions in `.github/workflows/`. There are separate pipelines for `build-beta`, `build-gts`, and `build-latest`, plus a reusable build workflow and a release automation workflow. That structure suggests multiple release channels are produced from the same source tree, with shared build logic and channel-specific promotion.

The CI/CD boundary is important: local edits and build scripts prepare the image, but GitHub Actions is the system that actually builds, verifies, tags, and publishes artifacts. Supporting files like `cosign.pub` indicate artifact signing/verification is part of the supply-chain model. `CHANGELOG.md` and `release-please.yml` reinforce that releases are managed as a disciplined versioned output, not ad hoc builds.

The repository also contains developer-environment scaffolding in `.devcontainer/`. This includes a container definition and local features for Podman and tooling, which means contributors are expected to develop and test the image-building workflow inside a reproducible containerized environment. That is a separate concern from the produced OS image itself.

Operationally, the build appears to rely on Fedora/RPM ecosystem tooling rather than application frameworks. The `sys_files/usr/share/dnf/plugins/copr.vendor.conf` file, the dracut configuration, and the systemd/tmpfiles snippets show that the image is tailored at the OS layer using standard Linux packaging and init systems.

The repo is also organized for governance and automation. `.github/CODEOWNERS`, issue templates, pull request templates, Renovate config, and semantic/release tooling point to a maintained upstream image project with controlled change flow. These files do not affect the runtime image, but they strongly shape how changes enter the build pipeline.

For architecture diagram purposes, the key flow is: Fedora-derived base inputs and package/version metadata feed the build scripts and Containerfile; build-time customizations are layered in from `build_files/` and `sys_files/`; GitHub Actions produces signed channel-specific images; downstream uBlue images consume this repository’s outputs as their shared base.

Main entry points: [`build_files/packages.sh`](https://github.com/ublue-os/main/blob/main/build_files/packages.sh) (Package Select), [`build_files/post-install.sh`](https://github.com/ublue-os/main/blob/main/build_files/post-install.sh) (Post Install), [`.github/workflows/reusable-build.yml`](https://github.com/ublue-os/main/blob/main/.github/workflows/reusable-build.yml) (GitHub Actions), [`Containerfile`](https://github.com/ublue-os/main/tree/main/Containerfile) (Containerfile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Build Source"]
  node_containerfile["Containerfile<br/>build entrypoint"]
  node_packages_json["Packages<br/>package manifest<br/>[packages.json]"]
  node_image_versions["Versions<br/>release metadata"]
end

subgraph group_pipeline["Build Pipeline"]
  node_build_install["Install<br/>staging script<br/>[install.sh]"]
  node_build_packages["Package Select<br/>staging script<br/>[packages.sh]"]
  node_build_initramfs["Initramfs<br/>staging script<br/>[initramfs.sh]"]
  node_build_nvidia["NVIDIA Setup<br/>staging script<br/>[nvidia-install.sh]"]
  node_build_post["Post Install<br/>staging script<br/>[post-install.sh]"]
  node_build_release_install["Release Install<br/>staging script"]
  node_build_check["Build Check<br/>validation script<br/>[check-build.sh]"]
end

subgraph group_runtime["OS Customization"]
  node_sys_dracut["Dracut Config<br/>os config"]
  node_sys_flathub["Flathub Service<br/>systemd unit"]
  node_sys_tmpfiles["Tmpfiles Rules<br/>tmpfiles config<br/>[coredump.conf]"]
  node_sys_copr["Copr Plugin<br/>dnf plugin config<br/>[copr.vendor.conf]"]
end

subgraph group_delivery["CI/CD"]
  node_github_actions["GitHub Actions<br/>ci workflows<br/>[reusable-build.yml]"]
  node_release_channels{{"Release Channels<br/>workflow set"}}
  node_devcontainer["Dev Container<br/>dev env<br/>[devcontainer.json]"]
  node_cosign_pub["Cosign Key<br/>signing key<br/>[cosign.pub]"]
  node_downstream(("Downstream Images<br/>consumer boundary"))
end

node_containerfile -->|"drives"| node_build_install
node_containerfile -->|"includes"| node_build_packages
node_packages_json -->|"feeds"| node_build_packages
node_image_versions -->|"controls"| node_github_actions
node_build_packages -->|"prepares"| node_build_install
node_build_install -->|"hands off"| node_build_initramfs
node_build_initramfs -->|"extends"| node_build_nvidia
node_build_nvidia -->|"finishes"| node_build_post
node_build_post -->|"packages"| node_build_release_install
node_build_check -->|"verifies"| node_github_actions
node_sys_dracut -->|"configures"| node_build_initramfs
node_sys_flathub -->|"installs"| node_build_post
node_sys_tmpfiles -->|"installs"| node_build_post
node_sys_copr -->|"configures"| node_build_packages
node_github_actions -->|"publishes"| node_release_channels
node_release_channels -->|"consumed by"| node_downstream
node_devcontainer -.->|"mirrors"| node_containerfile
node_cosign_pub -->|"supports"| node_github_actions

click node_containerfile "https://github.com/ublue-os/main/tree/main/Containerfile"
click node_packages_json "https://github.com/ublue-os/main/blob/main/packages.json"
click node_image_versions "https://github.com/ublue-os/main/blob/main/image-versions.yaml"
click node_build_install "https://github.com/ublue-os/main/blob/main/build_files/install.sh"
click node_build_packages "https://github.com/ublue-os/main/blob/main/build_files/packages.sh"
click node_build_initramfs "https://github.com/ublue-os/main/blob/main/build_files/initramfs.sh"
click node_build_nvidia "https://github.com/ublue-os/main/blob/main/build_files/nvidia-install.sh"
click node_build_post "https://github.com/ublue-os/main/blob/main/build_files/post-install.sh"
click node_build_release_install "https://github.com/ublue-os/main/blob/main/build_files/github-release-install.sh"
click node_build_check "https://github.com/ublue-os/main/blob/main/build_files/check-build.sh"
click node_sys_dracut "https://github.com/ublue-os/main/blob/main/sys_files/usr/lib/dracut/dracut.conf.d/10-compression.conf"
click node_sys_flathub "https://github.com/ublue-os/main/blob/main/sys_files/usr/lib/systemd/system/flatpak-add-flathub-repos.service"
click node_sys_tmpfiles "https://github.com/ublue-os/main/blob/main/sys_files/usr/lib/tmpfiles.d/coredump.conf"
click node_sys_copr "https://github.com/ublue-os/main/blob/main/sys_files/usr/share/dnf/plugins/copr.vendor.conf"
click node_github_actions "https://github.com/ublue-os/main/blob/main/.github/workflows/reusable-build.yml"
click node_devcontainer "https://github.com/ublue-os/main/blob/main/.devcontainer/devcontainer.json"
click node_cosign_pub "https://github.com/ublue-os/main/blob/main/cosign.pub"

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_containerfile,node_packages_json,node_image_versions toneBlue
class node_build_install,node_build_packages,node_build_initramfs,node_build_nvidia,node_build_post,node_build_release_install,node_build_check toneAmber
class node_sys_dracut,node_sys_flathub,node_sys_tmpfiles,node_sys_copr toneMint
class node_github_actions,node_release_channels,node_devcontainer,node_cosign_pub,node_downstream toneRose
```

## Components

### Build Source

Top-level build entrypoint and declarative inputs

- [Containerfile](https://github.com/ublue-os/main/tree/main/Containerfile): build entrypoint · Primary image build definition · `Containerfile`
- [Packages](https://github.com/ublue-os/main/blob/main/packages.json): package manifest · Declarative package set input · `packages.json`
- [Versions](https://github.com/ublue-os/main/blob/main/image-versions.yaml): release metadata · Image version coordination · `image-versions.yaml`

### Build Pipeline

Staged image assembly logic

- [Install](https://github.com/ublue-os/main/blob/main/build_files/install.sh): staging script · Base package and image assembly step · `build_files/install.sh`
- [Package Select](https://github.com/ublue-os/main/blob/main/build_files/packages.sh): staging script · Package selection and composition logic · `build_files/packages.sh`
- [Initramfs](https://github.com/ublue-os/main/blob/main/build_files/initramfs.sh): staging script · Boot-time image setup · `build_files/initramfs.sh`
- [NVIDIA Setup](https://github.com/ublue-os/main/blob/main/build_files/nvidia-install.sh): staging script · GPU driver integration during build · `build_files/nvidia-install.sh`
- [Post Install](https://github.com/ublue-os/main/blob/main/build_files/post-install.sh): staging script · Final image tweaks and cleanup · `build_files/post-install.sh`
- [Release Install](https://github.com/ublue-os/main/blob/main/build_files/github-release-install.sh): staging script · Release-channel install handling · `build_files/github-release-install.sh`
- [Build Check](https://github.com/ublue-os/main/blob/main/build_files/check-build.sh): validation script · Build verification and guardrails · `build_files/check-build.sh`

### OS Customization

Filesystem-layered system configuration

- [Dracut Config](https://github.com/ublue-os/main/blob/main/sys_files/usr/lib/dracut/dracut.conf.d/10-compression.conf): os config · Initramfs compression settings · `sys_files/usr/lib/dracut/dracut.conf.d/10-compression.conf`
- [Flathub Service](https://github.com/ublue-os/main/blob/main/sys_files/usr/lib/systemd/system/flatpak-add-flathub-repos.service): systemd unit · Enables Flathub repositories on boot · `sys_files/usr/lib/systemd/system/flatpak-add-flathub-repos.service`
- [Tmpfiles Rules](https://github.com/ublue-os/main/blob/main/sys_files/usr/lib/tmpfiles.d/coredump.conf): tmpfiles config · Coredump and runtime file rules · `sys_files/usr/lib/tmpfiles.d/coredump.conf`
- [Copr Plugin](https://github.com/ublue-os/main/blob/main/sys_files/usr/share/dnf/plugins/copr.vendor.conf): dnf plugin config · DNF COPR vendor behavior · `sys_files/usr/share/dnf/plugins/copr.vendor.conf`

### CI/CD

Automation, release, and developer workflow

- [GitHub Actions](https://github.com/ublue-os/main/blob/main/.github/workflows/reusable-build.yml): ci workflows · Build, release, and cleanup automation · `.github/workflows/reusable-build.yml`
- **Release Channels**: workflow set · Beta, GTS, and latest builds
- [Dev Container](https://github.com/ublue-os/main/blob/main/.devcontainer/devcontainer.json): dev env · Reproducible contributor environment · `.devcontainer/devcontainer.json`
- [Cosign Key](https://github.com/ublue-os/main/blob/main/cosign.pub): signing key · Artifact verification/public signing key · `cosign.pub`
- **Downstream Images**: consumer boundary · uBlue images built from this base

## Connections

- Containerfile → Install: drives · Build entrypoint invokes staged assembly
- Containerfile → Package Select: includes · Container build consumes package selection logic
- Packages → Package Select: feeds · Package manifest informs image composition
- Versions → GitHub Actions: controls · Version metadata helps drive release builds
- Package Select → Install: prepares · Package decisions flow into install stage
- Install → Initramfs: hands off · Core install stage leads into boot setup
- Initramfs → NVIDIA Setup: extends · Hardware-specific layering follows boot setup
- NVIDIA Setup → Post Install: finishes · Final customization occurs after driver integration
- Post Install → Release Install: packages · Release/install handling completes the pipeline
- Build Check → GitHub Actions: verifies · CI uses build checks as a guardrail
- Dracut Config → Initramfs: configures · Dracut settings shape initramfs output
- Flathub Service → Post Install: installs · Service is layered into the final OS image
- Tmpfiles Rules → Post Install: installs · Tmpfiles rules are included in system image
- Copr Plugin → Package Select: configures · DNF plugin config affects package build behavior
- GitHub Actions → Release Channels: publishes · Workflows produce channel-specific builds
- Release Channels → Downstream Images: consumed by · Published images serve as shared base for downstream images
- Dev Container → Containerfile: mirrors · Contributor environment mirrors build tooling
- Cosign Key → GitHub Actions: supports · Signing and verification in release automation
