Commit graph

22 commits

Author SHA1 Message Date
Christian Kellner
0e6b4749f7 runner: use osbuild.api.exception_handler
Wrap all calls to the various setup functions in the new exception
handler provided by `osbuild.api`. This will make sure that any
exception is properly printed to stderr, as well as communicated
to osbuild in a structured and machine readable way.
2020-10-09 10:47:44 +02:00
Jacob Kozol
549499d2fb runners: add rhel 84
A runner for rhel 8.4 is added. This runner is a sym link to the rhel82
runner as was done for the rhel83 runner.
2020-10-05 18:20:14 +02:00
Christian Kellner
94e5d97836 runners: add Fedora 34 runner
Fedora 33 recently branched off rawhide and thus Fedora 34 was
created. Re-use Fedora 30 runner, as was done for Fedora 33.
2020-09-10 08:25:50 +02:00
chloenayon
01aae91949 api: remove setup_stdio
API.setup_stdio was replaced in PRs 506 and 507,
remove setup_stdio functions and call sites.
2020-09-09 12:52:50 +02:00
Christian Kellner
499ae1654e osbuild: replace api.setup_stdio with BuildRoot
Now that the BuildRoot is capable of capturing the output of the
runner and modules (stages, assemblers), there is no need for
using `api.setup_stdio`. Therefore, drop it from all runners and
replace `api.output` with `BuildRoot.output`, which will contain
the output if `api.setup_stdio` is not called from the runners.
2020-08-31 15:06:36 +02:00
Christian Kellner
e1e50c3339 runners: add support for ubuntu 20.04
Base it on the ubuntu 18.04 runner.
2020-08-10 21:37:28 +02:00
Christian Kellner
71adfced70 runners: use osbuild.api.setup_stdio
Each runner used the exact same copy of `setup_stdio`, which is
now provided by `api.setup_stdio`. Use that and remove the code
duplication.
2020-07-27 12:50:38 +01:00
Christian Kellner
cb265e8b58 runners: use platform-python on RHEL
Runner are invoked to prepare the execution of stages and assemblers
inside the container. The setup tasks are specific to the distribution
and maybe the version of it, therefore specific runners are used for
each distribution+version combination.
The build the first (most nested) build root, `/usr` is taken from the
host to bootstrap the container. On RHEL, the python interpreter to be
used for software that belongs to the platform is platform-python, as
it provides a stable API. Therefore the RHEL runners should use that
instead of relying on the presence of /usr/bin/python3.6, which might
not be installed and is indeed not installed by default.
2020-06-19 08:07:07 +02:00
David Rheinsberg
4d2f15fb46 modules: drop osbuild symlink
Drop the `osbuild -> ../osbuild` symlink from all module directories.
We now properly initialize the PYTHONPATH to provide the imported
osbuild module from the host environment. Therefore, these links are no
longer needed.

The sources run from the host environment, so they should just pick them
up from the environment the same way osbuild itself does.
2020-05-04 12:32:25 +02:00
David Rheinsberg
4ad4da4658 osbuild: convert to jsoncomm
Convert the hard-coded DGRAM communication to util.jsoncomm. This
avoids hard-coding any IPC-details and simplifies the callers quite a
bit.
2020-04-21 13:47:38 +02:00
David Rheinsberg
58d368df0d osbuild: unify libdir handling
We want to run stages and other scripts inside of the nspawn containers
we use to build pipelines. Since our pipelines are meant to be
self-contained, this should imply that the build-root must have osbuild
installed. However, this has not been the case so far for several
reasons including:

  1. OSBuild is not packaged for all the build-roots we want to support
     and thus we have the chicken-and-egg problem.

  2. During testing and development, we want to support using a local
     `libdir`.

  3. We already provide an API to the container. Importing scripts from
     the outside just makes this API bigger, but does not change the
     fact that build-roots are not self-contained. Same is true for the
     running kernel, and probably much more..

With all this in mind, our strategy probably still is to eventually
package osbuild for the build-root. This would significantly reduce our
API exposure, points-of-failure, and host-reliance. However, this switch
might still be some weeks out.

With this in mind, though, we can expect the ideal setup to have a full
osbuild available in the build-root. Hence, any script we import so far
should be able to access the entire `libdir`. This commit unifies the
libdir handling by installing the symlinks into `libdir` and providing
a single bind-mount of the module-path into `libdir`.

We can always decide to scratch that in the future when we scratch the
libdir-import from the host-root. Until then, I believe this commit
nicely unifies the way we import the module both in a local checkout as
well as in the container.
2020-04-21 13:44:43 +02:00
Major Hayden
930dcf670b 🐣 Add RHEL 8.3 support
Signed-off-by: Major Hayden <major@redhat.com>
2020-04-21 11:40:25 +00:00
Tom Gundersen
8ad791be13 runners: drop ca certificate handling
Now that stages no longer access the network, drop CA certificate
setup.

In the future, we may want to restrict all network access to the
container, but that requires more work.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-04-15 15:29:52 +02:00
Tom Gundersen
b7bbcaa3a2 runners/fedora27: drop support
We no longer attempt to support fedora before f30.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-04-15 15:29:52 +02:00
Lars Karlitski
60e3ec4add runners: drop os-release hack for rhel-8.2
The bug was fixed upstream and is available in the latest 8.2 builds.
Since it is not yet released, we don't need to keep the hack around.

Fixes #294
2020-03-30 10:37:42 +02:00
David Rheinsberg
83d058b935 runners: add runner for Arch Linux
This adds a new runner for Arch Linux. For now this simply links to the
blank linux runner, which works perfectly fine to bootstrap more
complex build pipelines.

Note that if we ever end up with more complex pipelines native to Arch
Linux, we might have to update this runner as well, since even on Arch
/etc must be pre-populated. Regardless, the blank linux runner serves
as a nice base and allows us to easily bootstrap osbuild on foreign
distros.
2020-02-29 18:34:00 +01:00
David Rheinsberg
6104a000ff runners: org.osbuild.blank -> org.osbuild.linux
Now with `os-release` using `linux` as default ID+VERSION string, we
have a proper fallback name for our blank runner. Rename the blank
runner to `org.osbuild.linux`. It now serves as default fallback for
anything not further specified.
2020-02-29 18:34:00 +01:00
David Rheinsberg
90a6b3bd10 runners: add blank runner
This adds a new runner called `org.osbuild.blank`, which assumes /usr
is pre-populated and ready to go. It does not perform any OS setup. It
only initializes the environment and executes the stage.

This runner allows easy bootstrapping of new systems. It assumes our
ideal setup where `/usr` describes a host system in its entirety,
without any local policy applied. Thus, this runner is also what we
ultimately want to work towards as a default. This might not happen
anytime soon, though, given how `passwd`, `ldconfig`, `nss`, etc. still
depend on prepopulated caches in `/etc`.
2020-02-29 12:45:09 +01:00
Jacob Kozol
c5b31ff2ac runners: add rhel 8.1 runner
The rhel 8.1 runner is based off of the rhel 8.2 runner with the only
difference being the etc/os-release content.
2020-02-28 16:05:35 +01:00
Major Hayden
7b8f70fc5b Allow osbuild to run on rawhide (f33)
Add an additional symlink and spec update for Fedora Rawhide,
which is currently set as release 33.

Signed-off-by: Major Hayden <major@redhat.com>
2020-02-26 15:25:47 +01:00
Martin Sehnoutka
6a14ba40f7 Create Fedora 31 and Fedora 32 runners 2020-01-10 18:27:55 +01:00
Lars Karlitski
64713449ce Introduce runners
We've been using a generic `osbuild-run`, which sets up the build
environment (and works around bugs) for all build roots. It is already
getting unwieldy, because it tries to detect the OS for some things it
configures. It's also about to cause problems for RHEL, which doesn't
currently support a python3 shebang without having /etc around.

This patch changes the `build` key in a pipeline to not be a pipeline
itself, but an object with `runner` and `pipeline` keys. `pipeline` is
the build pipeline, as before. `runner` is the name of the runner to
use. Runners are programs in the `runners` subdirectory.

Three runners are included in this patch. They're copies of osbuild-run
for now (except some additions for rhel82). The idea is that each of
them only contains the minimal setup code necessary for an OS, and that
we can review what's needed when updating a build root.

Also modify the `--build-pipeline` command line switch to accept such a
build object (instead of a pipeline) and rename it accordingly, to
`--build-env`.

Correspondingly, `OSBUILD_TEST_BUILD_PIPELINE` → `OSBUILD_TEST_BUILD_ENV`.
2019-11-25 13:05:22 +01:00