Commit graph

2420 commits

Author SHA1 Message Date
Brian C. Lane
2047a8efbc autopep8: Increase aggressive level 2023-08-10 13:04:14 +02:00
Ondřej Budai
c47850b8ae manifests/fedora-ostree-native-container: bump max_layers to 4
rpm-ostree crashes when max_layers is set to <4. Work around that
by bumping the max_layers argument.

See https://github.com/coreos/rpm-ostree/issues/4530
2023-08-08 12:41:17 +02:00
Ondřej Budai
6e254c95af stages/ostree.encapsulate: use new entrypoint on rpm-ostree >=2023.2
rpm-ostree 2023.2 dropped the `rpm-ostree container-encapsulate` entrypoint.
Instead, we have to use `rpm-ostree compose container-encapsulate`.

Adjust the code that it selects the correct entrypoint based on the rpm-ostree
version.

Since the new stage now requires python-yaml, add it to the buildroot and
regenerate all manifests.
2023-08-08 12:41:17 +02:00
Ondřej Budai
09fa9e9def test/data/stages: Document the changes to the tests 2023-08-08 12:41:17 +02:00
Ondřej Budai
fbe6e3ed97 manifests: remove no longer needed f34-build-v2
It's just no longer required by anything, yay!
2023-08-08 12:41:17 +02:00
Ondřej Budai
59edb5ea6c test/data/stages: update to the new structure
This commit changes these manifests to use the new fedora-vars.ipp and
fedora-build-v2.ipp infrastructure to remove all hardcoded Fedora versions.

Note that this is currently limited only to stage tests that already use v2
manifests. v1 manifests will come later.

Notes:
The buildroot needs additional packages: zstd and openscap-utils. Thus,
all manifests had to be regenerated.

GPG keys were added where missing.

The oscap.remediation stage now creates a bunch of files with timestamps in
their names under /var/lib/authselect/backups. Thus, the newly introduced
`added_directories` directive is used to handle them.

I reviewed all changes in `diff.json` files, and they all seem sane given
that we jumped 4 releases forward.
2023-08-08 12:41:17 +02:00
Ondřej Budai
5045bde6b7 tools/tree-diff: make its output stable
I don't see a reason why not to make the default output from tree-diff always
stable.

The stage tests already do that before running the comparison.
2023-08-08 12:41:17 +02:00
Ondřej Budai
04c545c39c tools: introduce a tool for generating diffs for stage tests
There hasn't ever been an official tool for this and everyone was just using
the output from the test to generate the diff. This commit introduces a proper
tool for generating these files.
2023-08-08 12:41:17 +02:00
Ondřej Budai
16294997d3 test_stages: allow specifying a whole added directory
This commit adds support for a new field in tree diffs fed to the stage tests.
This is useful when you care that a directory is added, but you don't care
about its content.

Since this is useful only for the expected tree diff, it's supported only
there. The actual tree diff doesn't support the new field.
2023-08-08 12:41:17 +02:00
Ondřej Budai
f0c5dfb3a3 manifests/fedora-ostree-tarball: update to the new structure
This commit changes this manifest to use the new fedora-vars.ipp and
fedora-build-v2.ipp infrastructure to remove all hardcoded Fedora versions.
2023-08-08 12:41:17 +02:00
Ondřej Budai
111fc97035 manifests/fedora-ostree-container: update to the new structure
This commit changes this manifest to use the new fedora-vars.ipp and
fedora-build-v2.ipp infrastructure to remove all hardcoded Fedora versions.

We are also able to remove the container manifests from the Makefile,
because they are no longer depending on the old f34-build-v2.json.
2023-08-08 12:41:17 +02:00
Ondřej Budai
9a9834a309 manifests/fedora-ostree-bootiso*: update to the new structure
This commit changes this manifest to use the new fedora-vars.ipp and
fedora-build-v2.ipp infrastructure to remove all hardcoded Fedora versions.

An auto-generated ostree ref and isolabel was added to fedora-vars.

smc-meera-fonts was retired, so this commit changes it to rit-meera-new-fonts.
See
a8fe0d2620

icfg and reiserfs-utils are gone too, and they don't seem to be neccessary for
the image, so they were removed as well. Please correct me, if I am wrong.
2023-08-08 12:41:17 +02:00
Ondřej Budai
aeec48619b manifests/fedora-container: update to the new structure
This commit changes this manifest to use the new fedora-vars.ipp and
fedora-build-v2.ipp infrastructure to remove all hardcoded Fedora versions.
2023-08-08 12:41:17 +02:00
Ondřej Budai
82b7053983 manifests/fedora-vars: update to fedora 38
What? I can just edit variables in one files and all(*) manifests get updated
content? That's impressive.

(*) We will be able to do all once we migrate all to the new format. For now,
    the usual disclaimer applies:

    This change is applied only to manifests based on fedora-build-v2 for now.
2023-08-08 12:41:17 +02:00
Ondřej Budai
baca25f7cb manifests: fix module_platform_id
module_platform_id has a format of `platform:f34`. I have no idea why just
`f34` is used. Let's fix it.

This change is applied only to manifests based on fedora-build-v2 for now.
2023-08-08 12:41:17 +02:00
Ondřej Budai
ed16da70eb manifests: factor repositories and gpg keys out
They are the same everywhere, we can just factor them out and save some bytes.

This change is applied only to manifests based on fedora-build-v2 for now.
2023-08-08 12:41:17 +02:00
Ondřej Budai
9286515821 manifests: move vars to a separate file
This change is applied only to manifests based on fedora-build-v2 for now.
2023-08-08 12:41:17 +02:00
Ondřej Budai
64cc289bf7 manifests: remove vars from fedora-build-v2
Defining variables in the build pipeline is potentially dangerous, because
it can lead to the buildroot using a different package set than the other
pipelines.

Thus, this commit removes the variables from the build manifest. Since now on,
the variables must be defined before the build manifest is included.

Since the build manifest is no longer buildable on its own, let's remove it
from mpp.yaml to ipp.yaml. This is a convention set by the automotive team:
ipp manifests are not meant to be directly buildable, they are only useful
for embedding.
2023-08-08 12:41:17 +02:00
Ondřej Budai
f777eb5ac2 convert all mpp.yaml files to proper YAML
This is the second step of the conversion. All mpp.yaml json files were loaded
and dumped again with pyyaml. It was tweaked to keep the order of keys and to
save multi-line strings in the "flow" style. This was done, so the GPG keys
are kept on one line. Otherwise, they take up too much visual space.

There is no functional change in this commit.
2023-08-08 12:41:17 +02:00
Ondřej Budai
d827be2fb2 rename all .mpp.json files to .mpp.yaml
osbuild-mpp supports yaml files. The advantage of yaml is that it's less
verbose and allows comments. This way, we can start documenting all the
test manifests in this repository.

This is the first step: This commit just renames the files, so we keep the
history intact. Remember: YAML is a super-set(*) of JSON, so this is fine.

There is no functional change in this commit.

(*) There are some caveats, but we don't need to care in this case.
2023-08-08 12:41:17 +02:00
Ondřej Budai
2d23f9c17c samples: remove empty el8-ostree-bootiso.json
No idea why this is here.
2023-08-08 12:41:17 +02:00
Colin Walters
6f81c59894 ostree.encapsulate: It's rpm-ostree, not ostree
We have a lot of copypasta of `def ostree()` but in this
case it's actually rpm-ostree, and we should be clear about that.

(Also in the future this code will need to change
 to use the non-deprecated entrypoint, see
 https://github.com/coreos/rpm-ostree/pull/4527 )
2023-08-05 23:42:50 +02:00
Simon de Vlieger
427e82e0c0 osbuild: --checkpoint can now use globs
When developing or rebuilding manifests a lot it is common to want to
checkpoint everything to the store. It seems we all have small shell
scripts hanging around for this.

Let `--checkpoint` take a shell-like glob such as `--checkpoint="*"` to
checkpoint everything.

Note that there's a behavioral change here; previously `osbuild
--checkpoint=a` would error if that specific checkpoint wasn't found.
Now `osbuild` will only error if nothing was selected by the passed
globs.
2023-08-04 19:59:11 +02:00
schutzbot
14d31633a4 schutzfile: Update snapshots to 20230801 2023-08-02 13:59:51 +02:00
schutzbot
b8836948c5 Post release version bump
[skip ci]
2023-08-02 08:15:32 +00:00
Simon de Vlieger
10e7046301 ci: drop some Python versions
This limits the list to the Python versions found in current Fedoras,
RHELs, and CentOS Streams.
2023-08-01 15:01:13 +02:00
Simon de Vlieger
d60690ce46 tox: add tox
`tox` is a standard testing tool for Python projects, this allows you to
test locally with all your installed Python version with the following
command:

`tox -m test -p all`

To run the tests in parallel for all supported Python versions.

To run linters or type analysis:

```
tox -m lint -p all
tox -m type -p all
```

This commit *also* disables the `import-error` warning from `pylint`,
not all Python versions have the system-installed Python libraries
available and they can't be fetched from PyPI.

Some linters have been added and the general order linters run in has
been changed. This allows for quicker test failure when running
`tox -m lint`. As a consequence the `test_pylint` test has been removed
as it's role can now be fulfilled by `tox`.

Other assorted linter fixes due to newer versions:
- use a str.join method (`consider-using-join`)
- fix various (newer) mypy and pylint issues
- comments starting with `#` and no space due to `autopep8`

This also changes our CI to use the new `tox` setup and on top of that
pins the versions of linters used. This might move into separate
requirements.txt files later on to allow for easier updating of those
dependencies.
2023-08-01 15:01:13 +02:00
Simon de Vlieger
a7b75bea3b osbuild-dev: use sys.exit
For consistency with the rest of the codebase, switch `osbuild-dev` over
to use `sys.exit` instead of `SystemExit`.
2023-07-20 15:29:35 +02:00
Simon de Vlieger
b9876690f6 osbuild-dev: add --simple to diff
This option switches to `diff -u` instead of `vimdiff`.
2023-07-20 15:29:35 +02:00
Simon de Vlieger
dce36ab420 osbuild-dev: properly exit and validate manifest 2023-07-20 15:29:35 +02:00
Simon de Vlieger
6ad906085c osbuild-dev: include in fedora package 2023-07-20 15:29:35 +02:00
Simon de Vlieger
9525655fb4 osbuild-dev: understand more input formats
The schemas allowed for `inputs` changed a while back; most new
manifests use a different format than what `osbuild-dev` initially
understood.

This adds all schemas.
2023-07-20 15:29:35 +02:00
schutzbot
722d023104 Post release version bump
[skip ci]
2023-07-19 08:13:33 +00:00
Gianluca Zuccarelli
74eed6a33b stages: add openscap autotailor stage
Add a new stage to generate an OpenSCAP tailoring file. The stage
overrides a base OpenSCAP profile by enabling and disabling user
selected rules and creates a new profile name which can be used for
OpenSCAP scanning and remediation.
2023-07-18 15:29:13 -07:00
Brian C. Lane
8f6535cacc org.osbuild.rpm: Add some context to rpmkeys failure
This will hopefully help debug problems when the signature check fails.
You need to manually take the hash and look it up in the manifest
sources list to figure out what package failed since this stage doesn't
have access to sources.
2023-07-18 18:42:47 +02:00
Brian C. Lane
3318ac95ab Schutzfile: Fix f38 snapshot references
Fedora 38 is no longer branched. Switch to the release names for the
snapshots.
2023-07-18 15:34:01 +02:00
Simon de Vlieger
f1b79c8a73 stage: anaconda, allow access to more config
Anaconda has deprecated the `kickstart_modules` directive and instead
now has `activatable_`, `forbidden_`, and `optional_modules`. This is
available starting in Fedora 35.

This change allows frontend code (`osbuild-composer`) to put version
checks in place to write the correct keys.
2023-07-18 13:41:05 +02:00
Ondřej Budai
4439297cc4 test/data: introduce UKI also for CentOS Stream
This is a straightforward port of the UKI from Fedora to CentOS Stream.
Changes:

- Packages that does not exist in CS9 were removed:
  - shim-ia32
  - grub2-efi-ia32-cdboot
  - btrfs-progs
- Squashfs compression was changed from lz4 to gzip, because lz4 for squashfs
  isn't enabled in RHEL 9 kernel
2023-07-18 11:30:09 +02:00
Ondřej Budai
c01caae3ac stages/squashfs: add support for zstd compression
Fedora and RHEL 9 kernels support it and since it's an interesting alternative
to other compression methods, we should support it in osbuild.

I also took the liberty of sorting the compression methods alphabetically.
2023-07-18 08:58:26 +02:00
Brian C. Lane
917f628bba Schutzfile: Add Fedora 39 rawhide repos 2023-07-17 12:18:10 +02:00
Brian C. Lane
43d776e55e terraform: Add f39 runners 2023-07-17 12:18:10 +02:00
Brian C. Lane
e9d795a279 .gitlab-ci.yml: Run rpmbuild for Fedora 39
The osbuild-composer libdnf5 PR needs osbuild artifacts for Fedora 39 in
order to run the tests.
2023-07-17 12:18:10 +02:00
Simon de Vlieger
82e72f1b64 test: update test for sysconfig 2023-07-17 12:15:12 +02:00
Simon de Vlieger
36ee0d3edc stages/sysconfig: add desktop support 2023-07-17 12:15:12 +02:00
Simon de Vlieger
829183a1f3 stages/sysconfig: add livesys support 2023-07-17 12:15:12 +02:00
Ondřej Budai
dc372bbdea stages/rpm: set machine-id to 444
According to the systemd spec file, /etc/machine-id should have the 444
permissions. Thus, we need to chmod the file to 444 after it's created.

See:
 - 9c05b44a4b/f/systemd.spec (_821)
 - https://bugzilla.redhat.com/show_bug.cgi?id=2221269
 - https://issues.redhat.com/browse/COMPOSER-1992
2023-07-12 10:53:31 +02:00
Eric Curtin
d2b6a2e570 runners: Asahi Fedora Remix to Fedora Asahi Remix
This name got changed in Fedora 38, basically the Fedora and Asahi were
flipped.
2023-07-07 16:13:09 +02:00
schutzbot
06072d5d89 Post release version bump
[skip ci]
2023-06-27 12:58:15 +00:00
Ondřej Budai
c90b587dcc inputs: Move arguments for InputService.map to a temporary file
Prior this commit, the arguments for the input service were passed inline.
However, jsoncomm uses the SOCK_SEQPACKET socket type underneath that has
a fixed maximum packet size. On my system, it's 212960 bytes. Unfortunately,
that's not enough for big inputs (e.g. when building packages with a lot
of rpms).

This commit moves all arguments to a temporary file. Then, just a file
descriptor is sent. Thus, we are now able to send arbitrarily sized args
for inputs, making osbuild work even for large image builds.
2023-06-27 10:56:10 +02:00
Alexander Todorov
8c29e8144d CI variable name has changed,
see
25d1a458a0
2023-06-26 19:51:42 +02:00