Commit graph

1907 commits

Author SHA1 Message Date
Tom Gundersen
e175529f7c sources/curl: don't limit total download time
Some RPMs might be very large, and limiting the total download time
might lead to failed build even in cases where downloading is making
progress. Instead, set a minimum download speed (1kbps). If the
minimum is not surpassed for 30 seconds in a row, the download fails
and is retried. This follows the logic employed by DNF.

Adjust the number of retries to 10 and the connection timeout to 30,
in order to match what DNF does. One difference is that DNF does 10
retries across all downloads, whereas we do it per download, this
could be changed in a follow-up.

Old:
 - a download taking more than 5 minutes is unconditionally aborted

New:
 - slow but working downloads will never be aborted
 - downloads will be stalled for at most five minutes
   in total before being aborted
 - time spent making progress does not count towards
   the five minutes

Signed-off-by: Tom Gundersen <teg@jklm.no>
2022-03-16 14:48:03 +01:00
Laura Barcziova
87d1299888 Packit: build SRPMs in Copr
Add srpm_build_deps key to the Packit configuration to specify the needed dependencies for SRPM build
and indicate to build SRPM in Copr.
2022-03-09 13:38:29 +00:00
ochosi
53a598afec Post release version bump
[skip ci]
2022-03-04 15:49:16 +00:00
Christian Kellner
d8f36b55fa stages/grub2: option to configure GRUB_DEFAULT
Add a new attribute `config.default` that when set will be written to
`GRUB_DEFAULT`. This should be set to `saved` when a `saved_entry` is
specified so that the functionality will be preserved if the grub cfg
gets regenerated (which is really should not, but we can not prohibit
it).
2022-03-04 16:38:41 +01:00
Tomas Hozza
9054da7d25 stages/firewall: fix fail when setting only the default zone
When the firewall stage is provided with stage options, which set only
the default firewall zone, the `firewall-offline-cmd` command is
executed unconditionally without any parameters. This is because in this
case `ports`, `enabled_services` and `disabled_services` are all an
empty lists. This results in a failure with the following error message:

`Opening of '/etc/sysconfig/system-config-firewall' failed, exiting.`

Make sure that the second invocation of `firewall-offline-cmd` happens
conditionally, only when at least one of the `ports`, `enabled_services`
or `disabled_services` is a non-empty list.

Adjust the stage test to cover this scenario.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-03-04 10:02:27 +01:00
Christian Kellner
3b40125d4a test/lvm2: separate stdout and stderr
In all the invocation of `subprocess.run` stderr and stdout were both
combined in a shared pipe, but lvm sometimes spits out notices and
informational messages on stderr and thus potentially interfering
with the data we are interested in on stdout. Separate the two.
2022-03-04 08:42:35 +01:00
Christian Kellner
81c9444cd5 devices/lvm2.lv: separate stdout and stderr
In all invocations of `subprocess.run` stderr and stdout were both
combined in a shared pipe, but lvm sometimes spits out notices and
informational messages on stderr and thus potentially interfering
with the data we are interested in on stdout. Separate the two.
2022-03-04 08:42:35 +01:00
Christian Kellner
5a5da44c06 stages/rpm: option to import gpg keys from tree
Add a new option `gpgkeys.fromtree` that when specified will
import the specified gpg keys from files located in the tree,
such as `/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release`.
2022-03-04 08:37:38 +01:00
Christian Kellner
7676c459e4 runners: add org.osbuild.fedora37
Fedora has branched, add the corresponding runner.
2022-03-03 10:40:47 +01:00
Jakub Rusz
8f430733c1 ci/deploy: use public EPEL-9 2022-03-02 16:59:11 +01:00
Tomas Hozza
e71a91f5d0 Extend firewall stage to set the default zone
Extend the firewall stage to allow setting the default firewall zone.
Modify the stage unit test accordingly.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-03-02 16:43:22 +01:00
lavocatt
3eb91401cf Post release version bump
[skip ci]
2022-03-02 13:35:20 +00:00
Jelle van der Waa
00c6bf2376 test: update arch manifests for new stages 2022-03-01 16:07:27 +01:00
Jelle van der Waa
b7fe5c724f stages: add org.osbuild.pacman.mirrorlist.conf
Stage for configuring the pacman mirrorlist file.
2022-03-01 16:07:27 +01:00
Jelle van der Waa
11f8eef5b5 stages: add pacman keyring stage
This stage initialises the pacman keyring which is required for pacman
packages to be installed.
2022-03-01 16:07:27 +01:00
Jelle van der Waa
25d43dd82e stages: add the ability to configure pacman repos
Without configured repositories the generated pacman.conf isn't super
useful. Pacman supports two different ways to configure a repository
either with a Server = line or sourced from pacman's mirrorlist.
2022-03-01 16:07:27 +01:00
ochosi
20231c8918 Post release version bump
[skip ci]
2022-02-27 19:00:46 +00:00
Christian Kellner
6300a80c84 util/udev: fix path for udev device inhibitor
The udev inhibitor rules are checking for `device-$major:$minor`
but we created them with `f"device-{major}-{minor}"`. So they
did indeed not actually work. Fix that.
2022-02-27 18:47:17 +01:00
Tomas Hozza
8102f20d23 Add RHEL-9.1 runner
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-25 16:42:22 +01:00
ochosi
97905f6e0c Post release version bump
[skip ci]
2022-02-23 19:13:10 +00:00
Christian Kellner
8f75d1e7a1 stages: add new org.osbuild.fdo stage
This stage is needed to write down the FDO DIUN pub key root certs
needed to talk to the manufacturer server to grab the device credentials
for provisioning and later onboarding

Co-Authored-By: Antonio Murdaca <runcom@linux.com>
2022-02-23 15:32:02 +00:00
Jakub Rusz
89666714f4 rpmbuild: run on centos-9
Also update terraform SHA and EPEL installation for mockbuild.
2022-02-22 18:05:51 +00:00
Christian Kellner
d8bfe13fdd stages/oci-archive: fix creation time format
According to OCI image specification the `created` property needs
to be in the format describe in RFC 3339, section 5.6 "Internet Date /
Time Format". The suffix is the "time-offset" which is either "Z" or
"time-numoffset".
Before commit 25b5679[2] we the datetime object, created via `utcnow`
did not have timezone information so "Z" was manually appended. This
was changed with commit 25b5679 and now the timezone information was
indeed included, which also meant that `isoformat` now included the
offset, i.e. `+00:00`. But the `Z` was still appended and the result
was `+00:00Z`, something that is not standard compliant. Fix this
by removing the extra `Z`.

[1] https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
[2] 25b567990b
2022-02-22 10:04:08 +00:00
Thomas Lavocat
1ceb096594 host: add support for emitting signals
Add support for emitting signals to host.Service which can be used to
transmit data back to the client during an ongoing method call. This
provides the possibility for the services to send information to their
client counterpart while running. The signal can take file descriptors
as extra parameters to send data on separate files.
2022-02-22 10:38:43 +01:00
Antonio Murdaca
f768781589 stages: add luks remove-key stage
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-02-16 15:43:19 +01:00
Antonio Murdaca
25ecd12b3d stages: add clevis-luks-bind stage
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-02-16 15:43:19 +01:00
chloenayon
5a7d3eee86 Post release version bump
[skip ci]
2022-02-16 14:16:11 +00:00
Alexander Larsson
e9d02a27bb skopeo stage: remove overlay/backingFsBlockDev file after install
Each time the overlay backend runs on an xfs fs it creates the
file "overlay/backingFsBlockDev" in the containers storage directory.

It is not needed in the image as skopeo recreates it each boot, and
since it is a block device its existance means we can't store the
resulting tree in ostree. Lets just get rid of it.
2022-02-15 19:13:00 +01:00
Christian Kellner
62dab7be3d ci: add test_executable to test matrix
I don't see a reason as not run the test. Do so.
2022-02-15 13:25:23 +00:00
Christian Kellner
f7af3042ca test: fix executable test
During the rework done in commit "use and require explicit exports"
with commit id 7ae4a7e78, the test got overlooked. Add an empty
list of checkpoints to the `obs.compile` invocation as to actually
trigger the osbuild invocation.

Reported-By: Thomas Lavocat <tlavocat@redhat.com>
2022-02-15 13:25:23 +00:00
Roy Golan
ed82f33c8f Fix type orci-archive/oci-archive
Signed-off-by: Roy Golan <rgolan@redhat.com>
2022-02-14 14:15:19 +01:00
Alexander Larsson
7c9944ee18 Update the skope test stage
Drop format and file options and convert the hello.img from
docker to oci format.
2022-02-10 14:43:17 +01:00
Alexander Larsson
1152edcf31 inputs/org.osbuild.containers: Drop format and file options
We hardcode oci-archive for now and use the first file in the pipeline
tree as the archive. Long term we may want to get this info from the
metadata of the oci-archive stage instead.
2022-02-10 14:43:17 +01:00
Alexander Larsson
13c0c1e59e test: Add skopeo tests
There is a source test that installs a pre-build, embeded image file
and ensure all the right files are installed. This uses the vfs driver
because then it works everywhere, including the CI (which doesn't do
overlayfs).

Then the is a source test that downloads a minimal image from
a faked registry on localhost.

For the registy API to work the "/v2" entry-point in the webserver has
to be at the root, so there is a symlink in test/data:

  v2 -> sources/org.osbuild.skopeo/data/v2

But otherwise the data is localized to sources/org.osbuild.skopeo.
2022-02-10 14:43:17 +01:00
Alexander Larsson
693e44e412 sources test: Support custom mimetypes in http server
By creating a `foo.mimetype` file you can override the mimetype returned
for the file `foo`.
2022-02-10 14:43:17 +01:00
Alexander Larsson
dbaed75b46 osbuild-mpp: Support mpp-resolve-image for container images 2022-02-10 14:43:17 +01:00
Alexander Larsson
66cc2900c9 obuild-mpp: Add process_stage() helper
Both file embedding and depsolves start by iterating over all stages,
and we want to add another similar one for container installs, so
break out the iteration over the containers so that it is done in
one place only.
2022-02-10 14:43:17 +01:00
Alexander Larsson
46a228df38 Add support for installing containers in images
This adds a stage called org.osbuild.skopeo that installs docker and
oci archive files into the container storage of the tree being
constructed.

The source can either be a file from another pipeline, for example one
created with the existing org.osbuild.oci-archive stage, or it can
be using the new org.osbuild.skopeo source and org.osbuild.containers
input, which will download an image from a registry and install that.

There is an optional option in the install stage that lets you
configure a custom storage location, which allows the use of the
additionalimagestores option in the container storage.conf
to use a read-only image stores (instead of /var/lib/container).

Note: skopeo fails to start if /etc/containers/policy.json is
not available, so we bind mount it from the build tree to the
buildroot if available.
2022-02-10 14:43:17 +01:00
Alexander Larsson
b6629de7b2 Add skopeo to f34-build-v2 manifest
This will be needed to test the container support.
Also update the test data
2022-02-10 14:43:17 +01:00
Alexander Larsson
0c4b83e6e9 Update to the latest osbuild-ci container (with skopeo) 2022-02-10 14:43:17 +01:00
Jakub Rusz
d878824696 ci: remove fedora-33 and add fedora-35 2022-02-09 10:52:21 +01:00
Jakub Rusz
df189a7301 ci: update to 8.5 ga runners 2022-02-09 10:52:21 +01:00
Alexander Larsson
d57eeb38b9 Pass source-epoch to stages only if set
The client side does meta.get("source-epoch", default), but for
this to work we need to have the key unset if not specified,
but currently we set it to None.

Also, make sure the check for "not None" is explicit, because
we do consider a value of `0` to be a valid source-epoch.
2022-02-09 09:58:49 +01:00
Alexander Larsson
1897eaf8bc org.osbuild.oci-archive: Try to create more reproducible images
This tries to make the various tar-balls produced by the stage more
likely to be identical in separate runs. We do this by sorting
the names and removing some unnecessary metadata for the files.

The most important thing to get right is the layer tarball, because
that is what defines the container id. We sort the names to avoid
random differences, and drop ctimes and atimes because these are
generally just set to the something near the current build time which
is not useful to encode in the container image. This is as opposed
to the mtime which generally comes from e.g. the rpms that where
installed in the pipeline.

For the actual archive tarball we can standardize metadata even more,
because none of the metadata are used when consuming the archive.
2022-02-09 09:58:49 +01:00
Alexander Larsson
25b567990b oci-archive stage: Use source-epoch as creation data
If the source-epoch is specified, this is used as the creation date
instead of the current time.
2022-02-09 09:58:49 +01:00
Alexander Larsson
0ab4a6d401 Pipeline: Pass down the source-epoch to stages via the meta key
This can be used by stages that wish to support more reproducible
builds.
2022-02-09 09:58:49 +01:00
Alexander Larsson
b31c91d671 v2: Add source-epoch key in pipeline declaration and pass to buildroot
If this is set it is passed down to all stages and set as
SOURCE_DATE_EPOCH in the buildroot environment. This implements
the spec at:
  https://reproducible-builds.org/docs/source-date-epoch/
2022-02-09 09:58:49 +01:00
Alexander Larsson
e516bf7898 BuildRoot: Support adding custom env vars
We will need this later to set SOURCE_DATE_EPOCH in the build.
2022-02-09 09:58:49 +01:00
Thomas Lavocat
31fb124716 bootiso: add the option to compress using lz4 2022-02-08 16:02:36 +01:00
Ondřej Budai
172c4bcfaf runners: add rhel-87
As always, it can be just a symlink to rhel-82
2022-02-08 11:37:05 +01:00