Commit graph

2030 commits

Author SHA1 Message Date
Jakub Rusz
7cd4b4ea66 tests: run tests on RHEL-9.1 and 8.7 nightly 2022-07-16 18:59:06 +02:00
Christian Kellner
4647140808 source/skopeo: use subprocess.check_output
Use `subprocess.check_output` instead of `run(..., capture_output=True)`
since the latter only got added in Python 3.7 and our codebase needs to
be compatible with 3.6 due to RHEL 8.x.
2022-07-13 20:06:42 +02:00
Simon de Vlieger
3fd864e5a9 osbuild: fix optional-types
Optional types were provided in places but were not always correct. Add
mypy checking and fix those that fail(ed).
2022-07-13 17:31:37 +02:00
Christian Kellner
6e66c69608 stages: add org.osbuild.containers.storage.conf
New stage to  create or modify `containers-storage.conf` config
files. The currently implement strategy is to merge the given
and existing configuration options.
2022-07-11 16:25:56 +02:00
Christian Kellner
07a45ba34c test/data: include python3-toml in v2 build root
Prepares for testing stages that use python3-toml to edit config
files.
2022-07-11 16:25:56 +02:00
David Rheinsberg
2c1f61f9f2 docs: update osbuild(1)
Update osbuild(1) to reflect changes of the last year. In particular,
we want to document behavior of the v2-manifest and only silently
continue to support v1-manifests.

Lets also introduce new chapters on output control, caching support,
and monitoring.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-07-08 16:42:51 +02:00
David Rheinsberg
112bf3da51 osbuild: align --help output
Make sure all --help output is consistent. In this particular case,
each line should consistently start with a lower-case character and
avoid a leading `the`.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-07-08 16:42:51 +02:00
schutzbot
b06c2311fd Post release version bump
[skip ci]
2022-07-06 08:26:42 +00:00
Gianluca Zuccarelli
c379dccdf1 test/data: update oscap.remediation tests
The oscap.remediation stage now runs the
remediation during build time rather than
creating the necessary files to run the
remediation on first-boot. The tests have
been updated to reflect these changes.
2022-07-06 09:59:00 +02:00
Gianluca Zuccarelli
852fad9fcb oscap: image build remediation
Refactor the oscap remediation stage to
scan and run remediatoin on the image tree
rather than running the remediation at first
boot.
2022-07-06 09:59:00 +02:00
Simon de Vlieger
5c25f17ab7 main: add a --version argument
This adds a `osbuild --version` command that prints the current osbuild
version in use. Allows users to confirm their osbuild is up to date
enough to use newer features.
2022-07-06 09:57:24 +02:00
Simon de Vlieger
ace6c3524b ci: push tags to gitlab
Tags are missing from GitLab (I pushed them once manually) while they
should really be there to be a full mirror.
2022-06-30 10:50:10 +02:00
Christian Kellner
1235c62f8b stages/dnf.config: extend documentation
Add a few more words about the stage.
2022-06-30 09:37:27 +01:00
Christian Kellner
4c12967c0d stages/dnf.config: add support for tsflags
Add support for specifying rpm transaction flags via the `tsflags`
options. See `dnf.conf(5)` for more details.
2022-06-30 09:37:27 +01:00
Christian Kellner
c1c6ab6493 stages/dnf.config: fix schema for config.main
The properties for `main` were not properly defined and but also
not really checked since `additionalProperties` was not defined.
2022-06-30 09:37:27 +01:00
Christian Kellner
57b320f04f stages/dnf.config: specify encondig for open
This is a pyling warning `W1514` "using open without explicitly
specifying an encoding" in newer version, so fix this.
2022-06-30 09:37:27 +01:00
Simon de Vlieger
dd2d4c8708 git: ignore common virtual env locations 2022-06-30 10:34:27 +02:00
Christian Kellner
f078420879 manifests/fedora-container: persist _install_langs
Persist the `_install_langs` via the new `org.osbuild.rpm.macros`
stage.
2022-06-30 00:17:23 +01:00
Christian Kellner
10b8c0dcdc stages/rpm.macros: new stage to set rpm macros
This is to persistently set specific RPM macros. Currently only
`_install_langs` is supported.
2022-06-30 00:17:23 +01:00
Christian Kellner
5fbfd710e4 manifests/fedora-container: only install en locale
This will shrink the container by around 13MB.
2022-06-30 00:17:23 +01:00
Christian Kellner
34ebe60bf0 stages/rpm: new option to set _install_langs
RPM supports installing only specific locales by setting the
`_install_langs` macro.
2022-06-30 00:17:23 +01:00
Christian Kellner
a6e7070b13 stages/oci-archive: make config optional in code
According to our schema `config` is optional but the code actually
accessed it unconditionally; fix that.
2022-06-30 00:03:49 +02:00
Christian Kellner
b761188b98 stages/oci-archive: fix comment to use single # 2022-06-30 00:03:49 +02:00
Christian Kellner
9b548d12c7 stages/oci-archive: specify encoding for open
This is a pyling warning `W1514` "using open without explicitly
specifying an encoding" in newer version, so fix this.
2022-06-30 00:03:49 +02:00
Christian Kellner
219d7469cb osbuild-mpp: small python cleanups
Remove an unused variable and annotate static methods as such.
2022-06-27 10:22:25 +02:00
Christian Kellner
4d39f9ec2b stages: add new org.osbuild.rpmkeys.import stage
Add a new stage to import public keys into the RPM database via the
`rpmkeys` command. This is similar as to what the `org.osbuild.rpm`
stage already does but it uses inputs instead of inline data.
2022-06-25 13:19:11 +01:00
Christian Kellner
7eb58ea348 inputs: introduce new input manager class
Introduce a new class to manage inputs, `InputManger` and move the
code to map inputs from the `Input` here. The main insight of why
the logic should be place here is that certain information is needed
to map inputs, independently of specific type: the path to the input
directory, `root`, the store API, `storeapi` and the service manager
instance to start the actual service. Instead of passing all this
information again and again to the `Input` class, we now have a
specialized (service) manager class for inputs that has all the
needed information all the time.
2022-06-25 02:21:17 +02:00
Jelle van der Waa
923cc60fdb stages: add vagrant stage for libvirt
This commit introduces a new vagrant stage and initially only supports
the libvirt backend. The vagrant stage takes a disk image as input
generates a Vagrantfile and metadata.json.
2022-06-23 11:06:12 +02:00
Jakub Rusz
527be5081c rpmbuild: add fedora-36 2022-06-23 10:41:16 +02:00
schutzbot
986307171d Post release version bump
[skip ci]
2022-06-22 08:19:22 +00:00
Christian Kellner
383e9320ae objectstore: remove unused method from Object
This function was used for the treesum calculations which is not done
anymore. Remove it.
2022-06-21 15:08:32 +02:00
Christian Kellner
e0db89284d tests/objectstore: remove "duplicate" test case
The idea of this test case was to check that two identical trees are
only stored once, via their treesum in the object store; but this
functionality was removed in commit e97f6ef34 and instead of treesums
random uuids are now used. As a result there is no de-duplication
anymore -- the subject of the test. So remove the test.
2022-06-21 15:08:32 +02:00
Christian Kellner
2d78a0bbea pipeline: separate object creation from access
Check for existing checkpoint in `Pipeline.build_stages` by trying to
get the object, instead of just checking for its existence. Later, if
no checkpoints were found, i.e. `tree` is `None`, create a new object.
This avoids mixing of new object creation and object access.
2022-06-21 15:08:32 +02:00
Christian Kellner
458e2063c9 pipeline: use deque to track stages to be built
Instead of iterating over the stages via indices, iterate over the
stages directly. To be able to do so, collect the stages that need
to be built in a deque and then drain it from the other end.
2022-06-21 15:08:32 +02:00
Christian Kellner
d70a8d6419 pipeline: always invoke monitor.finish
Also invoke `monitor.finish` when the pipeline failed to built.
There is no need to not invoke it in that case. This also will
allow us to print some information in the monitor in tha case.
2022-06-21 15:08:32 +02:00
Christian Kellner
9cb9a0d817 pipeline: simplify short circuit code
Since neither a build tree, nor the actual tree is returned from
`build_stages` the short circuit code that checks if the tree is
already present in the store, can be moved before the build tree
retrival. As a result, the short-circuit check in `Pipeline.run`
is now redundant. It was there to make sure that if we have the
tree associated with a pipeline, its build pipeline would also
not be needed. With the short-circuit now happening before the
access of the build pipeline in `build_stages` this is ensured.
2022-06-21 15:08:32 +02:00
Christian Kellner
bd28a29b85 pipeline: do not return tree from build_stages
In the previous data model the build pipelines were nested inside
the pipeline and thus we would recurse in `build_stages`. The
tree that was built was returned and potentially became the build
tree for the pipeline that invoked `build_stages`. In the new
model of a direct acyclic graph of pipelines the build tree can
be any previously built pipeline and we just get it via the store,
which now keeps track of all previously built pipelines even if
there are not committed to it. Thus there is no need to return
the trees from `build_stages` anymore.
Adjust the short code that does the short circuit check to use
`ObjectStore.contains` instead of `ObjectStore.get` since we
do not need to object anymore.
2022-06-21 15:08:32 +02:00
Christian Kellner
ba6c07f406 pipeline: remove build_tree return value
The pipeline data model used to have an assembler optionally
associated with the pipeline; therefore we had to return the
build tree used to to build the stages since the same build
tree also needed to be used from the assembler. In the "new"
model (first introduced in version 27), the assembler got
replaced by another "normal" pipeline. Since then, there is
no need to return the build tree anymore. Remove it.
2022-06-21 15:08:32 +02:00
Christian Kellner
d602b5ff7f stages/mkfs.fat: pass -I command line option
The option will force `mkfs.fat` to ignore existing partitions on
the target device. The check is done via the corresponding device
node in sysfs, i.e. the contents of the `partition` attribute in
`/sys/dev/block/<major>:<minor>`. In certain situations this info
can be stale. Passing `-I` will work-around these situations.
2022-06-20 11:19:33 +02:00
Jakub Rusz
773412e5b5 Schutzfile: update rpmrepo snapshots 2022-06-16 14:24:02 +02:00
Jakub Rusz
2ea15b967d tests: Update testing to RHEL-8.6 GA 2022-06-16 14:24:02 +02:00
Jakub Rusz
bd7d2a5628 rpmbuild: add RHEL 8.7 and 9.1 nightly 2022-06-16 14:24:02 +02:00
Jakub Rusz
1e7ba87eb7 mockbuild: update mockbuild script after RHEL-9 GA
Removing rhel-9 templates as they are shipped upstream already and
making necessary modifications to mockbuild.sh
2022-06-16 14:24:02 +02:00
Christian Kellner
86123da599 stages/qemu: expose vpc options
Currently we hard code the vpc options `subformat=fixed` and
`force_size`, which are needed to generate valid azure images
with newer versions of qemu. But for other use cases or other
versions of qemu these options might not be wanted or valid.
Expose all the options but with defaults corresponding to the
old behavior.
Add a unit test for the `force_size` option to check its
effect. Also add a check for the correct size to the existing, 
default value (i.e. `force_size` being `true`).
2022-06-15 13:41:11 +02:00
Simon Steinbeiss
3ffba19205 ci: Adjust release schedule timer
Adjust the timer for our automated releases to trigger the workflow at
8 UTC. This corresponds to 10am in most of our team's timezone and to
the reminder event in our team calendar.
2022-06-15 11:47:41 +02:00
Achilleas Koutsou
c8073b5836 sources: support calling curl with --insecure
Add support for the `--insecure` curl flag, which makes curl skip the
verification step when making secure connections (e.g., https://).
This allows osbuild to download files from servers configured with
SSL/TLS but whose certificate cannot be validated.

This is supported for configuring repository sources in
osbuild-composer.
2022-06-14 22:13:39 +02:00
Christian Kellner
3ab2ddd481 pipeline, fmt: use build result object internally
Instead of serializing the `BuildResult` to a dict in `build_stages`,
we keep the object and then only serialize it in the corresponding
formatting code. This doubles down on the separation between the
internal data structures and the external representation of them. It
was partially already done in the v2 format which hand-picked which
elements of the BuildResult it would return for each stage.
2022-06-14 00:15:51 +01:00
Christian Kellner
d235e4c26a pipeline: remove options from build result
Remove the stage options from the `BuildResult` object. They were
only serialized in the case of version 1 and not actually used by
Composer for anything. Use of v1 manifests should very limted now
anyway.
2022-06-14 00:15:51 +01:00
schutzbot
a96ee0f8ba Post release version bump
[skip ci]
2022-06-08 13:32:41 +00:00
Alexander Todorov
20b8c67c8d ci: Disable -nightly test runners for 8.6 and 9.0 2022-06-08 14:18:42 +02:00