Commit graph

2808 commits

Author SHA1 Message Date
Lubomír Sedlář
7b803d620f Add a tracing span around call to skopeo inspect
This call can fail and with a span we can get better visibility into
that.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-07-24 13:34:44 +02:00
Lubomír Sedlář
2c289729b9 Add retries to skopeo inspect calls
These can fail for any transient networking reason. Let's make a few
attempts before giving up.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-07-24 13:32:40 +02:00
Lubomír Sedlář
b2f82644e5 Release 4.9.4
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-07-11 09:47:18 +02:00
Lubomír Sedlář
e0a3343a4b otel: Explicitly initialize telemetry provider and tracer
Doing this setup on import is simple, but it has issues if the pungi
code is directly imported into a different process.

Specifically, ODCS may have created its own provider and set things up
as needed, and then imports pungi, which tries to set a new provider.
This is prohibited by the SDK docs, and emits a warning. In reality it
is causing spans to be attributed to a wrong service.

As a side effect, RequestsIntrumentor doesn't start, and so the parent
process will need to do that on its own instead of relying on the side
effect.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-06-18 12:15:32 +02:00
Lubomír Sedlář
73408f081d Release 4.9.3
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-06-11 11:38:04 +02:00
Lubomír Sedlář
668547ed3f Recognize wsl2 images produced by koji
The image type was added to productmd 1.45, so we should also require
that version.

Merges: https://pagure.io/pungi/pull-request/1841
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-06-11 07:26:22 +00:00
Lubomír Sedlář
1116e1f278 Specify data_files with relative paths
The paths should be relative to sys.prefix, which happens to be /usr in
the RPM world. This change should make installation with
%pyproject_install macro from a generated wheel work correctly.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-06-10 10:16:57 +02:00
Andrew Hills
33bb368149 Crossreference koji_cache from the Koji cache page
Signed-off-by: Andrew Hills <ahills@redhat.com>
2025-06-04 16:48:54 -04:00
Andrew Hills
18ed52d10b Add documentation for koji_cache configuration
Signed-off-by: Andrew Hills <ahills@redhat.com>
2025-06-04 16:36:01 -04:00
Lubomír Sedlář
ab11e0e4a9 linker: Drop ability to link dirs recursively
Nothing in the code base uses this functionality, and the semantins are
not well defined anyway when it comes to symlinks.

Now the tests are failing in Python 3.14 rebuild when hardlinking
symlinks. Rather than trying to fix the unused code, we could just drop
it.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2367780
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-05-21 15:45:18 +02:00
Lubomír Sedlář
d3630bfa6f Record exceptions for top level OTel span
If there is an exception in the code, the cli_main function captures it,
saves the traceback and exits the process.

With the original tracing span, the instrumentation never saw the actual
exception, only SystemExit. This meant the span was not recorded as
failed. (Technically python-opentelemetry 1.31.0 does record it, but
that change was reverted in 1.32.0.)

It is somewhat tricky to structure the code so that the exception is
recorded implicitly. The status update to DOOMED must happen inside the
span (in order to propagate it to the trace). Thus a new function is
exported from the tracing module to record the exception explicitly
before it gets discarded and replaced with the exit.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-05-13 11:03:52 +02:00
Lubomír Sedlář
16eda470c9 Make black happy
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-05-13 10:46:58 +02:00
Lubomír Sedlář
912baf1198 Fix jenkins tests
Defining a variable on top level is now causing the pipeline to not
execute anything and just report success.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-05-13 10:46:19 +02:00
Lubomír Sedlář
0badc6f3c2 Release 4.9.2
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-05-05 15:48:56 +02:00
Lubomír Sedlář
65336b406c Drop compatibility with Koji < 1.32
The 1.32 version with checksum API has been released more than 2 years
ago.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-04-28 12:49:02 +02:00
Lubomír Sedlář
d91adfd34d kiwibuild: Add support for use_buildroot_repo option
This option can be set for a particular image or globally for all
kiwibuild images (with individual overload).

Fixes: https://pagure.io/pungi/issue/1833
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-04-22 13:29:43 +02:00
Lubomír Sedlář
859b968483 gather: Resolve symlinks before linking packages
If we happen to have a symlink to an RPM that should be linked into the
compose, we should first resolve it to the actual path. This avoids a
problem if the symlink is relative, as otherwise Pungi would copy/link
the actual relative symlink, which would break it in the new location.

If the path is not a symlink, resolving the real path should make no
difference.

JIRA: RHELCMP-14504
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-04-22 11:19:27 +00:00
Lubomír Sedlář
004f357acb Make requests instrumentation optional
Even if basic otel dependencies are available, this instrumentor is a
separate dependency which may be missing.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-04-07 13:32:35 +02:00
Lubomír Sedlář
5731cce190 Fix incorrect log line
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-04-03 09:59:18 +00:00
Lubomír Sedlář
e135042967 Release 4.9.1
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-04-03 08:15:22 +00:00
Lubomír Sedlář
ab4b221e64 util: Fix typo in regex for container digests
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-04-03 10:05:32 +02:00
Lubomír Sedlář
3ed09991c1 Resolve container tags to digests
When the compose is configured to include any container image, it just
followed the provided URL. This is not particularly reproducible. If the
image spec contains a tag, it may point to different images at different
time.

This commit adds a step to validating the configuration that will query
the registry and replace the tag with a digest.

This makes it more reproducible, and also fixes a problem where changing
container image would not stop ISO reuse. There's still a chance of
non-container file changing and not forcing the reuse, but that is not
very common.

JIRA: RHELCMP-14381
JIRA: RHELCMP-14465
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-03-31 15:00:40 +02:00
Lubomír Sedlář
252044a911 kojiwrapper: Remove unused code
These methods were used in the live_images phase that doesn't exist
anymore.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-03-20 13:46:08 +01:00
Lubomír Sedlář
c15ddbc946 Add basic telemetry support
This patch adds support for Opentelemetry. If
OTEL_EXPORTER_OTLP_ENDPOINT env variable is defined, it will send traces
there. Otherwise there is no change.

The whole compose is wrapped in a single span. Nested under that are
spans for operations that involve a remote server.

* Talking to CTS
* Sending API requests to Koji
* Any git repo clone

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-03-17 10:58:40 +01:00
Haibo Lin
b3e0b6d7b7 Reorder ostree and ostree_installer phases
osbuild phase needs to wait for ostree phase in some cases, this patch
makes the various image build phases waiting for ostree phase, it may
introduce some slowdown, but it's still faster than the version before
PR#1790.

JIRA: RHELCMP-14349
Fixes: https://pagure.io/pungi/issue/1816
Signed-off-by: Haibo Lin <hlin@redhat.com>
2025-03-06 09:50:10 +08:00
Lubomír Sedlář
6a9c8551d2 Fix test data generation script
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-02-27 14:30:19 +01:00
Lubomír Sedlář
cb0399238e extra_isos: Mention all extra files in the manifest
When container-images are downloaded, they would be skipped from the
extra_files.json manifest. This patch fixes that by enumerating all
files rather than relying on the getter to return a list.

JIRA: RHELCMP-14406
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-02-24 15:05:37 +01:00
Lubomír Sedlář
b99bcfb5ee scm: Add retries to container-image download
If all retries fail, let's also log the error output.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-02-18 10:06:50 +01:00
Lubomír Sedlář
e33ac15d99 Release 4.9.0
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-02-13 13:37:07 +01:00
Haibo Lin
1a594e4148 scm: Fix git clone issue for git+http protocol
`git clone` failed if the URL is specified as git+http.

    git: 'remote-git+http' is not a git command. See 'git --help'.

JIRA: RHELCMP-14340
Signed-off-by: Haibo Lin <hlin@redhat.com>
2025-02-13 12:31:46 +00:00
Lubomír Sedlář
fc0de97c5e Make black happy
The latest version seems to want escape sequences written in lowercase.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-02-13 13:22:24 +01:00
Lubomír Sedlář
3c6298ee28 buildinstall: Add support for rootfs-type lorax option
JIRA: ENGCMP-5117
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-01-28 13:32:45 +01:00
Lubomír Sedlář
b3a316776e scm: Stop trying to download src arch
This simplifies configuring extra isos to avoid failing on downloading
non-existing images.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-01-27 09:30:29 +00:00
Lubomír Sedlář
46d6c48e0a extra_isos: Provide arch to extra files getter
The getter is already running once per architecture, it just doesn't
make the information available to the scm wrapper.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-01-27 09:30:29 +00:00
Lubomír Sedlář
e4d1bd4783 Move temporary buildinstall download to work/
The files should always be cleaned up immediately after the archive is
extracted, but we are seeing them being left behind for some reason.

With this page, even if the data is not cleaned up, it will not clog up
/tmp and be eventually deleted together with the compose.

JIRA: RHELCMP-14319
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-01-23 10:00:41 +01:00
Adam Williamson
2d16a3af00 Protect against decoding errors with subprocess text mode
All these are calling subprocess in 'text mode', where it will
try to decode stdout/stderr using the default encoding (utf-8
for us). If it doesn't decode, subprocess will raise an exception
and kobo doesn't handle it, it just passes it along to us, so
things blow up - see https://pagure.io/releng/issue/12474 . To
avoid this, let's set `errors="replace"`, which tells the decoder
to replace invalid data with ? characters. This way we should get
as much of the output as can be read, and no crashes.

We also replace `universal_newlines=True` with `text=True` as
the latter is shorter, clearer, and what Python 3 subprocess
wants us to use, it considers `universal_newlines` to just be
a backwards-compatibility thing - "The universal_newlines argument
is equivalent to text and is provided for backwards compatibility"

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Merges: https://pagure.io/pungi/pull-request/1812
2025-01-16 09:20:27 +01:00
Adam Williamson
98e3b3f8c4 Revert "Avoid to crash on unicode decoding errors"
This reverts commit 7d8f3b4b9b. It
doesn't really fix the problem. A better fix follows.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-01-16 09:15:17 +01:00
Lubomír Sedlář
3d5348a672 Download extra files from container registry
This could be useful for handling flatpak applications in the installer.

All of the specified containers are downloaded into a single oci
layout.

JIRA: RHELCMP-14302
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-01-10 16:34:34 +01:00
Haibo Lin
7d8f3b4b9b Avoid to crash on unicode decoding errors
As kobo.shortcuts.run can't handle binary output correctly, it causes
pungi-make-ostree crashed when rpm-ostree outputs unexpected characters.

JIRA: RHELCMP-14253
Fixes: https://pagure.io/releng/issue/12474
Signed-off-by: Haibo Lin <hlin@redhat.com>
2024-12-20 15:29:32 +08:00
Lubomír Sedlář
b058f64abe Remove python 2.7 dependencies from setup.py
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-12-19 14:16:56 +01:00
Lubomír Sedlář
8a36744f02 util: Drop dead code
These functions were only used in the legacy pungi.gather module that
has since been removed.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2024-12-19 14:16:56 +01:00
Adam Williamson
3cb8992d56 Use new container and bootable-container productmd types
In https://github.com/release-engineering/productmd/pull/181 I
added new `bootable-container` and `container` types to
productmd. This makes pungi always use the bootable-container
type for ostree_container images (previously 'ociarchive'), and
default to using the container type for Kiwi-built oci.tar.xz
container images (previously 'docker').

This is a significant change for anything that relies on
productmd/fedfind conventions to 'identify' images, as these
images will now have a different identity. But I think it's a
valuable improvement in their identities. 'ociarchive' never made
any sense as an image 'type' - it's a format - and 'docker'
wasn't a very good type for images that are explicitly OCI
container images, not Docker-native ones. We also can now easily
distinguish between 'regular' container images and ones that are
intended to be bootable.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-12-11 17:52:40 -08:00
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