Skip to content

Core Concepts

Choose between a simple and a standard repository, and learn the model behind workspaces, Dists, the package pool, and Generations.

SOW builds two kinds of repository and uses a handful of concepts. The first section is enough to choose between them; the rest explains how a standard repository is put together, and why.

Simple or standard repository

The two kinds differ in where the truth about the repository lives.

A simple repository is a directory of package files, and the directory is the state. sow create indexes whatever packages are in it. To change the repository, change the files and run the command again. SOW keeps nothing else, so there is nothing to back up, migrate, or recover except the directory itself.

A standard repository is one that SOW maintains inside a workspace. SOW records what each package set should contain, separately from the files it serves. That record is what lets it enforce version limits, sign indexes, compare builds, recover from interruptions, and publish only what changed.

Need Simple repository Standard repository
Build indexes from packages sow create DIR sow add, which builds automatically
Where the state lives The directory contents sow.yml and private SQLite databases
Organize packages One flat directory; RPM and DEB can coexist Named Dists, one format each
Per-architecture indexes No Yes
Filters and version limits sow prune DIR keeps the newest RPM per name and architecture; --pigsty cleanup exclude and limit per Dist
Sign RPM packages Yes Yes
Sign repository metadata Outside SOW Configured in sow.yml
Build history and publication Outside SOW Built in

Choose a simple repository when something else, such as a CI job or a build script, already decides which files belong in the directory. Choose a standard repository when you want SOW to make and remember those decisions: several distributions, version limits, signed metadata, build history, or publication to a remote target. Switching later is cheap, because sow add takes the same package files.

The CLI uses its own internal names for the two: sow help calls what sow create builds a flat repository, errors from create and prune start with plain:, and most errors from workspace commands contain managed:.

Workspace, repository, and Dist

Standard repositories live in a workspace. Using the names from Your first standard repository:

  • /srv/sow/workspace
    • sow.ymlconfiguration you edit
    • .sow/databases, locks, recovery records (private)
    • local/standard repository: the tree clients read
      • pool/package files, one copy each
      • dists/
        • el9/an RPM Dist
          • x86_64/repodata/
          • aarch64/repodata/
        • bookworm/a DEB Dist
          • main/binary-amd64/ ...

A workspace is the directory that sow init creates: it holds sow.yml and the private .sow/ directory. One workspace usually serves one host or team and can hold several repositories. Commands that operate on standard repositories find it by looking for sow.yml or sow.yaml, which is why this docs site calls them workspace commands.

A repository is what clients see: pool/ plus dists/, served as one tree. It is also the boundary for storage, history, and publication. Each repository has its own pool, its own build history, and its own publication targets, so retention and cleanup in one never affect another. Use separate repositories for content with separate lifecycles, such as infrastructure tools and database extensions.

A Dist is a named set of packages in one format, such as el9 for RPMs or bookworm for DEBs. The name is your label: SOW checks each package’s format and architecture, not whether it suits the operating system the name suggests. APT clients use the Dist name as the suite.

An architecture view is the index that clients of one architecture read, for example dists/el9/x86_64/repodata/. Architecture-neutral packages, RPM noarch and DEB all, appear in every view of their Dist.

Serve the repository directory only. sow.yml and .sow/ must stay outside the web root.

Store each package once

When several Dists or architectures need the same package, a standard repository still stores one file. SOW identifies it by the SHA-256 of its contents and reads its name, version, and architecture from the package header. Every view that includes it gets index entries that point back to that one file under pool/. A noarch package shared by three EL Dists on two architectures is one file, not six, and a publication uploads it once.

Two consequences follow:

  • Serve or copy the complete repository root. RPM indexes reach the pool through relative paths such as ../../../pool/…, and APT Filename entries are relative to the repository root. A single view directory on its own cannot resolve them.
  • Some mirror tools need an export. Default dnf reposync rejects parent-relative paths. sow export rpm-leaf writes a standalone copy of one RPM view for it.

Separate repositories never share a pool. Pool and views covers the layout in depth.

Desired and built state

A standard repository separates deciding what a Dist should contain from producing the files that clients read.

  • Desired membership is the package set selected for each Dist, after filters and version limits.
  • A Generation is one completed build of the repository, with a manifest of every file it produced. The latest one is the built state, the state clients see.
flowchart LR
  input["sow add / sow rm"] --> desired["Desired membership"]
  desired -- "sow build" --> built["Built Generation<br/>pool/ + dists/"]
  built -- "sow publish TARGET" --> target["Publication target<br/>directory or R2"]

add and rm normally update membership and trigger a build. For a batch, pass --skip on each change and run sow build once at the end. Clients keep reading the old indexes until the build switches each affected Dist. Also run sow build after editing filters, architectures, or signing in sow.yml.

A build writes new metadata; packages stay in the shared pool, so keeping history is cheap. These commands work with built state:

Command Use
sow status See whether a build is pending, and whether the tree is ready_to_copy
sow check Verify package bytes, indexes, signatures, and the recorded manifest, without changing anything
sow changes [BASE_GENERATION] List the files that changed between a recorded Generation and the current one
sow publish TARGET Upload the current build to a configured target, changed files only

Repository state

sow status sums up a standard repository in one word:

State Meaning Next action
clean Desired membership and configuration match the built output sow check, then publish
dirty Membership or configuration changed since the last build sow build, then sow check
recovering An interrupted operation is waiting to be finished Run the command the error names; see recovery
error Recorded state and files disagree Read the error and sow log

A dirty repository still serves its previous build, so clients are never left without a working index while you prepare the next one. SOW records each change before applying it, which is why recovery is usually a matter of rerunning a command; see Transactions and recovery.

Continue

Table reader