Skip to content

Commit 1b7d39d

Browse files
Merge pull request #333 from fontivan/sskeard/konflux-backport-4-14
[release-4.14] Konflux backport
2 parents fa7c92b + f0a05ba commit 1b7d39d

20 files changed

+19218
-1200
lines changed

.konflux/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# See README.Konflux.md before editing this Dockerfile
2+
3+
# build stage
4+
FROM registry.redhat.io/rhel9-4-els/rhel:9.4@sha256:4988065272e68b8f1b3e14d1fd385df1f6170c4846ebd87f0af28faaaea773d8 AS build-image
5+
6+
WORKDIR /app
7+
8+
COPY . .
9+
10+
RUN PKGS="rust-toolset protobuf-compiler" \
11+
&& dnf install -y $PKGS \
12+
&& dnf clean all
13+
14+
RUN cargo build --release --bin recert
15+
16+
# runtime stage
17+
FROM registry.redhat.io/rhel9-4-els/rhel-minimal:9.4@sha256:65e57c845402711c5515af0989a2c3c69bf4066396008efd8002be0790fee6c3 AS runtime-image
18+
19+
RUN PKGS="openssh-clients" \
20+
&& microdnf install -y $PKGS \
21+
&& microdnf clean all
22+
23+
WORKDIR /app
24+
25+
COPY --from=build-image /app/target/release/recert /usr/local/bin
26+
27+
ENTRYPOINT ["/usr/local/bin/recert"]

.konflux/OWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
approvers:
2+
- konflux-approvers

.konflux/README.Konflux.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# RPM lock files in Konflux
2+
3+
## Overview
4+
When installing external software via RPMs in Konflux builds, we need to integrate a RPM lock file management in our workflow: the primary goal is to ensure that hermetic builds, required by Konflux Conforma, can pre-fetch RPM dependencies before building the Docker image. A hermetic build without lock files, relying on dynamic downloads exclusively, would fail due to no internet access otherwise.
5+
6+
More information about the hermetic builds in the [Konflux Hermetic Builds FAQ](https://konflux.pages.redhat.com/docs/users/faq/hermetic.html)
7+
8+
## RPM lock file management
9+
10+
### Generate a rpm lock file
11+
12+
We will be using a generator named `rpm-lock-file-prototype` according to the directions provided by that project in the [rpm-lockfile-prototype README](https://github.com/konflux-ci/rpm-lockfile-prototype?tab=readme-ov-file#installation) to generate the `rpms.lock.yaml`.
13+
14+
The recert image has a build stage and final runtime stage which requires different rpms to be installed.To that end, we have encapsulated the `rpms.in.yaml` and the resolved `rpms.lock.yaml` under two specific dirs which correspond to the specific stage: `lock-build` and `lock-runtime`.
15+
16+
The `rpms.lock.yaml` has been generated from the input provided by `rpms.in.yaml`: this file must be manually created from scratch by Konflux developers with the following fields:
17+
18+
1. `repofiles`: the .repo file extracted from the runtime base image for recert (a `redhat.repo` file from rhel9 so far)
19+
2. `packages`: the rpms we depend on
20+
3. `arches`: the supported architectures for building
21+
4. `Containerfile`: the Containerfile used to build the recert image.
22+
23+
### Introduce rpms based on new subscriptions
24+
25+
A subscription-manager/activation-key config has been carried out to fetch RPMs.See how to activate subscriptions in the [Konflux activation key doc](https://konflux.pages.redhat.com/docs/users/how-tos/configuring/activation-keys-subscription.html#_configuring_an_rpm_lockfile_for_hermetic_builds).
26+
27+
### Configure the .tekton yaml files
28+
29+
The push/pull tekton yaml files in `.tekton` have been configured to setup a hermetic build workflow according to the [Konflux prefetch doc](https://konflux.pages.redhat.com/docs/users/how-tos/configuring/prefetching-dependencies.html#_procedure)
30+
31+
1. Enable hermetic builds
32+
```yaml
33+
- name: hermetic
34+
value: "true"
35+
```
36+
2. Enable rpm pre-fetch per stage, configuring two directories
37+
```yaml
38+
- name: prefetch-input
39+
value: '[{"type": "rpm", "path": ".konflux/lock-build"}, {"type": "rpm", "path": ".konflux/lock-runtime"}]'
40+
```
41+
42+
3. Enable dev package managers
43+
```yaml
44+
- name: dev-package-managers
45+
value: "true"
46+
```
47+
48+
### Update rpms
49+
Konflux provides a mechanism (Mintmaker) to automatically file PRs to update RPM versions and generate the updated lockfile. At time of writing, this is limited to a `rpm.locks.yaml` file present in the project root.

0 commit comments

Comments
 (0)