Commit graph

11 commits

Author SHA1 Message Date
Christian Kellner
98a82ff47e aarch64: use single qemu-img thread
Work around a bug on aarch64[1] where `qemu-img` would hang
about a third of the time when converting images. To be able 
to activate the work-around based on the environment, i.e.
only on certain distributions, introduce an environment
variable, `OSBUILD_QEMU_IMG_COROUTINES`, that is set in the
runner and then picked up in the assembler.

[1] https://bugs.launchpad.net/qemu/+bug/1805256
2021-06-09 11:57:26 +02:00
Christian Kellner
1fbe4bb31a runners/rhel82: extract code into main function
Move the code in `__main__` to a `main` function to not pollute the
global namespace.
2021-06-09 11:57:26 +02:00
Christian Kellner
7ad212dc89 runners/rhel82: fix spacing between functions
Two lines between functions, demanded by PEP-8.
2021-06-09 11:57:26 +02:00
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
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
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
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
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
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
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