No description
Find a file
Tom Gundersen 3669978577 osbuild-run: remove any /etc/nsswitch.conf
On some hosts, systemd-tmpfiles will generate an nsswitch.conf
configuring DNS to be done via systemd-resolved, but this will
require the container to be booted and resolved to be running.

In other cases, a proper fall-back is configured, so this is not
a problem, but on some hosts this means DNS does not work.

Conversely, the default behavior with no nsswitch.conf at all
works just fine, always using nss-dns.

Let's simply delete the file if it is there, and rely on the
default.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-08-02 00:57:28 +02:00
assemblers travis: add an osbuild test 2019-07-31 01:34:31 +02:00
osbuild ObjectStore: add an object store class 2019-08-01 22:39:52 +02:00
samples travis: add a test for a yum-based pipeline 2019-07-31 01:34:31 +02:00
stages introduce support for user-defined kernel options 2019-08-01 14:59:37 +02:00
test ObjectStore: add an object store class 2019-08-01 22:39:52 +02:00
.gitignore improve vagrant test and its documentation 2019-07-25 12:46:53 +02:00
.packit.yaml enable copr builds triggered in pull-requests 2019-08-01 16:17:11 +02:00
.pylintrc pylint: disable too-many-arguments rule 2019-07-24 12:55:48 +02:00
.travis.yml ObjectStore: add an object store class 2019-08-01 22:39:52 +02:00
LICENSE Add LICENSE 2019-04-09 18:18:44 +02:00
Makefile detect version in makefile, change name of produced tarballs 2019-08-01 16:17:11 +02:00
MANIFEST.in introduce spec file and related build scripts 2019-07-23 15:22:40 +02:00
osbuild-run osbuild-run: remove any /etc/nsswitch.conf 2019-08-02 00:57:28 +02:00
osbuild.spec download sources from github as <name>-<version>.tar.gz 2019-08-01 16:17:11 +02:00
README.md ObjectStore: add an object store class 2019-08-01 22:39:52 +02:00
setup.py introduce spec file and related build scripts 2019-07-23 15:22:40 +02:00

osbuild

A build system for operating system images, working towards an image build pipeline that's more comprehensible, reproducible, and extendable.

Pipelines

The build process for an image is described by a pipeline. Each stage in a pipeline is a program that, given some configuration, modifies a file system tree. Finally, an assembler takes a filesystem tree, and assembles it into an image. Pipelines are defined as JSON files like this one:

{
  "name": "Example Image",
  "stages": [
    {
      "name": "org.osbuild.dnf",
      "options": {
        "releasever": "30",
        "repos": {
          "fedora": {
            "name": "Fedora",
            "metalink": "https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch",
            "gpgkey": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch"
          }
        },
        "packages": [ "@Core", "grub2-pc", "httpd" ]
        }
    },
    {
      "name": "org.osbuild.systemd",
      "options": {
        "enabled_services": [ "httpd" ]
      }
    },
    {
      "name": "org.osbuild.grub2",
      "options": {
        "root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac"
      }
    }
  ],
  "assembler": {
    "name": "io.weldr.qcow2",
    "options": {
      "filename": "example.qcow2",
      "root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac"
    }
  }
}

osbuild runs each of the stages in turn, isolating them from the host and from each other, with the exception that they all operate on the same filesystem-tree. The assembler is similarly isolated, and given the same tree, in read-only mode and assembles it into an image without altering its contents.

The filesystem tree produced by the final stage of a pipeline, is named and optionally saved to be reused as the base for future pipelines.

Each stage is passed the (appended) options object as JSON over stdin.

The above pipeline has no base and produces a qcow2 image.

Running

usage: python3 -m osbuild [-h] [--store DIRECTORY] [-l DIRECTORY] -o DIRECTORY
                   PIPELINE

Build operating system images

positional arguments:
  PIPELINE              json file containing the pipeline that should be built

optional arguments:
  -h, --help            show this help message and exit
  --store DIRECTORY   the directory where intermediary os trees are stored
  -l DIRECTORY, --libdir DIRECTORY
                        the directory containing stages, assemblers, and the
                        osbuild library

required named arguments:
  -o DIRECTORY, --output DIRECTORY
                        provide the empty DIRECTORY as output argument to the
                        last stage