Commit graph

2766 commits

Author SHA1 Message Date
Lubomír Sedlář
3987688de6 Directly import mock from unittest
It is not a separate package since Python 3.3

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-12-02 09:32:08 +00:00
Lubomír Sedlář
7d51229361 Release 4.8.0
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-29 13:53:49 +01:00
Lubomír Sedlář
bca660cd67 Drop spec file
The file became stale, and it likely won't work on any useful system.
Rather than trying to keep it up to date, let's admit it is not useful
and drop it completely.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-29 09:43:50 +01:00
Lubomír Sedlář
af10ab312b Remove python 2.7 from tox configuration
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-29 09:33:52 +01:00
Lubomír Sedlář
989a9c2565 Remove forgotten multilib module for yum
There's no more yum anymore. This was also the only user of the
pathmatch module, which is thus also removed.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-29 09:33:52 +01:00
Lubomír Sedlář
b34de57813 Drop usage of six
We no longer need to support Python 2, so there's no point in this
compatibility layer.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-29 09:29:20 +01:00
Lubomír Sedlář
8558b74d78 Ensure ostree phase threads are stopped
The ostree phase now runs in parallel with a lot of other stuff. If
there's any error while the phase is running, the compose would be
aborted but the ostree threads wouldn't be stopped automatically. With
the threads left alive, the process would never finish.

This patch makes sure that whatever happens in the other code, we always
stop the ostree phases.

Fixes: https://pagure.io/pungi/issue/1799
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-29 09:24:53 +01:00
Lubomír Sedlář
6d1428ab89 scm: Clone git submodules
If the repo contains .gitmodules file, run the commands to clone all
submodules.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-26 16:47:44 +01:00
Lubomír Sedlář
d95d1f59e2 Drop unittest2
The library is imported if available, but we never build it in any
environment where the package would be installed. It was last used for
RHEL 6 builds.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-22 13:54:46 +01:00
Adam Williamson
eb4ba5f637 kiwibuild: extend productmd type/format detection for FEX images
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-11-19 16:49:30 -08:00
Lubomír Sedlář
f5702e4c9d Remove pungi/gather.py and associated code
This commit completly drops support for Yum as a depsolving/repoclosure
backend.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-19 14:23:15 +01:00
Adam Williamson
3bc35a9a27 Reduce legacy pungi script to gather phase only (#1792)
This reduces the legacy 'pungi' script to only its gather phase,
and removes related stuff in gather.py. The gather phase is used
in the yum path through phases/gather/methods/method_deps.py, so
it cannot be entirely removed until all users of that are gone.
But we can at least get rid of the non-Koji support for creating
install trees, ISOs and repos.

Merges: https://pagure.io/pungi/pull-request/1793
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-11-19 14:23:15 +01:00
Adam Williamson
c8fe99b1aa pkgset: optimize cache check (saves 20 minutes)
The pkgset phase takes around 35 minutes in current composes.
Around 20 minutes of that is spent creating these per-arch
subsets of the global package set. In a rather roundabout way
(see #1794 ), I figured out that almost all of this time is
spent in this cache check, which is broken for a subtle reason.

Python's `in` keyword works by first attempting to call the
container's magic `__contains__` method. If the container does
not implement `__contains__`, it falls back to iteration - it
tries to iterate over the container until it either hits what
it's looking for, or runs out. (If the container implements
neither, you get an error).

The FileCache instance's `file_cache` is a plain Python dict.
dicts have a very efficient `__contains__` implementation, so
doing `foo in (somedict)` is basically always very fast no matter
how huge the dict is. FileCache itself, though, implements
`__iter__` by returning an iterator over the `file_cache` dict's
keys, but it does *not* implement `__contains__`. So when we do
`foo in self.file_cache`, Python has to iterate over every key
in the dict until it hits foo or runs out. This is massively
slower than `foo in self.file_cache.file_cache`, which uses the
efficient `__contains__` method.

Because these package sets are so huge, and we're looping over
*one* huge set and checking each package from it against the cache
of another, increasingly huge, set, this effect becomes massive.
To make it even worse, I ran a few tests where I added a debug log
if we ever hit the cache, and it looks like we never actually do -
so every check has to iterate through the entire dict.

We could probably remove this entirely, but changing it to check
the dict instead of the FileCache instance makes it just about as
fast as taking it out, so I figured let's go with that in case
there's some unusual scenario in which the cache does work here.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-11-19 00:22:09 -08:00
Lubomír Sedlář
bc60af794d Install dnf4 into test image
The fedora:latest image is now based on 41, and contains dnf5. This is
causing some tests to fail due to failing imports of dnf version 4.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-11-07 13:25:44 +01:00
Lubomír Sedlář
83f56da0f1 Update phase diagram
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-10-15 09:48:19 +02:00
Adam Williamson
18bda22fcb Don't block main image build phase on ostree_install phase
I did a time map of a Fedora compose today, and noticed that we
spend about an hour waiting for the ostree_install phase to
complete before we start up the compose_images_phase which does
all the other image builds.

This is unnecessary. Nothing else depends on ostree_install; it
should be fine to start up the extra_phase (which contains
compose_images_phase) while the ostree stuff is still running.

This implements that by splitting the ostree phases out of the
essentials_phase which contains the real precursors to the
extra_phase. We start the essentials and ostree phases together,
but only wait for the essentials phase to complete before
kicking off extra_phase, so it can start while the ostree
phase is still running.

One tweak we have to make to accommodate this is to move
image_checksum_phase out of extra_phase, to avoid it potentially
running before all ostree installer images are built. The
checksum phase is quite fast - it takes about five minutes -
and any time benefit of running it in parallel with the osbs and
repoclosure phases seems like it must be smaller than the time
loss of waiting for ostree_install before kicking off extra.

Merges: https://pagure.io/pungi/pull-request/1790
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-10-15 09:47:43 +02:00
Adam Williamson
aea8da5225 ostree_container: make filename configurable, include arch
The default base name is probably fine in most cases, but there
are some where we might want to tweak it. We already allow this
for other phases (e.g. the livemedia phase).

Also, we should include the arch in the image filename. Not doing
this doesn't blow up the compose as, while they have identical
filenames, the images for different arches are in different paths,
but it's confusing for people who actually download and use the
images.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-10-09 16:33:48 -07:00
Adam Williamson
391a5eaed5 Correct subvariant handling for ostree_container phase
The image metadata construction code allows for subvariant to be
set in the image config dict, but checks.py doesn't expect it;
fix that. Also, when a subvariant is set, use it in the image
name template rather than the variant; otherwise you can't
build more than one subvariant in any variant (they will have
identical names, which isn't alllowed).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-10-09 16:28:54 -07:00
Adam Williamson
739062ed3c image_build: drop .tar.gz as an expected extension for docker
Koji's image-build command has not been capable of producing a
docker image with .tar.gz as its extension since 2015:

https://pagure.io/koji/c/b489f282bee7a008108534404dd2e78efb2256e7?branch=master

as that commit message implies, the files have not actually been
gzip-compressed for even longer:

https://pagure.io/koji/c/82a405c7943192e3bba3340efe7a8d07a0e26b70?branch=master

so there's no point to having this any more. It is causing the
wrong productmd 'type' to be set for GCE cloud images, which *do*
have the .tar.gz extension - because docker appears in this dict
before tar-gz, their type is being set as 'docker' not 'tar-gz'.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-09-19 23:03:58 -07:00
Adam Williamson
5338d3098c move osbuild/kiwi-specific EXTENSIONS to each phase
The image-build phase's EXTENSIONS dict is meant to exactly
mirror the 'formats' that exist in the context of the command
`koji image-build`, which is driven by this phase. That nice
association was lost, however, by adding a couple of items to it
which exist for the purposes of the osbuild phase (and in the
case of .iso, also the kiwibuild phase), which import this dict
and uses it for image identification.

To make the association 1:1 again and more clearly show what's
going on here, let's move those entries out into the osbuild and
kiwi phases. osbuild now has its own dict which starts out as a
copy of the image-build one before being extended. And let's
update the relevant comments.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-09-19 23:03:15 -07:00
Lubomír Sedlář
225f04cf43 Drop compatibility helper for dnf.Package.source_name
The bug that caused the attribute to have wrong value has been fixed in
DNF a long time ago.

Fixes: https://pagure.io/pungi/issue/1786
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-09-09 10:30:00 +02:00
Lubomír Sedlář
cd2ae81e3c kiwibuild: Allow setting metadata type explicitly
It is not possible to reliably detect what the type for an image should
be in the metadata. This commit adds an option for user to explicitly
provide it.

It can only be configured on the specific image, not globally.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-29 08:46:10 +02:00
Lubomír Sedlář
d9d21d3cf4 kiwibuild: Fix location and metadata for ISOs
When Kiwi builds an ISO, it is always supposed to be bootable and should
be located in the iso/ subdirectory.

Any other kind of image should still land in images/ and be listed as
not bootable in the metadata.

Relates: https://pagure.io/pungi-fedora/issue/1342
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-28 13:07:12 +02:00
Lubomír Sedlář
d351773dab kiwibuild: Add options for version and repo_releasever
The version follows the same rules as versioning for live media etc.
That means it's always going to be set. The precedence goes like this:

 * image specific option
 * `kiwibuild_version`
 * `global_version`
 * `release_version` or `<release_version>_<label_milestone>`.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-26 08:53:10 +02:00
Lubomír Sedlář
a8dbd77f7f Release 4.7.0
JIRA: RHELCMP-13991
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-20 14:49:59 +02:00
Lubomír Sedlář
e43cf68f08 kiwibuild: Add support for type, type attr and bundle format
This is a very basic support. Whatever users specify in the new option
will be passed to the koji task.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=2270197
Related: https://pagure.io/koji/pull-request/4157
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-20 12:31:53 +00:00
Lubomír Sedlář
d546a49299 createiso: Block reuse if unsigned packages are allowed
We can have a compose with unsigned packages.

By the time the next compose is generated, the packages could have been
signed. However, the new compose would still reuse the ISO with unsigned
copies.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-14 11:09:37 +02:00
Lubomír Sedlář
c59f2371a3 Allow live_images phase to still be skipped
Without this fix existing configurations break even though they don't
use the phase.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-07 13:34:02 +02:00
Lubomír Sedlář
3b2c6ae72a createiso: Recompute .treeinfo checksums for images
Running xorriso to modify an ISO image can update content of included
images such as images/eltorito.img, unless we explicitly update the
image, which is undesirable (https://pagure.io/pungi/issue/1647).

However, when the file is changed, the checksum changes and .treeinfo no
longer matches.

This patch implements a workaround: once the DVD is written, it looks
for incorrect checksums, recalculates them and updates the .treeinfo on
the DVD. Since only the checksum is changing and the size of the file
remains the same, this seems to help fix the issue.

An additional step for implanting MD5 is needed again, as that gets
erased by the workaround.

JIRA: RHELCMP-13664
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-06 09:15:17 +02:00
Lubomír Sedlář
0726a4dca7 Drop support for signing rpm-wrapped artifacts
This was only usable in live_images phase that doesn't exist anymore,
and wasn't used much in the first place.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-08-05 10:55:08 +00:00
Adam Williamson
531f0ef389 Remove live_images.py (LiveImagesPhase)
This phase was used to create live images with livecd-creator
and 32-bit ARM images with appliance-creator. We also remove
get_create_image_cmd from the Koji wrapper as it was only used
for this phase, remove associated tests, and remove related
configuration settings and documentation.

Fixes: https://pagure.io/pungi/issue/1753
Merges: https://pagure.io/pungi/pull-request/1774
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-08-05 10:55:08 +00:00
Lubomír Sedlář
c96b5358ba Clean up requirements
* dict.sorted and funcsigs are not used anywhere anymore
* urlgrabber is used only in the yum based gather.py module, and thus
  only needed on Python 2
* py3 doesn't need to reinstall mock as that is part of stdlib now

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-07-29 10:29:31 +02:00
Haibo Lin
d1c0276761 Update pungi.spec for py3
Signed-off-by: Haibo Lin <hlin@redhat.com>
2024-07-12 17:03:09 +08:00
Haibo Lin
0cb18bfa24 Release 4.6.3
JIRA: RHELCMP-13724

Signed-off-by: Haibo Lin <hlin@redhat.com>
2024-07-12 09:30:12 +08:00
Lubomír Sedlář
f72adc03b1 Fix formatting of long line
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-06-17 10:20:10 +02:00
Lubomír Sedlář
8ced384540 unified-isos: Resolve symlinks
If the compose is configured to use symlinks for packages, the unified
ISO would include the symlinks which is useless.

Instead, let's check and replace any symlinks pointing outside of the
compose with the actual file.

JIRA: RHELCMP-13802
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-06-07 15:18:45 +02:00
Lubomír Sedlář
4a5106375e gather: Skip lookaside packages from local lookaside repo
When variant X depends on variant A, Pungi creates a temporary local
lookaside with packages from A. If there's an external lookaside
configured, the list of package for variant A can contain URLs to the
external repo.

Newer versions of createrepo fail when pkglist specifies an unreachable
package, and it doesn't do downloading.

JIRA: RHELCMP-13648
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-06-05 09:45:02 +02:00
Haibo Lin
627b72597e pkgset: Avoid adding modules to unavailable arches
If a module is not built for specific arches, pungi will skip adding it
to these arches in pkgset phase.

JIRA: RHELCMP-13625
Signed-off-by: Haibo Lin <hlin@redhat.com>
2024-05-09 15:42:06 +08:00
Lubomír Sedlář
bc0334cc09 iso: Extract volume id with xorriso if available
Pungi can use either genisoimage or xorriso to create ISOs.

It also needed isoinfo utility for querying volume ID from the ISO
image. However, the utility is part of the genisoimage suite of tools.

On systems that no longer provide genisoimage, the image would be
successfully generate with xorriso, but then pungi would fail to extract
the volume id leading to metadata with missing values.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-04-23 09:13:43 +02:00
Adam Williamson
5c9e79f535 De-duplicate log messages for ostree and ostree_container phases
The ostree and ostree_container phases both log messages in the
exact same form, which is rather confusing. This will make it
much clearer which message comes from which phase.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-04-22 06:39:50 +00:00
Lubomír Sedlář
29c166ab99 Handle tracebacks as str or bytes
Kobo 0.36.0 changed how tracebacks are handled. Instead of `bytes`, it
returns a `str`. That makes pungi fail to write it into a file opened as
binary.

Relates: https://github.com/release-engineering/kobo/pull/246
Fixes: https://pagure.io/pungi/issue/1756
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-04-15 14:02:13 +02:00
Adam Williamson
51d58322f2 ostree/container: add missing --version arg
https://pagure.io/pungi/pull-request/1726 tries to use
`self.args.version`, but the `pungi-make-ostree container`
subcommand does not actually have a `--version` arg, so that is
not going to work. This adds the required arg.

We *could* make it optional by still setting an empty update
dict if it's not specified, I guess, but not sure if that's worth
the effort.

Fixes: https://pagure.io/pungi/issue/1751

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-03-14 12:28:39 -07:00
Lubomír Sedlář
0ef1c102b8 Block pkgset reuse on module defaults change
JIRA: RHELCMP-13463
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-03-13 12:36:55 +00:00
Adam Williamson
b6cfd8c5d4 Include task ID in DONE message for OSBS phase
Again, composetracker expects the message in this format.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-03-13 12:17:11 +00:00
Adam Williamson
9f8377abab Various phases: consistent format of failure message
composetracker expects the failure message to be in a specific
form, but some phases weren't using it. They were phrasing it
slightly differently, which throws off composetracker's parsing.
We could extend composetracker to handle both forms, but it seems
simpler to just make all the phases use a consistent form.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-03-13 12:17:11 +00:00
Lubomír Sedlář
949add0dac Update tests to exercise kiwi specific metadata
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-03-13 13:06:43 +01:00
Adam Williamson
8fb694f000 Kiwi: translate virtualbox and azure productmd formats
As discussed in
https://pagure.io/releng/failed-composes/issue/6047#comment-899622
the list of 'acceptable' types and formats (in productmd terms)
is locked down in productmd, we cannot just 'declare' new formats
in pungi as we kinda wound up doing by adding these Kiwi
extensions to the EXTENSIONS dict in image_build phase. So
instead, let's return the image_build phase to the way it was,
and add an additional layer of handling in kiwibuild phase for
these awkward cases, which 'translates' the file suffix to a
format productmd knows about already. This is actually how we
would rather behave anyway, because a Kiwi-produced
`vagrant.libvirt.box` file really is the same kind of thing as an
ImageFactory-produced `vagrant-libvirt.box` file; we want them to
have compatible metadata, we don't want them to look like
different things.

Merges: https://pagure.io/pungi/pull-request/1740
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-03-13 13:06:43 +01:00
Lubomír Sedlář
8a3b64e5b8 kiwibuild: Add tests for the basic functionality
Merges: https://pagure.io/pungi/pull-request/1739
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-03-13 13:06:43 +01:00
Lubomír Sedlář
c80ebb029b kiwibuild: Remove repos as dicts
The task needs just URLs, the dics don't bring anything here.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-03-13 13:06:43 +01:00
Lubomír Sedlář
e2ceb48450 Fix additional image metadata
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-03-13 13:06:43 +01:00