Replies: 15 comments 78 replies
-
Sign-offsReviewedApproved |
Beta Was this translation helpful? Give feedback.
-
Is producing an SBOM for these fetched RPMs in-scope? Just asking because I don't see any mention of it |
Beta Was this translation helpful? Give feedback.
-
Are possible modifications discussed here: rpm-software-management/rpm#2908 (comment) going to be reflected in the lockfile format proposed here? I think it should be. |
Beta Was this translation helpful? Give feedback.
-
The need for
and the rest is left to the caller. The reason for that is that by doing
and
Not only cachi2 mandates the repos to be exposed locally under |
Beta Was this translation helpful? Give feedback.
-
This design doesn't factor in any potential GPG usage, does factoring it in change anything about this design? IOW to ensure a high level of SLSA in the secure supply chain we might want to be able signing the created repository and hence ensuring their integrity and authenticity for the rest of the steps in a pipeline for which supporting GPG might be suitable. |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Can you elaborate some more on the modularity use case to get full picture of the ultimate future architecture? |
Beta Was this translation helpful? Give feedback.
-
Sources are arch independent, shouldn't they be under |
Beta Was this translation helpful? Give feedback.
-
I updated the lockfile format with items |
Beta Was this translation helpful? Give feedback.
-
I am opening a new thread here to find out what is the blocker for the design to be approved. |
Beta Was this translation helpful? Give feedback.
-
I know the tool to generate the lockfile is out of scope, but would there be a way to tell if the content of sources actually match the .rpm files that are listed in the lockfile? And how much do we care about this accuracy? The reason I'm asking this is because, in our current pipeline, this is an important matter, to the point that pre-compiled binaries for languages such as Python are completely forbidden, and compilation must be done from sources during build time. |
Beta Was this translation helpful? Give feedback.
-
Generate .repo files on the cachi2's output? Currently, there are these options:
Thoughts? |
Beta Was this translation helpful? Give feedback.
-
I updated the design based on your comments. Summary of changes:
|
Beta Was this translation helpful? Give feedback.
-
Come on, that's just not going to work in practice. You say "doesn't require changes to Containerfile"...yes, but in reality it will because users will need to add packages in two places, and would lead to a desire to deduplicate. Our world really does not need another RPM lockfile format. We have a lot of tools already in this space (xref osbuild/osbuild#1134 ); there's one actively used in fedora-coreos and osbuild too. Lockfile handling should be in dnf. Also, we should add a declarative format there (that isn't a lockfile necessarily). |
Beta Was this translation helpful? Give feedback.
-
Based on the comments #502 I made some changes in the design:
The output now looks like:
|
Beta Was this translation helpful? Give feedback.
-
Introduction
Containers want to install RPMs at build time. This is not possible when the build doesn’t have access to the negslirtwork (hermetic build). This feature is meant to enable such workflow.
The general idea is that the developer specifies ahead of time what RPMs they want to have available. In a step before the actual build, cachi2 takes this information, downloads all of the packages and prepares a repository that will be available during build.
Requirements
Block schema
The image shows the main function blocks, input and outputs. In the first phase (MVP) only a subset of the whole functionality will be delivered. That means processing the lock file, and gathering (downloading) all required items (RPMs, source RPMs) into a directory structure that will represent input for a container build process. The basic fetch command will produce SBOM with metadata of fetched RPMs too.
As a next (optional) step, the other cachi2 command (
generate-env
orinject-files
) will process the structure created in the previous step and will generate repositories and .repo file.rpms.lock.yaml
Works as a configuration input file for prefetching. The format allows multiple architectures to be listed.
or values are not mandatory - when not specified, a random repoid name is generated.
checksum key and are not mandatory either - when not specified, (S)RPM file verification won't be performed after download.
An example of the format follows.
Input
Output
The given output path is populated with the following structure. The
"deps/rpm" part - this part of the path is for compatibility with other package manager modules cachi2 works with (for example "deps/npm").
The SBOM file format is CycloneDX and PURLs is generated as per specificiation
Example:
The optional 2nd step will add metadata
Content of cachi2.repo file (with as many repositories included as used in the lockfile):
Note that the repo identifiers in the filesystem structure match the identifiers in the repo file, and come from the lockfile.
If wasn't specified, a random value is generated. And the section will additionally contain the key
name
with an additional comment.The subdirectory for the corresponding architecture can be mounted into the build container to /etc/yum.repos.d/.
Benefits
Important things to keep in mind
What about …
… handling dependencies
It doesn’t. Users are required to include all transitive dependencies in the rpms.lock.yaml file. Ideally, a tool would do this for them.
The prefetching step doesn’t really care about dependencies. It just downloads and prepares what it’s told to.
If there is a missing dependency, there will be a failure at build time.
If the lockfile lists additional packages, the build will not use them, so it’s just wasting time and bandwidth at the prefetching step (and possibly including irrelevant sources in source containers).
Authors
Author: lsedlar
Corrections and addons: tmlcoch, onosek
Beta Was this translation helpful? Give feedback.
All reactions